Page 1 of 2 12 LastLast
Results 1 to 10 of 18

Thread: PHP5 w/Apache2 Issue

  1. #1
    Join Date
    Mar 2007
    Location
    WA
    Beans
    69
    Distro
    Ubuntu 10.04 Lucid Lynx

    PHP5 w/Apache2 Issue [solved]

    I've been searching and searching all over, and before anyone asks - yes, I did restart apache2. Twice. The issue is that everytime I enter my /var/www/html folder, the files simply download and don't display.

    Is there anything I can post here to help with a diagnosis? This is becoming extremely aggravating.

    Thanks.
    Last edited by LiteDrive; February 19th, 2011 at 06:02 AM.

  2. #2
    Join Date
    Apr 2006
    Location
    Fresno CA
    Beans
    2,790
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: PHP5 w/Apache2 Issue

    The default installs of apache and PHP aren't configured to execute PHP. What you need is /etc/apache2/httpd.conf with the following 3 lines.

    LoadModule php5_module /usr/lib/apache2/modules/libphp5.so
    AddType application/x-httpd-php .php .phtml
    AddType application/x-httpd-php-source .phps
    Thank a veteran -- George 8)
    Internet Coach & Writer
    Personal Blog -- 3 Joes' Blog

  3. #3
    Join Date
    Oct 2006
    Location
    Sacramento, California
    Beans
    529
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: PHP5 w/Apache2 Issue

    Is PHP properly installed?

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

  4. #4
    Join Date
    Mar 2007
    Location
    WA
    Beans
    69
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: PHP5 w/Apache2 Issue

    No dice.

    I tried both of your suggestions, and all I got were a ton of errors. : /

    It may be helpful to note that all I have is apache2.conf in my /etc/apache2 folder.

    I even tried making a httpd.conf file, copied everything from the apache2.conf and pasted it into that. Upon the /etc/init.d/apache 2 restart, everything just became worse.

    Any more suggestions?

  5. #5
    Join Date
    Apr 2006
    Location
    Fresno CA
    Beans
    2,790
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: PHP5 w/Apache2 Issue

    httpd.conf and apache2.conf are separate files and can't be combined. There should be other files in there as well like ports.conf. All should have been created when apache2 was run the first time. The only configuration necessary is for PHP in the httpd.conf. Perhaps you installed one of the individual apache2 files instead of the apache2 meta package.
    Thank a veteran -- George 8)
    Internet Coach & Writer
    Personal Blog -- 3 Joes' Blog

  6. #6
    Join Date
    Oct 2006
    Location
    Sacramento, California
    Beans
    529
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: PHP5 w/Apache2 Issue

    I suggest you reinstall it.
    The easiest way is to do
    Code:
    sudo tasksel
    and select LAMP Server. This will install MySQL as well, so if that is not what you want, then this method is not what you want. However, the install for Apache and PHP is flawless.

  7. #7
    Join Date
    Mar 2007
    Location
    WA
    Beans
    69
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: PHP5 w/Apache2 Issue

    I saw the ports.conf in there, but unfortunately no httpd.conf. Should I uninstall everything and just re do it all? If so, how should I go about this?

  8. #8
    Join Date
    Apr 2006
    Location
    Fresno CA
    Beans
    2,790
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: PHP5 w/Apache2 Issue

    create httpd.conf with the 3 line from above. If it existed from the install it would be empty.
    Thank a veteran -- George 8)
    Internet Coach & Writer
    Personal Blog -- 3 Joes' Blog

  9. #9
    Join Date
    Mar 2007
    Location
    WA
    Beans
    69
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: PHP5 w/Apache2 Issue

    I did that, and then I got this output:

    Code:
     * Restarting web server apache2                                                [Fri Feb 18 20:13:51 2011] [warn] module php5_module is already loaded, skipping
    [Fri Feb 18 20:13:51 2011] [warn] module php5_module is already loaded, skipping
     ... waiting [Fri Feb 18 20:13:52 2011] [warn] module php5_module is already loaded, skipping
    [Fri Feb 18 20:13:52 2011] [warn] module php5_module is already loaded, skipping
                                                                             [ OK ]
    And unfortunately still no dice. Any other suggestions? I do appreciate the help, by the way.

  10. #10
    Join Date
    Apr 2006
    Location
    Fresno CA
    Beans
    2,790
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: PHP5 w/Apache2 Issue

    Open the browser and enter url http://localhost. Apache installed with an index.html file in /var/www which will be run as a test. That is the folder that apache will execute PHP files from. It is owned by root.
    Thank a veteran -- George 8)
    Internet Coach & Writer
    Personal Blog -- 3 Joes' Blog

Page 1 of 2 12 LastLast

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
  •