Solved

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

Posted on 2011-02-14
2
400 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Building an interactive eFuture classroom

Watch and learn how ATEN provided a total control system solution including seamless switching matrix switch, HDBaseT extenders, PDU, lighting control to build an interactive eFuture classroom.

Question has a verified solution.

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

It’s 2016. Password authentication should be dead — or at least close to dying. But, unfortunately, it has not traversed Quagga stage yet. Using password authentication is like laundering hotel guest linens with a washboard — it’s Passé.
Join Greg Farro and Ethan Banks from Packet Pushers (http://packetpushers.net/podcast/podcasts/pq-show-93-smart-network-monitoring-paessler-sponsored/) and Greg Ross from Paessler (https://www.paessler.com/prtg) for a discussion about smart network …
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…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…

739 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