OsakaWebbie
Programmer
Is there a way to get PHP to tell me where it is checking php.ini files for its settings? It feels like my VPS is haunted by ghost settings I can't find. php.ini files I would expect to have an effect don't, and instead PHP gets its ideas from elsewhere (who knows where). The settings I'm currently fighting are magic_quotes_gpc and display_errors, but I'm sure there will be others in the future that I want to control.
My setup is kinda complex, so bear with me. I'm not an expert in server admin, so if my setup is wacky (and/or if you see security holes), please tell me. The objective is a regular website in one spot (with one domain), a subdirectory under that with some code that is still being worked on, and a single-codebase/multi-client application in a different spot (using subdomains of a second domain).
The regular website is in /var/ and as I said, it also has a subdirectory with code under development. Then I have an application that uses a single codebase (in /var/ but each client has a separate database and separate directory for auxiliary files (/var/ Finally, I just installed a development version of the codebase (/var/
In my Apache configuration, I have this stuff (parts of three files, but I think it executes in this order):
In each client directory (including /var/ there is a .cgi-bin directory with a php.fcgi script and php.ini file (the php.fcgi files are all identical - that's redundant, but I don't know how else to set it up, because the php.ini files need to be distinct). The plan was that the only thing normally in the clients' php.ini files would be open_basedir (to keep them from accessing each other's files). But I can't figure out where the default settings (anything not specified in /var/ are, so I'm having to repeat stuff in each of those files that should just be in the default spot.
The first problem I noticed was with magic_quotes_gpc. OFF should be the default (I have PHP 5.3.3), and there is no php.ini on my whole machine that sets it to ON. But without intervention the setting ends up ON in the KizunaDB area! I tried adding "magic_quotes_gpc = Off" in /etc/php.ini and /var/ but neither have any effect - those files appear to be ignored in my current structure. The only solution I could find was to put that command in all the instances of /var/ which seems excessive, but for now that's what I have to do.
Next I added the subdirectory under the main website. I discovered that display_errors was Off (set that way in /var/ so I was working blind. Reading up on it, I learned that it is good to keep it off for production sites, so I tried to turn it on just for the subdirectory. But a php.ini file placed in the subdirectory is ignored, so I had to change the setting in /var/ which affects the main Joomla website as well (not ideal). I can't figure out any way to keep the settings separate for the main directory and the subdirectory.
Then yesterday I set up the kizunadb/dev development area, and discovered that on that side of the house, display_errors had been ON all along, and that that is the system default when there is no php.ini that applies. So once again, I had to add a specification to each and every client's php.ini to turn it off. I would like to have a default for Kizuna and then just make an exception for dev, or even better, have a default for everything and then make exceptions for dev.kizunadb.com and l4jp.com/subdir. Can someone teach me a little bit about how this works so that I can manage it better?
My setup is kinda complex, so bear with me. I'm not an expert in server admin, so if my setup is wacky (and/or if you see security holes), please tell me. The objective is a regular website in one spot (with one domain), a subdirectory under that with some code that is still being worked on, and a single-codebase/multi-client application in a different spot (using subdomains of a second domain).
The regular website is in /var/ and as I said, it also has a subdirectory with code under development. Then I have an application that uses a single codebase (in /var/ but each client has a separate database and separate directory for auxiliary files (/var/ Finally, I just installed a development version of the codebase (/var/
In my Apache configuration, I have this stuff (parts of three files, but I think it executes in this order):
Code:
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory "/var/[URL unfurl="true"]www/html">[/URL]
Options -Indexes FollowSymLinks +ExecCGI
AllowOverride All
Order allow,deny
Allow from all
AddHandler php5-fastcgi .php
Action php5-fastcgi /cgi-bin/php.fcgi
</Directory>
ScriptAlias /cgi-bin/ "/var/[URL unfurl="true"]www/cgi-bin/"[/URL]
<Directory "/var/[URL unfurl="true"]www/cgi-bin">[/URL]
AllowOverride None
Options None
Order allow,deny
Allow from all
</Directory>
<VirtualHost *:80>
ServerName l4jp.com
DocumentRoot /var/[URL unfurl="true"]www/html[/URL]
SuexecUserGroup l4jp l4jp
ScriptAlias /cgi-bin/ "/var/[URL unfurl="true"]www/cgi-bin/"[/URL]
</VirtualHost>
<Directory "/var/[URL unfurl="true"]www/kizunadb/dev">[/URL]
Options -Indexes FollowSymLinks +ExecCGI
AllowOverride None
AddHandler php5-fastcgi .php
Action php5-fastcgi /cgi-bin/php.fcgi
Order allow,deny
Allow from All
</Directory>
<VirtualHost *:80>
ServerName dev.kizunadb.com
DocumentRoot /var/[URL unfurl="true"]www/kizunadb/dev[/URL]
SuexecUserGroup dev kizunadb
ScriptAlias /cgi-bin/ "/var/[URL unfurl="true"]www/dev/.cgi-bin/"[/URL]
</VirtualHost>
<Directory "/var/[URL unfurl="true"]www/kizunadb/codebase">[/URL]
Options -Indexes FollowSymLinks +ExecCGI
AllowOverride None
AddHandler php5-fastcgi .php
Action php5-fastcgi /cgi-bin/php.fcgi
Order allow,deny
Allow from All
</Directory>
<VirtualHost *:80>
ServerName clientname.kizunadb.com
DocumentRoot /var/[URL unfurl="true"]www/kizunadb/codebase[/URL]
SuexecUserGroup clientname kizunadb
ScriptAlias /cgi-bin/ "/var/[URL unfurl="true"]www/clientname/.cgi-bin/"[/URL]
</VirtualHost>
# This last vhost section is repeated for each client...
In each client directory (including /var/ there is a .cgi-bin directory with a php.fcgi script and php.ini file (the php.fcgi files are all identical - that's redundant, but I don't know how else to set it up, because the php.ini files need to be distinct). The plan was that the only thing normally in the clients' php.ini files would be open_basedir (to keep them from accessing each other's files). But I can't figure out where the default settings (anything not specified in /var/ are, so I'm having to repeat stuff in each of those files that should just be in the default spot.
The first problem I noticed was with magic_quotes_gpc. OFF should be the default (I have PHP 5.3.3), and there is no php.ini on my whole machine that sets it to ON. But without intervention the setting ends up ON in the KizunaDB area! I tried adding "magic_quotes_gpc = Off" in /etc/php.ini and /var/ but neither have any effect - those files appear to be ignored in my current structure. The only solution I could find was to put that command in all the instances of /var/ which seems excessive, but for now that's what I have to do.
Next I added the subdirectory under the main website. I discovered that display_errors was Off (set that way in /var/ so I was working blind. Reading up on it, I learned that it is good to keep it off for production sites, so I tried to turn it on just for the subdirectory. But a php.ini file placed in the subdirectory is ignored, so I had to change the setting in /var/ which affects the main Joomla website as well (not ideal). I can't figure out any way to keep the settings separate for the main directory and the subdirectory.
Then yesterday I set up the kizunadb/dev development area, and discovered that on that side of the house, display_errors had been ON all along, and that that is the system default when there is no php.ini that applies. So once again, I had to add a specification to each and every client's php.ini to turn it off. I would like to have a default for Kizuna and then just make an exception for dev, or even better, have a default for everything and then make exceptions for dev.kizunadb.com and l4jp.com/subdir. Can someone teach me a little bit about how this works so that I can manage it better?