• Apache PHP not working

    From Nightfox to All on Sun Mar 27 23:00:10 2011
    Hi all -

    I've installed Apache and PHP many times and haven't had a problem getting them both working in the past, but now I'm confused, because I'm trying to set up Apache and PHP on a new machine, but when I try to load a PHP page in a web browser, Apache just sends the PHP file's text rather than actually executing the PHP page.

    It's a Windows XP setup (32-bit), and I'm trying to set up Apache 2.2.17 and PHP 5.3.6. I've tried manually setting up PHP with the .zip file, but no luck. I also tried installing PHP via the .msi installer, selecting the Apache 2.2 module option, but no luck there either. I've also tried copying the Apache and PHP .ini files from a working setup, but still no luck with that either.

    I've also tried un-installing both Apache and PHP, deleting their directories, and installed both from scratch, but even that didn't work.

    What might I be missing? I've done this on Windows many times before, and normally I can just install Apache, install PHP with the Apache 2.2 module option, and it just works.. I'm confused.

    Nightfox
  • From Jupiter@VERT/RB to Nightfox on Mon Mar 28 06:20:34 2011
    Re: Apache PHP not working
    By: Nightfox to All on Sun Mar 27 2011 11:00 pm

    I've installed Apache and PHP many times and haven't had a problem getting t both working in the past, but now I'm confused, because I'm trying to set up Apache and PHP on a new machine, but when I try to load a PHP page in a web browser, Apache just sends the PHP file's text rather than actually executin the PHP page.

    You should tell Apache what to load. My example shows
    #
    # DirectoryIndex: sets the file that Apache will serve if a directory
    # is requested.
    #
    <IfModule dir_module>
    #DirectoryIndex index.html
    # XAMPP
    DirectoryIndex index.html index.html.var index.php home.php index.php3 index.php4 index.ti index.shtml index.cfm
    </IfModule>
    Hope that helps steer you in the right direction.

    ---
    ■ Synchronet ■ Reality Bytes BBS
  • From Lord_Zoo@VERT/ZOOROPA to Nightfox on Mon Mar 28 09:22:50 2011
    Re: Apache PHP not working
    By: Nightfox to All on Sun Mar 27 2011 23:00:10

    Hi all -

    I've installed Apache and PHP many times and haven't had a problem getting t both working in the past, but now I'm confused, because I'm trying to set up Apache and PHP on a new machine, but when I try to load a PHP page in a web browser, Apache just sends the PHP file's text rather than actually executin the PHP page.

    It's a Windows XP setup (32-bit), and I'm trying to set up Apache 2.2.17 and PHP 5.3.6. I've tried manually setting up PHP with the .zip file, but no lu I also tried installing PHP via the .msi installer, selecting the Apache 2.2 module option, but no luck there either. I've also tried copying the Apache and PHP .ini files from a working setup, but still no luck with that either.

    I've also tried un-installing both Apache and PHP, deleting their directorie and installed both from scratch, but even that didn't work.

    What might I be missing? I've done this on Windows many times before, and normally I can just install Apache, install PHP with the Apache 2.2 module option, and it just works.. I'm confused.

    Nightfox

    Nightfox, you shlould see if in the apache.conf file exists the proper config sentence.

    You should see something like this:

    "LoadModule php4_module C:phpsapiphp4apache2.dll
    AddType application/x-httpd-php .php"


    And then

    "DirectoryIndex index.html index.html.var index.php "
    which means that apache will read and process php files too.

    Hope this helps.


    ---
    ■ Synchronet ■ Zooropa BBS - telnet://lordzoo.dyndns.org
  • From Nightfox to Jupiter on Mon Mar 28 07:44:47 2011
    Re: Apache PHP not working
    By: Jupiter to Nightfox on Mon Mar 28 2011 06:20:34

    You should tell Apache what to load. My example shows
    <IfModule dir_module>
    #DirectoryIndex index.html
    # XAMPP
    DirectoryIndex index.html index.html.var index.php home.php index.php3 index.php4 index.ti index.shtml index.cfm
    </IfModule>

    That only tells Apache the default files to load when the user doesn't enter a file in the URL. If the user were to enter any PHP file in the URL, or clicks a link to a PHP file on your site, Apache would have to be able to load those too.

    Nightfox
  • From Nightfox to Lord_Zoo on Mon Mar 28 07:45:48 2011
    Re: Apache PHP not working
    By: Lord_Zoo to Nightfox on Mon Mar 28 2011 09:22:50

    Nightfox, you shlould see if in the apache.conf file exists the proper confi sentence.

    You should see something like this:

    "LoadModule php4_module C:phpsapiphp4apache2.dll
    AddType application/x-httpd-php .php"

    Shouldn't the PHP installer set up all it needs in the Apache config file? I know it adds files at the end to tell Apache to load the PHP DLL..

    Nightfox
  • From Lord_Zoo@VERT/ZOOROPA to Nightfox on Mon Mar 28 16:14:27 2011
    Re: Apache PHP not working
    By: Nightfox to Lord_Zoo on Mon Mar 28 2011 07:45:48

    Re: Apache PHP not working
    By: Lord_Zoo to Nightfox on Mon Mar 28 2011 09:22:50

    Nightfox, you shlould see if in the apache.conf file exists the proper co sentence.

    You should see something like this:

    "LoadModule php4_module C:phpsapiphp4apache2.dll
    AddType application/x-httpd-php .php"

    Shouldn't the PHP installer set up all it needs in the Apache config file? know it adds files at the end to tell Apache to load the PHP DLL..

    Nightfox


    Yes, it should, but I have crossed with some installation where it fails to put this lines on the .conf.
    I don't know why, but I've seen it.


    ---
    ■ Synchronet ■ Zooropa BBS - telnet://lordzoo.dyndns.org
  • From Nightfox to All on Tue Mar 29 13:07:57 2011
    Re: Apache PHP not working
    By: Nightfox to All on Sun Mar 27 2011 23:00:10

    I somehow got past my first issue but am having another issue with PHP. It doesn't recognize the mysql or mysqli functions, even though I do have those PHP extensions installed and enabled. I've checked my Apache config for the correct PHP path, and it looks right, and my PHP ini file looks to have the mysql and mysqli extensions set up correctly. I'm not sure what the issue might be.
  • From Inside Nothing@VERT/TCHAMBER to Nightfox on Tue Apr 5 22:17:00 2011
    Re: Apache PHP not working
    By: Nightfox to All on Tue Mar 29 2011 02:07 pm

    Re: Apache PHP not working
    By: Nightfox to All on Sun Mar 27 2011 23:00:10

    I somehow got past my first issue but am having another issue with PHP. It doesn't recognize the mysql or mysqli functions, even though I do have those PHP extensions installed and enabled. I've checked my Apache config for the correct PHP path, and it looks right, and my PHP ini file looks to have the mysql and mysqli extensions set up correctly. I'm not sure what the issue might be.

    Have you confirmed the extentions are loaded by echo'ing out php_info() ?

    Patrick

    ~~~~~~~~~~~~~~~~~~~~\
    Torture Chamber BBS : Towson, MD
    Inside Nothing, SysOp
    telnet://bbs.insidenothing.com
    ~~~~~~~~~~~~~~~~~~~~~~~\





    ---
    ■ Synchronet ■ Torture Chamber B.B.S. - 192.168.100.4
  • From Nightfox to Inside Nothing on Wed Apr 6 07:47:44 2011
    Re: Apache PHP not working
    By: Inside Nothing to Nightfox on Tue Apr 05 2011 22:17:00

    Have you confirmed the extentions are loaded by echo'ing out php_info() ?

    I got it working.. For some reason, PHP set itself up in Apache's configuration file with backslashes (\) instead of forward slashes (/) which Apache needs.

    Then I found that Apache would crash upon startup. I had to comment out the pgsql extension in php.ini in order for it to start up without a problem. Thankfully I'm not using PostgreSQL..

    Nightfox