Jump to content

Apache2.2.11 and PHP5 install..test.php error why?


Recommended Posts

Hi everyone!

 

I will try to give you as much info as possible to solve this quick! I am reading the Apache_Php_sql weekend crash course and I am stuck on testing my php installation.

 

Here's what I have so far.

Vista

Installed Apache 2.2.11 listening on port 80 at "c:\server". Had a small issue with that until I stopped IIS! Cool no problems now! So I do as instructed and test my Apache install by pointing browser to http://localhost and I get "It Works!". Moving on to PHP install now.

 

I download php 5.2.10 unzip it to "c:\PHP". Ok now the book tells me to copy the php.ini-dist file (located in the PHP install directory) to php.ini and locate the new file in your system's windows or winnt directory. This makes no sense b/c there is no php.ini just php.ini-dist and php.ini-recommended. So I interpreted this part of the instructions to mean. Rename php.ini-dist to php.ini and copy/paste it into "c:\windows" (note I copied the un-edited php.ini into the windows directory). Now I copied the php5ts.dll file to "c:\windows\system". Last step...from the book says to edit the php.ini file and change the path specified with the extension_dir parameter to the directory of your PHP installation (for example, extension_dir = c:\php-version ). Well mine has "c:\PHP"

 

Final step: Updating http/conf on windows from book.

 

"After the existing LoadModule lines, add the following line:

LoadModule php_module c:\php-version\sapi\php4apache2.dll"

 

I have "LoadModule php5_module c:\PHP\php5apache2_2.dll"

 

then it says to.. "Add the following lines after any existing AddType lines:

AddType application/x-httpd-php .php .phtml

AddType application/x-httpd-php-source .phps"

 

and I have

"AddType application/x-httpd-php .php .php5 .phtml

AddType application/x-httpd-php-source .phps"

 

Now I created a test.php file and placed in c:\server\htdocs\

 

<?php

phpinfo();

?>

I go to http://localhost and I still get it works! however when i go to http://localhost/test.php I get "not found" the requested URL/test.php was not found on this server

Link to comment
Share on other sites

I download php 5.2.10 unzip it to "c:\PHP". Ok now the book tells me to copy the php.ini-dist file (located in the PHP install directory) to php.ini and locate the new file in your system's windows or winnt directory. This makes no sense b/c there is no php.ini just php.ini-dist and php.ini-recommended. So I interpreted this part of the instructions to mean. Rename php.ini-dist to php.ini and copy/paste it into "c:\windows" (note I copied the un-edited php.ini into the windows directory). Now I copied the php5ts.dll file to "c:\windows\system".

I do not recommend moving files out side the PHP installation folder. Instead you should extract the contents of the zip to C:\PHP. Now add the PHP folder to the PATH Environment Variable. Next rename the php.ini-recommended file to just php.ini. Open the php.ini and change

extension_dir = "./"

to

extension_dir = "C:/PHP/ext"

 

Save the php.ini and restart Apache.

 

I go to http://localhost and I still get it works! however when i go to http://localhost/test.php I get "not found" the requested URL/test.php was not found on this server

Go to C:/Sever/htdocs delete all files, except test.php. Now go to http://localhost and you should see a directory listing with test.php listed. Click test.php. Does it run?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.