Now that the server is running, I don't know what's happening with PHP. The .php file saves alright, although windows doesen't recognize it. Once I go to open the file by typing "http://127.0.0.1/test.php" into my browser's address bar it says the file could not be found. The first time around it gave me an apache error mentioning that it was a bad request. Yet after some configuration of the "httpd.conf" file it now only appears as a "page can not be displayed" site.

Here is what I configured when it changed from an apache error to the "Page cannot be displayed":

#</VirtualHost>
ScriptAlias /php/ "c:/php/"
AddType application/x-httpd-php .php .phtml
Action application/x-httpd-php "c:/php/php.exe"

This is located at the very bottom of my "httpd.conf" file. I also configured my "php.ini" file only erasing a semicolon before one of the "Dynamic Extensions". It was the extension for "php_gd2.dll", my tutorial tells me that this will enable an extension, and by the looks of it this seems to enable the ".php" extension.

I may be wrong, yet I am deeply frustrated in this program's inability to work for my operating system. There is however something I did notice, the httpd.conf file does not have a mentioning of the "php.ini" file. Could this be my problem? Do I need to have a script in my "httpd.conf" file telling apache where to look for my "php.ini" file?

Once again, forgive me for my in-experience.

    Where is the file test.php?

    Is it in your htdocs (or whatever name you may have changed it to) folder?

    Did you read the PHP manual for install notes?

    If so are you going to run php as a CGI binary if so the lines you have added should be sufficient, but if your installing as a module then you need this instead

    LoadModule php5_module "c:/php/php5apache2.dll"
    AddType application/x-httpd-php .php
    
    # configure the path to php.ini
    PHPIniDir "C:/php"
    

    If your going to install as a module take a look Here, especially the user contributed notes.

      Thanks for the info, I'll try that. Yes, I'm sure I checked out the PHP installation text file, I looked at almost everything I could get my hands on to figure out this problem. And yes, the "test.php" file was located in my "htdocs" folder. I knew to place it here because I placed a "index.html" file there to see if it would appear when I visited "127.0.0.1", yet whenever I visited "127.0.0.1/test.php" it just wouldn't display.

      Once again, thanks for the info, I will go try that now. 🙂

      EDIT: Where in the "httpd.conf" file do I place the script below?

      PHPIniDir "C:/php"

        EDIT: Where in the "httpd.conf" file do I place the script below?

        Anywhere you like, it makes no difference, however I find it's best to place any editing at the bottom of the page, it's easier then to sort out any problems that may occur.

          Thank you sir, I shall try that.

            Uhm, now I have this error message...(File attached)
            I already attempted re-wording the script some to see if it would work, things such as changing the script to say:
            PHPIni "C:/php/"
            PHPInidir "C:/php/php.ini"

            I tried quite a few things, all resulted in the error message.

              Before I try to offer any further advice, can you answer the following questions:

              1. Which versions of Apache and PHP are you running?

              2. How are you trying to run PHP on Apache: Module or CGI?

              3. How did you install PHP?, the Windows installer (bad) or by unzipping and placing in a directory (good).

              4. Did you read the users note (as I suggested above) and if so did you obtain the apache dll mentioned there?

                I'm attempting to use Apache version 1.3.14 with PHP version 5.2.0. I don't know how I need to run PHP on Apache so I can start using PHP as an addative to HTML. Apparently this means I'm trying to run it as a "module". I first installed PHP using the win 32 installer, then I decided to use the Win Zip self extractor file to install. As for a manual, the only manual I read on PHP installation was the "install.txt" file provided from extraction of all the PHP files. I performed every action it asked of me to install PHP as a module through adding extra scripts to the "httpd.conf" folder. No errors were generated from it, yet it didn't allow me to see my .php file when I visited the site.

                  Ok the only thing I can suggest is that you remove the PHP installation, and start from scratch!

                  Search for any copies of php.ini that may be in the windows or winnt folder and delete them.

                  I would also suggest that you get a newer version of Apache, the one you have is very old, I can't even find a win32 version of 1.3.14 on the Apache archive site.

                  Assuming you now have a newer version 2.2.? of Apache, uninstall the old one through the Add/Remove mechanism.

                  Then remove the Apache folder including the httpd.conf file which is usually still there after uninstalling.

                  Now install Apache (Here I would suggest that you install to c:\apache rather than to the default c:\program files\apache).

                  Check that Apache is working before continuing.

                  Then unzip php to a folder, create a php.ini in the same folder, I will assume that it will be C:\php, don't change anything in it just yet.

                  Now open the Apache httpd,conf file for editing, and paste the following into it (I have used the code for a module installation)

                  LoadModule php5_module "c:/php/php5apache2_2.dll"
                  AddType application/x-httpd-php .php

                  configure the path to php.ini

                  PHPIniDir "C:/php"

                  Save and then restart the apache server.

                  Now open your php.ini file for editing and look for the line

                  doc_root =

                  change it to

                  doc_root = C:\apache\htdocs

                  if you have installed apache anywhere else then change c:\apache for the directory you have used.

                  Save and then restart the apache server, again.

                  If all goes as it should you should now be able to parse php files through your 127.0.0.1/ address.

                  You can now go into you php.ini file and change the settings to suit you. Like enabling extensions and setting your extension path.

                    THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU!!!! Its finally working!

                      Write a Reply...