| Author | Post |
|---|
ugp Member
| Joined: | Wed May 31st, 2006 |
| Location: | |
| Posts: | 3 |
| Status: |
Offline
|
| Mana: |     |
|
Posted: Thu Jun 1st, 2006 03:15 am |
|
I installed Apache2.2 on "C:\Apache2.2" directory, using windows installer.
It works OK. (I can do these functions with out an error -> stop,start,restart)
Now, i'm going to installe PHP 5.1.4 manually, which will work with Apache.
I extract the content of "php-5.1.4-Win32.zip" to C: drive and rename that folder as php. Now, those php file(All .dll files & others) are resides in "C:\php"
Then i rename the "php.ini-recommended" as "php.ini" & copy that into the C:\WINNT folder.
Also copied the "php5ts.dll" to C:\WINNT
Now i'm going to configure "httpd.conf"
i put these lines into that file, in correct places-->
LoadModule php5_module "c:/php/php5apache2.dll"
AddType application/x-httpd-php .php
But when i do that, I CANNOT Restart the Apache ???
It gives this ERROR...
'The requested operation has failed'
--------------
I think the error is coming from this line...
LoadModule php5_module "c:/php/php5apache2.dll"
The path is correct... There is a file called "php5apache2.dll" in c:/php
when i comment that line,
#LoadModule php5_module "c:/php/php5apache2.dll"
i can do the operations with apache.(start,stop.restart)
I didn't do any changes to the php.ini
Changes are only made with httpd.conf
Do i need to insert a line like this to the httpd.conf
PHPIniDir "C:/php"
If so,... to where it should insert !!
Please help me to configure this...
(O/S using is Win2000 prof. with service pack 4)
(I did the same procedure with winxp sp-2. But it gives the same ERROR..)
|
TomWhitney Member

