?
Solved

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

Posted on 2011-02-14
2
Medium Priority
?
403 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 2000 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

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

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

Hi, in this article I'm going to teach you how to run your own site, and how to let people in (without IP). I'll talk about and explain each step... :) By the way, everything in this Tutorial is completely free and legal. This article is for …
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…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
Suggested Courses
Course of the Month9 days, 7 hours left to enroll

762 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