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: How to use fcgi for php
Author
bagu



Joined: 06 Jan 2011
Posts: 193
Location: France

PostPosted: Mon 30 May '11 13:50    Post subject: How to use fcgi for php Reply with quote

Hello,

I want to use fcgi to run php, but i don't understand how to make it working.
The how-to don't help me so i wonder if someone can explain me how to make it working.

Thanks in advance.
Back to top
James Blond
Moderator


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

PostPosted: Mon 30 May '11 14:17    Post subject: Reply with quote

Here my working config. it is not a how to. Please ask if you wanna know this or that is.

Code:

LoadModule fcgid_module modules/mod_fcgid.so

<IfModule fcgid_module>
   FcgidInitialEnv PHPRC "c:/php/"
   FcgidInitialEnv PATH "C:/php;C:/WINDOWS/system32;C:/WINDOWS;C:/WINDOWS/System32/Wbem;"
   FcgidInitialEnv SystemRoot "C:/Windows"
   FcgidInitialEnv SystemDrive "C:"
   FcgidInitialEnv TEMP "C:/WINDOWS/TEMP"
   FcgidInitialEnv TMP "C:/WINDOWS/TEMP"
   FcgidInitialEnv windir "C:/WINDOWS"

   FcgidIOTimeout 40
   FcgidConnectTimeout 10
   FcgidMaxProcesses 1000
   FcgidOutputBufferSize 64
   FcgidProcessLifeTime 120
   FcgidMaxRequestsPerProcess 10000
   FcgidMinProcessesPerClass 0
   FcgidFixPathinfo 1

# Global Config Example
  <Files ~ "\.php$">
    Options Indexes FollowSymLinks ExecCGI
    AddHandler fcgid-script .php
    FcgidWrapper "c:/php/php-cgi.exe" .php
  </Files>
</IfModule>

Back to top
bagu



Joined: 06 Jan 2011
Posts: 193
Location: France

PostPosted: Mon 30 May '11 14:50    Post subject: Reply with quote

I use such the same config but i get this error :

Quote:

Program: D:\php\php-cgi.exe

R6034
An application has made an attemp to load the C runtime library incorrectly.


Ok, i found the problem...
Because i'm on windows XP, i must use :
Code:
FcgidInitialEnv SystemRoot "C:\Windows"


instead of :
Code:
FcgidInitialEnv SystemRoot "C:/Windows"
Back to top
James Blond
Moderator


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

PostPosted: Mon 30 May '11 17:12    Post subject: Reply with quote

For the runtime you have to install http://www.microsoft.com/downloads/details.aspx?FamilyID=9B2DA534-3E03-4391-8A4D-074B9F2BC1BF (x86) or
http://www.microsoft.com/downloads/details.aspx?familyid=bd2a6171-e2d6-4230-b809-9a8d7548c1b6&displaylang=en (x64)
Back to top
bagu



Joined: 06 Jan 2011
Posts: 193
Location: France

PostPosted: Mon 30 May '11 18:03    Post subject: Reply with quote

Already done

An other problem :
When i try to go on http://www.byjs.fr/admin/
it fail...Page not found...

But when i don't use fcgid, it work fine.
Any idea ?

EDIT : problem solved with :
FcgidFixPathinfo 0
Back to top
bagu



Joined: 06 Jan 2011
Posts: 193
Location: France

PostPosted: Mon 30 May '11 21:44    Post subject: Reply with quote

Hello,

i just see that php_admin_value don't work under fcgid...
I have this in my vhost :
Code:
php_admin_value error_log e:/www/wwwbagubiz/logs/php_error.log


How can i do the same thing with fcgid ?
Thanks.
Back to top
James Blond
Moderator


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

PostPosted: Mon 30 May '11 23:03    Post subject: Reply with quote

Since you are using .user.ini see http://www.php.net/manual/en/configuration.file.per-user.php
Back to top
bagu



Joined: 06 Jan 2011
Posts: 193
Location: France

PostPosted: Mon 30 May '11 23:34    Post subject: Reply with quote

I don't understand how to make it working...

I have set this :
Code:
user_ini.filename = ".ht.user.ini"


And i put a file called .ht.user.ini on the root directory of a virtualhost.
There is only one line in it :
Code:
php_admin_value error_log e:/www/wwwbagubiz/logs/php_error.log


But, when i do a phpinfo, i have :
Code:
error_log   d:/wamp/logs/php_error.log   d:/wamp/logs/php_error.log


So the value isn't modified.
Can you tell me what is wrong ?
Thanks in advance.


EDIT :
For the moment, and while I did not find how to run the thing i use :
Code:
[PATH="e:/www/wwwbagubiz/html"]
error_log = "e:/www/wwwbagubiz/logs/php_error.log"


in my php.ini
Back to top
James Blond
Moderator


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

PostPosted: Tue 31 May '11 10:19    Post subject: Reply with quote

Well we had a topic about this. How to run multiple php.ini files.

http://www.apachelounge.com/viewtopic.php?t=3430
Back to top
bagu



Joined: 06 Jan 2011
Posts: 193
Location: France

PostPosted: Tue 31 May '11 13:09    Post subject: Reply with quote

Ok, but in this topic,
Code:
FcgidInitialEnv PHPRC "/home/user2"


Is made to use only the php.ini witch is in /home/user2 ? no ?
I want to do the same thing, but to alter the original php.ini

So there would be only one php.ini, but whose content is changed by file user.ini

I will take a look in Fcgid vars to see if one of them will do wath i search to do.
Back to top
Thog



Joined: 12 Feb 2007
Posts: 75
Location: Montreal

PostPosted: Wed 28 Dec '11 8:03    Post subject: Reply with quote

Why do you set:

FcgidOutputBufferSize 64

What is the advantage of this over the default 65000
Back to top
James Blond
Moderator


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

PostPosted: Wed 28 Dec '11 20:09    Post subject: Reply with quote

bagu wrote:


So there would be only one php.ini, but whose content is changed by file user.ini

I will take a look in Fcgid vars to see if one of them will do wath i search to do.


Yes you can use a global ini and changes values per directory. But as the manual says:
Quote:
Only INI settings with the modes PHP_INI_PERDIR and PHP_INI_USER will be recognized in .user.ini-style INI files.
So you can't changed everything, but many stuff. See http://de3.php.net/manual/en/configuration.file.per-user.php
Back to top


Reply to topic   Topic: How to use fcgi for php View previous topic :: View next topic
Post new topic   Forum Index -> Third-party Modules