- Ubuntu 12.04
- Apache 2.2.22
- PHP 5.3.10 [running as libapache2-mod-fcgid]
[trying to match a development server vs. my web host]
I managed to get fcgi to work using a wrapper and have registered the necessary handlers to have .html files parsed as php. Now I'm trying to figure out why my scripts don't run with the php.ini files in each directory, which is reportedly the default behaviour.
from phpinfo(), running from http://127.0.0.1/NEW/poop.html
Server API CGI/FastCGI
Virtual Directory Support disabled
Configuration File (php.ini) Path /etc/php5/cgi
Loaded Configuration File /var/www/johnny/public_html/php.ini
Scan this dir for additional .ini files /etc/php5/cgi/conf.d
it appears to be reading config from [/etc/php5/cgi/php.ini] just fine, and also from the web root, which I had to define in the wrapper script in order for it to read the php.ini there
[/var/www/php-fcgi-scripts/johnny/php-fcgi-starter]
#!/bin/sh
PHPRC=/etc/php5/cgi/
export PHPRC
export PHP_FCGI_MAX_REQUESTS=5000
export PHP_FCGI_CHILDREN=8
exec /usr/lib/cgi-bin/php -c /var/www/johnny/public_html
I pulled together from two web tutorials to get this FastCGI + VirtualHost working, and have been learning piecemeal how it all works. Here's my VirtualHost setup:
[/etc/apache2/sites-available/johnny.conf]
<VirtualHost _default_:80>
ServerName johnny.10.128.0.2.xip.io
ServerAlias my.dev.server.public.IP
DocumentRoot /var/www/johnny/public_html/
<IfModule mod_fcgid.c>
SuexecUserGroup johnny johnny
<Directory /var/www/johnny/public_html/>
Options +ExecCGI -Indexes +FollowSymLinks +MultiViews
AllowOverride All
AddHandler fcgid-script .php .htm .html
FCGIWrapper /var/www/php-fcgi-scripts/johnny/php-fcgi-starter .php
FCGIWrapper /var/www/php-fcgi-scripts/johnny/php-fcgi-starter .htm
FCGIWrapper /var/www/php-fcgi-scripts/johnny/php-fcgi-starter .html
Order allow,deny
Allow from all
</Directory>
</IfModule>
ErrorLog /var/log/apache2/johnny-error.log
CustomLog /var/log/apache2/johnny-access.log combined
LogLevel warn
ServerSignature Off
</VirtualHost>
but it will not load anything from [/var/www/johnny/public_html/NEW/php.ini]
check this pastebin for a look at all I've done to this server... I had to retcon some of this stuff to reflect troubleshooting that I did later, so I hope I didn't miss anything. I haven't tried running thru this list from scratch (yet...). I'm also unsure if there are any significant lines to append, as I've been tooling around for a while today, mostly editing then reverting files.