logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Other Software View previous topic :: View next topic
Reply to topic   Topic: Apache 2.2.6 and "dual" PHP
Author
tkejzlar



Joined: 24 Jan 2008
Posts: 5

PostPosted: Thu 24 Jan '08 14:24    Post subject: Apache 2.2.6 and "dual" PHP Reply with quote

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

PostPosted: Thu 24 Jan '08 15:08    Post subject: Reply with quote

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

PostPosted: Thu 24 Jan '08 15:45    Post subject: Reply with quote

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

PostPosted: Thu 24 Jan '08 16:00    Post subject: Reply with quote

Did you load fast cgi module in apache? What is in your error log?
Back to top
tkejzlar



Joined: 24 Jan 2008
Posts: 5

PostPosted: Thu 24 Jan '08 16:14    Post subject: Reply with quote

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

PostPosted: Thu 24 Jan '08 17:32    Post subject: Reply with quote

Well, now I get 403 Forbidden when I try to access php scripts under virtual hosts running PHP4 as fastcgi... Smile
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7373
Location: Germany, Next to Hamburg

PostPosted: Thu 24 Jan '08 17:46    Post subject: Reply with quote

403 is a good start Wink
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

PostPosted: Thu 24 Jan '08 17:54    Post subject: Reply with quote

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 Smile
Back to top


Reply to topic   Topic: Apache 2.2.6 and "dual" PHP View previous topic :: View next topic
Post new topic   Forum Index -> Other Software