Author |
|
tkejzlar
Joined: 24 Jan 2008 Posts: 5
|
Posted: Thu 24 Jan '08 14:24 Post subject: Apache 2.2.6 and "dual" PHP |
|
|
Hi,
I'm having some trouble with configuring Apache 2.2.6 to run with both PHP4 and PHP5, PHP5 as a module and PHP4 as a cgi.
PHP4 should be used only on defined virtual hosts, so I've placed this into appropriate vhost conf file:
AddType application/x-httpd-php4
ScriptAlias /php-cgi/ "C:/Program Files/PHP4/"
Action application/x-httpd-php4 "/php-cgi/php.exe"
However, when I try to run some php scripts in this vhost, the contents of php.exe si reeturned instead of the result of parsing the script.
Can anyone tell me what am I doing wrong?
Thanks... |
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7373 Location: Germany, Next to Hamburg
|
Posted: Thu 24 Jan '08 15:08 Post subject: |
|
|
With fast-cgi (fcgi) it works fine
Code: |
#LoadModule fcgid_module modules/mod_fcgid.so
<IfModule mod_fcgid.c>
IPCCommTimeout 40
IPCConnectTimeout 10
MaxProcessCount 8
OutputBufferSize 64
ProcessLifeTime 60
MaxRequestsPerProcess 500
Alias /fcgi/ "D:/server2/fcgi/"
<Directory D:/server2/fcgi>
AddHandler fcgid-script .php
Options Indexes FollowSymLinks ExecCGI
FCGIWrapper "D:/server2/php4/php.exe" .php
AllowOverride all
Order allow,deny
Allow from all
Satisfy any
</Directory>
</IfModule>
|
I think you can set that up in a vhost was well |
|
Back to top |
|
tkejzlar
Joined: 24 Jan 2008 Posts: 5
|
Posted: Thu 24 Jan '08 15:45 Post subject: |
|
|
Well, fastcgi doesn't work for me either. Perhaps the problem is in tne php.exe binary itself...
Tom. |
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7373 Location: Germany, Next to Hamburg
|
Posted: Thu 24 Jan '08 16:00 Post subject: |
|
|
Did you load fast cgi module in apache? What is in your error log? |
|
Back to top |
|
tkejzlar
Joined: 24 Jan 2008 Posts: 5
|
Posted: Thu 24 Jan '08 16:14 Post subject: |
|
|
James Blond wrote: | Did you load fast cgi module in apache? What is in your error log? |
Yes, mod_fcgid is loaded. The strange thing is that nothing shows up in logs...
T. |
|
Back to top |
|
tkejzlar
Joined: 24 Jan 2008 Posts: 5
|
Posted: Thu 24 Jan '08 17:32 Post subject: |
|
|
Well, now I get 403 Forbidden when I try to access php scripts under virtual hosts running PHP4 as fastcgi... |
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7373 Location: Germany, Next to Hamburg
|
Posted: Thu 24 Jan '08 17:46 Post subject: |
|
|
403 is a good start
So you only have to look for the permissions.
Can you access other files on the vhost?
Please post how set it up. |
|
Back to top |
|
tkejzlar
Joined: 24 Jan 2008 Posts: 5
|
Posted: Thu 24 Jan '08 17:54 Post subject: |
|
|
Thanks for help, I've sorted it out and it works now. I had some misconfigurations in my php.ini and I haven't added some Apache directives to allow access to root directories of virtual hosts.
Again, thanks very much for help |
|
Back to top |
|