Updating php
Reko Turja
reko.turja at liukuma.net
Mon Nov 30 23:46:20 UTC 2015
> Thanks for the info. Can you tell me where I can find some
> documentation on
> how to set up "php-fpm" on a FreeBSD-10.2 system running "apache24"?
As MAtthew said, this removes lots of hassle (and actually allows
running of threaded Apache and php on top of each other without all
kinds of interesting side effects)
This is how I've done it based on sources from internet and then
adjusting the sources into practise - tbh the amount of good how-to's
on the subject is pretty minimal:
First you need to load mod fcgi (and of course compile/install binary
too) in httpd.conf like this (just add on the bottom of other
LoadModules if not already there:
LoadModule fcgid_module libexec/apache24/mod_fcgid.so
For my applications I've had to set some other variables, the
following is snippet of my httpd conf just after the LoadModules:
FcgidFixPathinfo 1
FcgidMaxRequestLen 13107200
FcgidMaxProcessesPerClass 50
FcgidMaxRequestInMem 131072
FcgidIOTimeout 90
<IfModule fcgid_module>
AddHandler fcgid-script .php
Options +ExecCGI
FcgidWrapper /usr/local/bin/php-wrapper .php
</IfModule>
As you see, we need a wrapper script in whatever directory we want,
for sake of consistency I use /usr/local/bin. For my needs the
contents of the wrapper shell script are very simply:
#!/bin/sh
# Set desired PHP_FCGI_* environment variables.
# Example:
# PHP FastCGI processes exit after 500 requests by default.
PHP_FCGI_MAX_REQUESTS=1000
export PHP_FCGI_MAX_REQUESTS
As we are running cgi from "page directories" we need to tell Apache
that running CGI is "okay" (as there's always a risk involved, this
you need to think yourself) from these, so:
<Directory /your/web/homedir/here>
...
Options ExecCGI ...
...
</Directory>
That's basically how to set the thing up and running.
-Reko
"
More information about the freebsd-ports
mailing list