PHP installation test wont work!


I am brand new to PHP and MySQL, and am trying to install both on WinXP where I just installed Apache 1.3.1 I think - and it also has Oracle 9i database running.

Basically, I type in http://localhost into my browser (Mozilla) and it shows the successful installation page for apache. I then installed PHP 5 from the installer, and have edited the config file for apache and the php.ini file which i have copied to windows, windows/system32 etc. PHP is in c:/php. When i installed php it said it hadnt configured apache.

i have changed doc root and extension_dir in php and accordingly in apache conf file. i have also added the AddType application... stuff in Apache. I think I have done it all ok, and then I have the test script saved asa php file in my doc root folder - c:/web:

      <title>PHP Test</title>
      <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
      <h1>PHP Test</h1>
      <b>An Example of PHP in Action</b><br />
            <?php echo "The Current Date and Time is: <br>";
                  echo date("g:i A l, F j Y.");?>

      <h2>PHP Information</h2>
            <?php phpinfo(); ?>

I keep getting the error 404 when I try to test php in the browser by typing http://localhost/test.php

The requested URL /php/php.exe/test.php was not found on this server.

Apache/1.3.31 Server at localhost Port 80

and http://localhost doesnt even work in internet explorer.

any clues as to where I am going wrong - is it anything to do with Oracle and the apache that it has? when i try and stop the oracle apache it has an error in an sqlplus file which wasnt happening before and in fact a couple of errors from oracle have been happening at startup since.

Many thanks for your help ;o)
Who is Participating?
sgalzinConnect With a Mentor Commented:

Just in case you want to do a clean install from scratch, here are some notes I've written out for myself (please note it's what I consider a minimum effort's installation, i.e. not any optimizations / security concerns). Good luck !


download Apache2 :
download PHP5 :
download PhpMyAdmin :
download MySQL :

*** APACHE ***
- Install Apache to "<diskDriveLetter>:\<applicationFoler>" using the file apache_2.0.50-win32-x86-no_ssl.exe
  - DomainName =  <default>
  - ServerName =  localhost
  - ServerAdmin =
  - ServerPort =  80
- Edit the Apache configuration file "<diskDriveLetter>:\<applicationFoler>\Apache Group\Apache2\conf\httpd.conf" :
  - make sure the value of the port for the "Listen" setting is 80 (and not 8080) :
      Listen 80
  - make sure the value of the port for the "ServerName" setting is 80 (and not 8080) :
      ServerName localhost:80
  - replace the value of the "DocumentRoot" setting to :
      DocumentRoot "<diskDriveLetter>:/<folderOfYourChoice>/<subFolderOfYourChoice>/www"
- Test installation :
  - put the attached file index.html in folder <diskDriveLetter>:\<folderOfYourChoice>\<subFolderOfYourChoice>\www\
      copy index.html "<diskDriveLetter>:\<folderOfYourChoice>\<subFolderOfYourChoice>\www\index.html"
  - start Apache in console (using the shortcut provided in "Control Apache Server")
  - start your favorite Internet browser and go to :
      the page should say "Available projects on (static) :"
  - kill the Apache console by pressing <Ctrl + c>

*** PHP ***
- Extract to "<diskDriveLetter>:\<applicationFoler>\php"
- Create a standard PHP configuration file "<diskDriveLetter>:\<applicationFoler>\php\php.ini" :
      copy "<diskDriveLetter>:\<applicationFoler>\php\php.ini-recommended" "<diskDriveLetter>:\<applicationFoler>\php\php.ini"
- Edit the Apache configuration file "<diskDriveLetter>:\<applicationFoler>\Apache Group\Apache2\conf\httpd.conf" :
  - add the follinwg line after the last LoadModule statement :
      LoadModule php5_module "<diskDriveLetter>:/<applicationFoler>/php/php5apache2.dll"
  - add the two follinwg lines after the last AddType statement :
      AddType application/x-httpd-php .php
      PHPIniDir "<diskDriveLetter>:/<applicationFoler>/php"
  - add the value "index.php" to the beginning of the DirectoryIndex list so that the list becomes :
      DirectoryIndex index.php index.html index.html.var
