Keep Server Online
If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.
or
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.
| |
|
Topic: How to apply "php_value name value" in FCGI mode |
|
Author |
|
Otomatic
Joined: 01 Sep 2011 Posts: 203 Location: Paris, France, EU
|
Posted: Fri 13 Sep '24 9:55 Post subject: How to apply "php_value name value" in FCGI mode |
|
|
Hi,
When using PHP as an Apache module, we can define PHP directives (php.ini) specific to a VirtualHost, using as appropriate:
- php_value name value
- php_admin_value name value
- php_flag name on|off
For example:
Code: |
<VirtualHost *:80>
ServerName mysite
DocumentRoot "g:/www/mysite"
<Directory "g:/www/mysite/">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
Require local
</Directory>
php_admin_value upload_max_filesize 1G
php_admin_value max_execution_time 360
php_value curl.cainfo "${INSTALL_DIR}/bin/certificats/cacert.pem"
</VirtualHost>
|
Is there a way to do the same thing, only on the PHP version defined when using FCGI mode with a VirtualHost such as this one:
Code: |
<VirtualHost *:80>
ServerName mysite
DocumentRoot "g:/www/mysite"
<Directory "g:/www/mysite/">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
Require local
</Directory>
<IfModule fcgid_module>
Define FCGIPHPVERSION "7.4.33"
FcgidInitialEnv PHPRC ${INSTALL_DIR}/bin/php/php${FCGIPHPVERSION}
<Files ~ "\.php$">
Options +Indexes +Includes +FollowSymLinks +MultiViews +ExecCGI
AddHandler fcgid-script .php
FcgidWrapper "${INSTALL_DIR}/bin/php/php${FCGIPHPVERSION}/php-cgi.exe" .php
</Files>
</IfModule>
</VirtualHost>
|
Merci. |
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7355 Location: Germany, Next to Hamburg
|
Posted: Fri 13 Sep '24 15:19 Post subject: |
|
|
Either you define a a different ini path via
Code: |
FcgidInitialEnv PHPRC "C:\\php82"
|
or you can add a define parameter to the CGI interpreter.
Code: |
FcgidWrapper "C:/php82/php-cgi.exe -d upload_max_filesize=1G -d max_execution_time=360" .php
|
|
|
Back to top |
|
Otomatic
Joined: 01 Sep 2011 Posts: 203 Location: Paris, France, EU
|
Posted: Sat 14 Sep '24 8:53 Post subject: |
|
|
Hi,
Thank you very much.
Adding one or more options with -d works perfectly.
The Apache Module mod_fcgid documentation is very incomplete on this point: Quote: | Options for the command can be included using quotation marks surrounding the command and options | but nowhere does it say that -d must be used to introduce an option.
I couldn't have found it without your help.
Thanks again. |
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7355 Location: Germany, Next to Hamburg
|
Posted: Sat 14 Sep '24 20:57 Post subject: |
|
|
Otomatic wrote: | nowhere does it say that -d must be used to introduce an option.
|
Because it is an option for php. You can also run other CGIs.
See the help output from php.
Code: |
php-cgi.exe -h
Usage: php-cgi [-q] [-h] [-s] [-v] [-i] [-f <file>]
php-cgi <file> [args...]
-a Run interactively
-b <address:port>|<port> Bind Path for external FASTCGI Server mode
-C Do not chdir to the script's directory
-c <path>|<file> Look for php.ini file in this directory
-n No php.ini file will be used
-d foo[=bar] Define INI entry foo with value 'bar'
-e Generate extended information for debugger/profiler
-f <file> Parse <file>. Implies `-q'
-h This help
-i PHP information
-l Syntax check only (lint)
-m Show compiled in modules
-q Quiet-mode. Suppress HTTP Header output.
-s Display colour syntax highlighted source.
-v Version number
-w Display source with stripped comments and whitespace.
-z <file> Load Zend extension <file>.
-T <count> Measure execution time of script repeated <count> times.
|
|
|
Back to top |
|
|
|
|
|
|