Page 1 of 3 123 LastLast
Results 1 to 10 of 22

Thread: PHP files not parsing in Ubuntu

  1. #1
    Join Date
    May 2010
    Location
    USA
    Beans
    23
    Distro
    Ubuntu 10.04 Lucid Lynx

    PHP files not parsing in Ubuntu

    I've had this problem on Windows so I came back to Ubuntu in hopes that a fresh system will install PHP right. I installed Apache2 and PHP from the command line, you know the whole Sudo Apt-get install business and was silly enough to think that it would work out of the box. Naturally, as things are with the world... it did not.

    So I have googled my problems and tried most of the things they had suggested, to no avail. It could just be that I am doing things wrong, I am a windows user and a bit rusty on my commend line.

    Apache works so long as I don't try and display a PHP file.

    I am running 11.10 Desktop edition, NOT server edition because this isn't for a sever this is for recreational coding and web design.

  2. #2
    Join Date
    Jun 2007
    Location
    Paraparaumu, New Zealand
    Beans
    Hidden!

    Re: PHP files not parsing in Ubuntu

    What exactly is happening? Is the PHP being displayed as PHP code in your browser? Is your browser trying to download a file?
    Forum DOs and DON'Ts
    Please use CODE tags
    Including your email address in a post is not recommended
    My Blog

  3. #3
    Join Date
    May 2010
    Location
    USA
    Beans
    23
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: PHP files not parsing in Ubuntu

    Quote Originally Posted by lisati View Post
    What exactly is happening? Is the PHP being displayed as PHP code in your browser? Is your browser trying to download a file?
    I should have mentioned this, duh. Forgive me it's late. In Ubuntu it asks you to download the file, in Windows it shows me the code.

  4. #4
    Join Date
    Jun 2007
    Location
    Paraparaumu, New Zealand
    Beans
    Hidden!

    Re: PHP files not parsing in Ubuntu

    Forum DOs and DON'Ts
    Please use CODE tags
    Including your email address in a post is not recommended
    My Blog

  5. #5
    Join Date
    Dec 2009
    Beans
    18

    Re: PHP files not parsing in Ubuntu

    Could you list all the apt-get install commands that you used? Did you also do this:

    Code:
    sudo apt-get install libapache2-mod-php5

  6. #6
    Join Date
    May 2010
    Location
    USA
    Beans
    23
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: PHP files not parsing in Ubuntu

    Quote Originally Posted by athampan View Post
    Could you list all the apt-get install commands that you used? Did you also do this:

    Code:
    sudo apt-get install libapache2-mod-php5
    Code:
    sudo apt-get install apache2 
    sudo apt-get install php5 
    sudo apt-get install libapache2-mod-php5 
    sudo /etc/init.d/apache2 restart
    I will go over your link and see if it helps, though I think I might have already stumbled upon it at some point.

  7. #7
    Join Date
    May 2010
    Location
    USA
    Beans
    23
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: PHP files not parsing in Ubuntu

    I went to that link and ran "sudo a2enmod php5" and the results are interesting?

    Code:
    ERROR: Module php5 not properly enabled: /etc/apache2/mods-enabled/php5.load is a real file, not touching it
    I'm not sure what that means, php5.load is supposed to be in mods enabled, isn't it?

  8. #8
    Join Date
    May 2010
    Location
    USA
    Beans
    23
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: PHP files not parsing in Ubuntu

    I completely purged everything, PHP5, Apache2, and anything even remotely related to it and installed it from scratch again. I am still getting the exact same errors. Any ideas?

  9. #9
    Join Date
    Mar 2011
    Location
    U.K.
    Beans
    Hidden!
    Distro
    Ubuntu 22.04 Jammy Jellyfish

    Re: PHP files not parsing in Ubuntu

    clear browser cache

    do you have short tags on or off in php.ini ?

    try terminal command locate php.ini to find location of php.ini

    try a simple test.php
    Code:
    <?php phpinfo(); ?>

  10. #10
    Join Date
    May 2010
    Location
    USA
    Beans
    23
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: PHP files not parsing in Ubuntu

    Well I located the multiple locations of index.php
    /etc/php5/apache2/php.ini
    /etc/php5/apache2filter/php.ini
    /etc/php5/cli/php.ini
    /usr/share/doc/php5-common/examples/php.ini-development
    /usr/share/php5/php.ini-production
    /usr/share/php5/php.ini-production-dist
    /usr/share/php5/php.ini-production.cl



    It should just be the default, which if I know my php (which I better) php 5 uses <?php ?> at least that is how I have always done it. Though it doesn't matter because it asks me to download the file anyways simply because of the php extension. The test file doesn't work because it asks me to download it.

Page 1 of 3 123 LastLast

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
  •