- Test installation :
  - put the attached file index.php in folder <diskDriveLetter>:\<folderOfYourChoice>\<subFolderOfYourChoice>\www\
      copy index.php "<diskDriveLetter>:\<folderOfYourChoice>\<subFolderOfYourChoice>\www\index.php"
  - start Apache in console
  - start your favorite Internet browser and go to :
      the page should say "Available projects on (dynamic) :"
  - kill the Apache console by pressing <Ctrl + c>

*** MYSQL ***
- Extract to "<diskDriveLetter>:\<folderOfYourChoice>\<subFolderOfYourChoice>\www"
- Launch the setup.exe program in and start a typical installation in folder :
- Copy the libmysql.dll library provided by PHP to your Windows system folder :
      copy "<diskDriveLetter>:\<applicationFoler>\php\libmysql.dll" "c:\winnt\system32\libmysql.dll"
- Edit the PHP configuration file "<diskDriveLetter>:\<applicationFoler>\php\php.ini" :
  - change the extension directory :
      extension_dir = "./" to "<diskDriveLetter>:/<applicationFoler>/php/ext/"
  - activate mysql by uncommenting
- Test installation :
  - execute in a command prompt :
      "<diskDriveLetter>:\<applicationFoler>\mysql\bin\mysqld" --console
  - start Apache in console
  - start your favorite Internet browser and go to and follow the phpMyAdmin-2.6.0-rc1 hyperlink
  - in the MySQL command prompt, kill MySQL by pressing <Ctrl + c>
  - kill the Apache console by pressing <Ctrl + c>

<center><h3>Available projects on (static) :</h3></center><br><br>

<center><h3>Available projects on (dynamic) :</h3></center><br><br>
$currentDirectory = dir ( "." );
while ( false !== ( $entry = $currentDirectory->read () ) ) if ( is_dir ( $entry ) && ( $entry != "." ) && ( $entry != ".." ) ) echo "<a href=\"" . $entry . "/\"> " . $entry . "</a><br />\n";
UmeshMySQL Principle Technical Support EngineerCommented:

Did you restart apache server after changing config(httpd.conf) file ? if not restart & check the same once..

are you  running PHP as CGI or apache module?

Check this link..

Hope this helps!
Does this work?
Cloud Class® Course: Certified Penetration Testing

This CPTE Certified Penetration Testing Engineer course covers everything you need to know about becoming a Certified Penetration Testing Engineer. Career Path: Professional roles include Ethical Hackers, Security Consultants, System Administrators, and Chief Security Officers.

If works, then check if you have an entry for it in your host file. To find the host file in windows, type:
dir host* /s/p at the dos prompt.
emmy21Author Commented:
Thanks to everyone for your help, I have come so far from when I first posted this question - which is the silver lining of when new things go wrong.

Basically I thin my initial problem was that I had installed a second Apache where I already had one with Oracle, this annoyed me as I thoght it was a bit silly to install a second copy, so I found some instructions on how to modify Oracle's apache and it all improved from there, I now have MySql up an running - as well as managing to enable oracle and run database queries from my oracle databases with php!

Thanks for your help, sure there will be more questions from me at some point!
Thank to sgalzin for his tutorial

I've fixed some "bugs" and rewritten it here with some GUI improvements
wow !

nice job, corsari : it is so much more readable (thanks to the html). i haven't tested it yet but i'm sure you're right about the bug fixes (my version was *very* minimal).

thanks for the effort, i'll redirect my friends to your page from now on !

Thank you stephane (sgalzin)

Yesterday I've completed the page with download for the two test files.

"bugs" in your memo where '\' and '/' (mainly). This because httpd.conf uses '/' (slashes *nix style) while php.ini uses '\' (DOS style),
last --> the last Apache release installs as service by default and a nice traybar Apache Monitor with both click and right-click support and several functions ... including RESTART, STOP and START of the service.


P.S. .. naturally I've updated all the download links to the last release except for MySQL which is proposed by default to 4.x and optionally to the 5.x
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.