Page 3 of 3 FirstFirst 123
Results 21 to 27 of 27

Thread: Apache does not process PHP

  1. #21
    Join Date
    Feb 2009
    Location
    Cymru (Wales)
    Beans
    58
    Distro
    Ubuntu 9.04 Jaunty Jackalope

    Re: Apache does not process PHP

    Quote Originally Posted by WorMzy View Post
    • Shutdown apache2
    • Uninstall everything related to Apache2 and PHP5 again
    • rm -fr /etc/apache2 and /etc/php5
    • Run sudo apt-get clean
    • Reinstall Apache2, php5 and libapache2-mod-php5
    • Hope
    Nope. Hope was in vain. I guess it's wait for my new box or install LAMPP. Probably the latter in the short term, in case I get a contract for PHP work in the meantime.

    One thing's for sure, I won't be going anywhere near Zend again.

    Cheers


    Peter
    http://www.peredur.net

  2. #22
    Join Date
    Feb 2009
    Location
    Cymru (Wales)
    Beans
    58
    Distro
    Ubuntu 9.04 Jaunty Jackalope

    Angry Re: Apache does not process PHP

    Well, this is just the weirdest thing. I uninstalled everything to do with apache and php and installed LAMPP (into /opt). I started LAMPP and ran the security scripts and all that and then tried to run the usual:

    Code:
    <?php phpinfo(); ?>
    to check that PHP was OK.

    It wasn't. I get exactly the same problem even using LAMPP. I have to be missing something absolutely fundamental here.

    Help??

    Cheers


    Peter
    http://www.peredur.net

  3. #23
    Join Date
    Dec 2006
    Beans
    2

    Re: Apache does not process PHP

    I was having the same problem. In my case the source was a condition in the configuration file at /etc/apache2/mods-available/php5.conf

    <IfModule mod_php5.c>
    AddType application/x-httpd-php .php .phtml .php3
    AddType application/x-httpd-php-source .phps
    </IfModule>


    Since we are using libapache2-mod-php5 and not mod_php, I eliminated the condition and kept the AddType statements and restarted the apache server and that solved the problem. I am not sure what put the configuration file there -- I am using Zend Framework but also a whole lot of other carp.

  4. #24
    Join Date
    Feb 2009
    Location
    Cymru (Wales)
    Beans
    58
    Distro
    Ubuntu 9.04 Jaunty Jackalope

    Re: Apache does not process PHP

    Quote Originally Posted by snyderpa View Post
    I was having the same problem. In my case the source was a condition in the configuration file at /etc/apache2/mods-available/php5.conf
    Hmm. I don't have a file called /etc/apache2/mods-available/php5.conf. Should I have?

    Cheers


    Peter

  5. #25
    Join Date
    Feb 2009
    Location
    Cymru (Wales)
    Beans
    58
    Distro
    Ubuntu 9.04 Jaunty Jackalope

    Re: Apache does not process PHP

    Quote Originally Posted by peredur View Post
    Hmm. I don't have a file called /etc/apache2/mods-available/php5.conf. Should I have?
    I realised that I didn't have the files because I'd given up and uninstalled the module. So I reinstalled it and tried again. The contents of the php5.conf file after the installion were:

    Code:
    <IfModule mod_php5.c>
        <FilesMatch "\.ph(p3?|tml)$">
    	SetHandler application/x-httpd-php
        </FilesMatch>
        <FilesMatch "\.phps$">
    	SetHandler application/x-httpd-php-source
        </FilesMatch>
        # To re-enable php in user directories comment the following lines
        # (from <IfModule ...> to </IfModule>.) Do NOT set it to On as it
        # prevents .htaccess files from disabling it.
        <IfModule mod_userdir.c>
            <Directory /home/*/public_html>
                php_admin_value engine Off
            </Directory>
        </IfModule>
    </IfModule>
    I had no luck with that, so I commented out the condition and restarted apache. Still no luck.

    Back to XAMPP on Windows for developing in PHP, then. Annoying.

    Cheers


    Peter

  6. #26
    Join Date
    Feb 2009
    Location
    Cymru (Wales)
    Beans
    58
    Distro
    Ubuntu 9.04 Jaunty Jackalope

    Re: Apache does not process PHP [Solved]

    As you'll see from the dates, I had this problem months ago and had given up on finding a solution. Today, a propos something else entirely, I ran the following commands:

    Code:
    find /etc/apache2/ -type f -exec sudo chmod 644 {} \;
    find /etc/apache2/ -type d -exec sudo chmod 755 {} \;
    sudo chown -R root:root /etc/apache2
    (For which I claim no credit. They were from: http://ubuntuforums.org/showthread.php?t=1288812. I was adding an alias file and wanted to know what permissions to give it)

    PHP is now parsed correctly, so I guess it was a permissions problem that the above has fixed.

    Cheers


    Peter

  7. #27
    Join Date
    Oct 2008
    Beans
    4

    Re: Apache does not process PHP

    I ran into this exact problem today and tried the various obvious things like removing and purging the packages and reinstalling. I also tried the permission suggestion by peredur without any effect. But then I accidently stumbled over the community help pages which said
    Be sure to clear your browser's cache before testing your site again.
    and just by doing this, things suddenly started working properly again.

    Hope this can help someone.

Page 3 of 3 FirstFirst 123

Tags for this Thread

Bookmarks

Posting Permissions

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