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 -> Third-party Modules View previous topic :: View next topic
Reply to topic   Topic: mod_fcgid & PHP-MySQL problem.
Author
Computer Guru



Joined: 04 Oct 2007
Posts: 2

PostPosted: Thu 04 Oct '07 6:44    Post subject: mod_fcgid & PHP-MySQL problem. Reply with quote

Hi All,

I'm currently running apache-2.2.6 (from Apache Lounge w/ the patches) and PHP from php5apache2_2.dll from the apache win32 community distribution.

I'd like to switch to FastCGI, so I downloaded and added your fcgid module to apache and configured httpd.conf to use fastcgi to run PHP - it works fine. With your fcgid module, PHP is running fast and secure without any issues.

HOWEVER, with mod_fcgid running PHP, PHP can no longer access MySQL.
When a php under fcgid attempts to access MySQL I get a socket creation error, and the connection fails. I do not have this issue with the isapi plugin.

Can anyone suggest a reason/solution for this weird behavior? Everything else works fine, the only thing is that PHP cannot connect to MySQL when running as FastCGI.

Thanks.
Back to top
James Blond
Moderator


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

PostPosted: Thu 04 Oct '07 9:17    Post subject: Reply with quote

With fcgi you also have to define the PHPIniDir in httpd.conf

I guess PHP runs with default values and you have to enable mysql extension in the php.ini for php fcgi.
Back to top
Computer Guru



Joined: 04 Oct 2007
Posts: 2

PostPosted: Thu 04 Oct '07 10:52    Post subject: Reply with quote

Thanks, that's fixed it Smile

Another question: on IIS w/ FastCGI, I would point the FCGI wrapper to php-cgi.exe.... the fcgid docs point it to php.exe

Which is better? IS there a difference?

If I use php.exe I get a server 500 error, php-cgi.exe works just fine.
Back to top
James Blond
Moderator


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

PostPosted: Thu 04 Oct '07 12:05    Post subject: Reply with quote

The php docs are old at that point. The php-cgi.exe is the right one. Some time before there was php.exe (the cgi) and php-cli.exe. Some time a ago the files has been renamed php.exe to php-cgi.exe (to make it clear) and php-cli.exe to php.exe (cli = command line interface). New is the php-win.exe which is for php gtk.
Technical the php-cgi.exe send a content-type: text/html as a header for apache, what php.exe does not do.
Back to top


Reply to topic   Topic: mod_fcgid & PHP-MySQL problem. View previous topic :: View next topic
Post new topic   Forum Index -> Third-party Modules