Solved

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

Posted on 2011-02-14
2
398 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

Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
PHP: Insert Data into MySQL 5 56
Bash script - Exit out of choice loop 2 44
AWS EC2 HTTP & HTTPS 2 46
Upgrade BIOS / EUFI at Scale 4 56
If you have a server on collocation with the super-fast CPU, that doesn't mean that you get it running at full power. Here is a preamble. When doing inventory of Linux servers, that I'm administering, I've found that some of them are running on l…
If you are a web developer, you would be aware of the <iframe> tag in HTML. The <iframe> stands for inline frame and is used to embed another document within the current HTML document. The embedded document could be even another website.
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…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

821 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