Jump to content

How to configure PHP 5 with Apache


Recommended Posts

When i go to apache website i get 404 error file not found when i try to download the latest version of Apache.

 

Currently i have apache version 2.0.63 and and i have downloaded the following PHP

 

VC6 x86 Non Thread Safe (PHP 5.3 (5.3.0))

from the website http://windows.php.net/download/

 

I started following this tutorial

 

http://www.arterground.com/

 

and after following the steps when i restart the Apache server it gives and error and remain stopped.

 

Can you tell me which version of PHP can be configured with what version of Apache and how.Thanks

Link to comment
Share on other sites

NOTE: That tutorial suggests to add these lines to the httpd.conf

LoadModule php5_module "C:/WEB/PHP/php5apache2_2.dll"
AddHandler application/x-httpd-php .php
PHPIniDir "C:/WEB/PHP"

 

As you're using Apache2.0.x The LoadModule line should be

LoadModule php5_module "C:/WEB/PHP/php5apache2.dll"

 

php5apache2_2.dll is for Apache2.2.x only. php5apache2.dll is for Apache 2.0.x

Link to comment
Share on other sites

I have downloaded the following PHP.

 

VC6 x86 Non Thread Safe (PHP 5.3 (5.3.0))

from the website http://windows.php.net/download/

and in after unzipping the folder i can see a file named as "php5apache.dll"

and the same file i am referencing in the httpd file of Apache

and i still getting the error when i restart the server

 

Am i missing the Dll ,as i downloaded the PHP mentioned above was from PHP guys i guess.

Link to comment
Share on other sites

and in after unzipping the folder i can see a file named as "php5apache.dll"

and the same file i am referencing in the httpd file of Apache

You should get three Apache modules, which are

php5apache2_2.dll - This is to be used with Apache 2.2.x

php5apache2.dll - This is to be used with Apache 2.0.x

php5apache.dll - This is to be used with Apache 1.3.x

 

You need to use the correct module for the version of Apache you're using. You said in your first post you're using Apache2.0.63. This what your LoadModule line should be in the httpd.conf

LoadModule php5_module "C:/WEB/PHP/php5apache2.dll"

 

Link to comment
Share on other sites

You Said the following

 

You should get three Apache modules, which are

php5apache2_2.dll - This is to be used with Apache 2.2.x

php5apache2.dll - This is to be used with Apache 2.0.x

php5apache.dll - This is to be used with Apache 1.3.x

 

i already mentioned that the PHP i downloaded is from PHP guys and it doesnt have the dll that is mentioned in all tutorials.The one i got i mentioned in my post and when i reference it i get the error.

If you can better tell me the resource from where i can download the correct PHP 5 Zip files and the version of Apache which works with it.Thanks

Link to comment
Share on other sites

I have downloaded the vc86 Thread safe from http://windows.php.net/download/ and unzipped in at C:\PHP

and as you metioned in your earlier post

 

You should get three Apache modules, which are

php5apache2_2.dll - This is to be used with Apache 2.2.x

php5apache2.dll - This is to be used with Apache 2.0.x

php5apache.dll - This is to be used with Apache 1.3.x

 

but i can see only "php5apache2_2.dll" in that folder.Also i am looking for any apache 2.2.x server ,where to download it from  ? :facewall:

The current apache i have downloaded is 2.0.63 and i didnt work with the php dll i have now, as i tried and i got the same error.

Link to comment
Share on other sites

Alright i have downloaded Apache and installed it.After adding the lines you mentioned in earlier post to the httpd file in Apache folder,i restarted Apache and it went smooth with out error.Now when i type localhost in my browser i can see a page saying It Works!.

I created a test.php file having code  <?

 

phpinfo();

 

?>

and saved at this location C:\Program Files\Apache Group\Apache2\htdocs

now when i do the localhost/test.php i get HTTP 404  error.What to do now ? :confused:

Link to comment
Share on other sites

Sorry i misunderstood what you asked.But how to get the listing of http://localhost ?

when I  browse the htdocs folder i see only test.php

i am also trying to figure out as it shows as "It works" when i type just http://localhost ,it means the root directory is not set but i have checked the php.ini file and the root directory is set to the htdocs folder of Apache.

 

 

Link to comment
Share on other sites

I tried deleting history but of no use ,i want to know where that index.html file is located which shows "it works!" which is an indication that Apache is installed correctly,if i am not wrong.

And apache is going to the same directory where that file is that is what i am assuming.

 

Now after deleting the history it is at the same situation.If i go to localhost it shows "It works!" and when it type http://localhost/test.php it gives me Http 404 error. :facewall:

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.