Results 1 to 9 of 9

Thread: PHP wont work

  1. #1

    Unhappy PHP wont work

    I have searched the forum for a solution to my PHP problem...

    I have installed a fresh opensuse 11.1 system with apache mysql and php5 selected during the installation. However although apache is working and verified by putting http://localhost in my web browser and receibving IT WORKS! msg... I cannot seem to process php scripts.

    I have tried placing a phptest.htm file containing the following code in the htdocs folder

    <html>
    <head>
    <title>PHP Test</title>
    </head>
    <body>
    <p>This is an HTML line
    <p>
    <?php
    echo This is a PHP line;
    phpinfo();
    ?>
    </body></html>

    and although I get the html line I cannot get the php line.

    Does anyone know how I need to adjust or setup php after a fresh install???


    Thanks!

  2. #2
    Join Date
    Jun 2008
    Location
    UTC+10
    Posts
    9,686
    Blog Entries
    4

    Default Re: PHP wont work

    PHP scripts must end in .php even if they are mostly HTML. There is a way to make Apache process .htm or other extensions as PHP, but for now this is the simplest approach.

  3. #3

    Default Re: PHP wont work

    Thanks for your reply... sorry I should have said that when I do change the extension to .php I get an internal error page with Konquerer and a blank page with firefox with it saying beagle is indexing..

  4. #4
    Join Date
    Jun 2008
    Location
    /dev/swat
    Posts
    1,181

    Default Re: PHP wont work

    Did you tried to restart apache in terminal?

    /etc/init.d/apache2 restart
    OR, the maybe mod php for apache is not installed.
    Linux[openSUSE, KDE], PHP, MySQL, Wordpress, Tech News, etc :
    http://anl4u.com

  5. #5

    Default Re: PHP wont work

    Hi

    Thanks... yes have restarts ./apache2 restart

    Then ./apache2 status just to be sure and it is running...

    No difference..

  6. #6

    Default Re: PHP wont work

    have also checked apache2-mod_php5 is installed and reinstalled it just to be sure. restarted apache... no difference.

    Is there any configuration that needs to be done? I would have thought it would be configured upon installing using yast?

  7. #7
    Join Date
    Jun 2008
    Location
    UTC+10
    Posts
    9,686
    Blog Entries
    4

    Default Re: PHP wont work

    Check that php5 is loaded:

    /usr/sbin/httpd2 -M

    Output should have php5_module in it.

    Also look in /var/log/apache2/error_log for clues as to what went wrong.

  8. #8

    Default Re: PHP wont work

    Thanks seems php5 wasnt loaded... have googled and managed to resolve it. Thanks for all your help.

  9. #9
    Join Date
    Dec 2008
    Location
    East of Eden (tx)
    Posts
    313

    Default Re: PHP wont work

    There is some good information at

    PHP: Installation on Unix systems - Manual

    You can get a lot of information about the php installation by using a text editor to enter:

    <?php phpinfo(); ?>

    and saving it as phpinfo.php in the root directory of your web server. Then use your browser to access it at the URL

    http://localhost/phpinfo.php

    I was surprised at the bewildeing array of information that comes up. I am a newcomer so I don't understand most of it but maybe I will in time.

    I am trying to set up website content management software (Joomla!) on localhost and this was in the book I am following. I am not an expert and don't understand much of what I am doing so I can't answer any followup questions you might have.
    #1 - openSUSE Leap 42.3; AMD A6-3670; Radeon(tm) HD; 8gb memory; 500 gb HD; KDE 5.8.7
    #2 - openSUSE Leap 42.2; Toshiba Satellite L70-A (Dual Boot - Win10); KDE 5.8.3
    #3 - openSUSE Leap 42.3; AMD A6-6400K; Radeon HD; 8gb memory; 1tb HD; KDE 5.8.7

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •