Solved

On dedicated linux server with multiple sites, per-site php.ini not working

Posted on 2011-02-14
2
396 Views
Last Modified: 2012-05-11
I have a dedicated Linux server (CentOS) and have multiple name based sites.  I have one site which requires register_globals to be on (I know, I know, it shouldn't need this, but it's a legacy site and can't be easily fixed or upgraded) and another new site which requires register_globals to be off.  The /etc/php.ini file says register_globals On
If I try to set the per-site php.ini file (/home/virtual/site1/fst/etc/php.ini) to say register_globals Off
it doesn't work.  (I restarted apache).  What is the point of the per-site php.ini if you can't set things per site?  Or am I just doing something wrong?
0
Comment
Question by:mignonnedavis
  • 2
2 Comments
 
LVL 4

Accepted Solution

by:
florjan earned 500 total points
ID: 34891312
I don't think that php.ini should be for each virtual site. As far as I know from my sysadmin exp on archlinux and gentoo you should use php_value in vhost file (ussualy found in /etc/apache/vhosts.d/ or /etc/apache2/vhosts.d/). So to change a value for a site you put
php_value php_directive "value"
so for your example
php_value register_globals "Off"

Open in new window

or if you do not wish it to be overridable by .htaccess
php_admin_value register_globals "Off"

Open in new window

If you wanted you could also check apache documentation on this subject.
http://php.net/manual/en/configuration.changes.php
0
 
LVL 4

Expert Comment

by:florjan
ID: 34891356
Sorry a minor mistake. For on/off you should use php_flag. So
php_flag register_globals "Off"

Open in new window

php_admin_flag register_globals "Off"

Open in new window

The code in my last comment would still work, however it's not in specification with php manual.
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Little introduction about CP: CP is a command on linux that use to copy files and folder from one location to another location. Example usage of CP as follow: cp /myfoder /pathto/destination/folder/ cp abc.tar.gz /pathto/destination/folder/ab…
Google Drive is extremely cheap offsite storage, and it's even possible to get extra storage for free for two years.  You can use the free account 15GB, and if you have an Android device..when you install Google Drive for the first time it will give…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

816 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now