| Joined: | Fri Dec 30th, 2005 |
| Location: | Phoenix, Arizona USA |
| Posts: | 99 |
| Status: |
Offline
|
| Mana: |     |
|
Posted: Thu Jun 1st, 2006 03:32 am |
|
Try removing the quotes around the path.
LoadModule php5_module "c:/php/php5apache2.dll"
|
ugp Member
| Joined: | Wed May 31st, 2006 |
| Location: | |
| Posts: | 3 |
| Status: |
Offline
|
| Mana: |     |
|
Posted: Thu Jun 1st, 2006 03:54 am |
|
| ??? It didn't work....
|
klimaks Member
| Joined: | Thu Dec 29th, 2005 |
| Location: | |
| Posts: | 52 |
| Status: |
Offline
|
| Mana: |     |
|
Posted: Thu Jun 1st, 2006 06:59 am |
|
Already answered this once but oh well, here goes again
"If you use Apache 2.2.x, the included DLLs (php4apache2.dll and php5apache2.dll) will not work for you as they are specific to the Apache 2.0.x API. There is an open bug report to address this issue but if you can't wait then go to the following URL and download an appropriate DLL for Apache 2.2.x"
http://www.apachelounge.com/download/ to find a working one
|
hsharaf Member
| Joined: | Sat Jun 10th, 2006 |
| Location: | |
| Posts: | 1 |
| Status: |
Offline
|
| Mana: |     |
|
Posted: Sat Jun 10th, 2006 11:59 pm |
|
Hi;
i had the very same problem..
and think it s a compatibity issue..
uninstall Apache2.2
and install Apache2 instead ..
i did it and it worked
please let me know ur feed back..
|
jedhunsaker Member
|
Posted: Sat Sep 2nd, 2006 04:50 pm |
|
klimaks is a god among men – listen to what he just said (fixed the last of my problems with PHP installation).
There are some rather important details that people have been omitting about installing PHP5/PHP4 on Apache 2.2. My particular scenario involves installing both PHP5/PHP4 to run in tandem on Apache 2.2 on a Windows XP Pro system. Listen carefully cuz I was up all night and all morning figuring all this crap out. I hope this post can serve as a one-stop solution to all these problems.
These are the steps:
Assume...- You have installed Apache 2.2 on a Windows XP Pro system (probably works for other NT solutions as well).
- PHP5 and PHP4 are installed in C:\PHP5 and C:\PHP4, respectively.
Steps...- Even if you already have php5apache2.dll and php4apache2.dll, download the newest ones from http://www.apachelounge.com/download/ just as klimaks suggested.
Note: There have been many forums saying to use the 2_2 DLLs. If you download the latest php5apache2.dll and php4apache2.dll from the link above, these are the same DLLs as the 2_2 DLLs that everyone is talking about and confused as hell as to where to download them. Heck, rename them to 2_2.dll if that really makes you feel happy. Bottom line, there is a different DLL for 2.0.x and 2.2.x installations.
- Read the "Readme First.txt" files included in the above download packages! They will tell you where to place both the DLLs and the httpd.exe.manifest files in your PHP directory and your Apache /bin directory, respectively.
- I'm not sure how important this step is, but I did it just to be safe, seeing as the "Readme First.txt" told me to. Install the Visual C++ 2005 Redistributable Package (the binary is built with VC 2005). Download it from http://www.microsoft.com/downloads/details.aspx?familyid=32BC1BEE-A3F9-4C13-9C99-220B62A191EE&displaylang=en
- Open up your http.conf file in your Apache installation located at /conf/httpd.conf (gotta' love the Send To -> Notepad)
- Add the following lines to the http.conf:
#The following lines of configuration are intended to run
#PHP5 as the primary PHP language for this server as a
#SAPI module along with PHP4 as legacy in CGI/FastCGI mode
#Use a regular expression to allow Apache
#access to php, php4, php5 or future php6 directories
#all in one <Directory> directive
<Directory ~ "^C:/php[456]?/">
Options FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
Satisfy all
</Directory>
#Two lines below work for both SAPI module and CGI/FastCGI modes
AddType application/x-httpd-php .php .php5
AddType application/x-httpd-php4 .php4
#Run PHP5 as SAPI module and PHP4(legacy) as CGI/FastCGI in tandem
ScriptAlias /php4/ "c:/php4/"
Action application/x-httpd-php4 "/php4/php.exe"
LoadModule php5_module "c:/php5/php5apache2.dll"
PHPIniDir "C:/php5/"
#If the setup above doesn't work out for you, here's how you can do
#it the other way around. You can run both versions of PHP in tandem
#as CGI/FastCGI, but I can't seem to get both to run as SAPI modules
#ScriptAlias /php5/ "c:/php5/"
#Action application/x-httpd-php "/php5/php-cgi.exe"
#LoadModule php4_module "c:/php4/php4apache2.dll" |
Note: I've read that CGI/FastCGI causes more overhead, which is why you should run PHP as a SAPI module instead. In the case of running both PHP5 and PHP4 as SAPI modules in tandem, I was not able to do this. As a solution, I ran PHP5 as a SAPI module and PHP4 as CGI/FastCGI for legacy code. I looked into Godaddy and they use both PHP5 and PHP4 in tandem as CGI/FastCGI. I think my solution is better. I can modify my /php4/php.ini to only affect my PHP4 installation and my /php5/php.ini to only affect my PHP5 installation.
If you find a way to run both versions of PHP as SAPI modules please notify me by responding to this thread or e-mailing jed at a place i like to call lavadrop dot com (trying to evade spammers).
Warning from php.net documentation: http://us2.php.net/manual/en/install.windows.apache2.php
By using the CGI setup, your server is open to several possible attacks. Please read our CGI security section to learn how to defend yourself from those attacks.
http://us2.php.net/manual/en/security.cgi-bin.php
- Restart your Apache 2.2 web server.
I hope this clears up some of the mass confusion on PHP installation for Apache 2.2. I gave up with my PHP installation twice before because it's so poorly-documented. I hope also that this page gets spidered by Google so I can find it when I need it later. I'm going to add a bunch of keywords to help people find this article from Google searches in the future.
Ignore this crap (Keywords): PHP installation on Apache 2.2 PHP on Apache/Windows XP Pro PHP4 PHP5 php5apache2.dll php4apache2.dll php5apache2_2.dll php4apache2_2.dll SAPI module SAPI modules CGI/FastCGI CGI FastCGI both PHP5 and PHP4 in tandem both versions of PHP.
Last edited on Sat Sep 2nd, 2006 06:22 pm by jedhunsaker
|
MRT-Designs Member
|
Posted: Sun Mar 18th, 2007 03:49 pm |
|
I registered with this forum just to say a big thanks!
THANKS!!!
I'm self-teaching myself with a book by SAMS Teach Yourself... and I was banging my head against a wall until I came across this post.
This will be my first point of call if I get stuck again.
Again, you have my thanks.
|
jedhunsaker Member
|
Posted: Thu Mar 22nd, 2007 03:17 am |
|
Hey, no problem man. Here I am installing PHP on Apache2 again and all I had to type in Google was "php4 php5 tandem" and it came right up. I'm glad I made this post.
|
GemX Member
| Joined: | Fri May 25th, 2007 |
| Location: | |
| Posts: | 9 |
| Status: |
Offline
|
| Mana: |     |
|
Posted: Fri May 25th, 2007 08:28 pm |
|
If you are noob at installing Apache php and mysql on win os.. And you wan to start coding and not get stucked at installation... well check this link: http://www.wampserver.com/en/
This is helpfull link for that kind of situations 
|
 Current time is 07:56 pm | |
|