Page 1 of 1

error when installing php

Posted: Sun Jul 19, 2009 3:32 am
by renjith.resmi
i installed apache and then php using the instructions found in a web page shown below

Go to your desktop and in the folder you initially created find file called php-5.2.3-Win32.zip.
Extract the content of this file to C:\webserver\php. Pull out all of the files from the php-5.2.3-Win32 folder and place them directly in C:\webserver\php.

Now we need to add our C:\webserver\php folder to the path of the Environment Variables.
To do this right click My Computer icon on your desktop and choose Properties. Then choose Advanced tab and click Environment Variables button .

Now select Path from the System variables list in the bottom part of the window and click Edit

In the new window click inside the Variable value: box and press End button on your keyboard to get to the end of the path.
Now type in or copy and paste the following ;C:\webserver\php (Fig. 15). Make sure you start it with semicolon and to use back slashes.
Installing PHP Step 3


Once you have done this click OK in all of the windows until you close the System Properties window. Now you need to restart the computer.

Next step will be to find out if our PHP is working. Go to Start > Run and type cmd. In the command prompt window type php -v. You should see something like Fig. 16.
Installing PHP Step 4


We still have some tweaking to do before we finish our installation.
Go to C:\webserver\php and find file called php.ini-recommended. Rename that file to php.ini.
Open this file and make the following amendments:

1. identify line with doc_root = and change it to:
doc_root = C:\webserver\Apache2\htdocs
2. identify line with extension_dir = "./" and change it to:
extension_dir = C:\webserver\php\ext

Save and close the file.

Apache Configuration
Now we need to make sure that Apache knows where to search for php modules.
To do that first go to C:\webserver\Apache2\conf and open file httpd.conf in your text editor.
Because we will be running PHP as an Apache module which is faster and more secure option comparing to CGI binary, we will need to do the following changes to httpd.conf file:

1. identify LoadModule section and add the following line at the top of this section:
LoadModule php5_module "C:/webserver/php/php5apache2.dll"
2. identify AddType section and add the following line at the top of this section:
AddType application/x-httpd-php .php
3. lastly place the following line somewhere within the content:
PHPIniDir "C:/webserver/php/" - ensure you have a closing slash at the end of the path.

Save and close file. Restart Apache by going to Start > All Programs > Apache HTTP Server 2.0.59 > Control Apache Server and click Restart.


my php location is c:\php and my apache location is C:\Program Files\Apache Software Foundation\Apache2.2

i restarted my apache after i make the necessary changes in php.ini and httpd.conf files
but i got the following screen when restarting apache
restart error.JPG
restart error.JPG (27.77 KiB) Viewed 1940 times
i fed up with the problems when installing apache and php
i think this is my 8 or 9 try.................. pls help me guys

pls

pls

Re: error when installing php

Posted: Sun Jul 19, 2009 3:55 am
by Darhazer
It tries to load the module from c:\program files\php and not from c:\php
Open the httpd.conf, go to line 60 and type the correct path

Re: error when installing php

Posted: Sun Jul 19, 2009 4:17 am
by renjith.resmi
dear Darhazer
i foud ur post. i made a mistake when uploading the figure. now i corrected it. pls check my post once again and help me pls

Re: error when installing php

Posted: Sun Jul 19, 2009 7:06 am
by SeaJones
renjith.resmi wrote:dear Darhazer
i foud ur post. i made a mistake when uploading the figure. now i corrected it. pls check my post once again and help me pls
It's looking for the DLL file, and can't find it - Have you actually checked it exists?

Go to the base of c:

Code: Select all

 
c:
cd \
 
and try and find the file it wants:

Code: Select all

 
dir/s php5apache2.dll
 
If that doesn't return a file in the directory c:/PHP then that's your error. And I do mean *your* error. GIGO.

Re: error when installing php

Posted: Sun Jul 19, 2009 10:26 am
by renjith.resmi
Dear SeaJones
i tested the dll as you told and i got the result true and the screen is given below
test.JPG
test.JPG (36.54 KiB) Viewed 1914 times
what was the error ? ........any guess

Re: error when installing php

Posted: Sun Jul 19, 2009 3:23 pm
by SeaJones
If the file exists, and it does, then the problem is either going to be:

1. The file is already in use somewhere else and is thus inaccessible. Unlikely because file locks work differently on FAT32 and NTFS systems than on *(nix|nux).

2. The file is corrupted and the apache just doesn't have a more specific error message when loading a mod. Try downloading the zip again and replacing this file.

If that fails, I'm a bit stuck and would be tempted to check the zip by installing it on a different machine to re-create the error.

Re: error when installing php

Posted: Sun Jul 19, 2009 7:40 pm
by Benjamin
:arrow: Moved to Installation and Configuration