multiple php.ini files

This is a discussion on multiple php.ini files within the PHP Language forums, part of the PHP Programming Forums category; I have some old legacy php scripts that need to run with register globals on. I would prefer not to ...


Go Back   Usenet Forums > PHP Programming Forums > PHP Language

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-09-2005
Bob
 
Posts: n/a
Default multiple php.ini files


I have some old legacy php scripts that need to run with register globals
on.

I would prefer not to run with register globals turned on where I don't need
to.

I am looking for a way of having a separate php.ini file for that directory,
that has globals on and run with globals off for the rest of my server.

Thanks.


Reply With Quote
  #2 (permalink)  
Old 02-09-2005
Dave Patton
 
Posts: n/a
Default Re: multiple php.ini files

"Bob" <fake@dontbother.com> wrote in
news:4209939c$0$29787$c30e37c6@lon-reader.news.telstra.net:

>
> I have some old legacy php scripts that need to run with register
> globals on.
>
> I would prefer not to run with register globals turned on where I
> don't need to.
>
> I am looking for a way of having a separate php.ini file for that
> directory, that has globals on and run with globals off for the rest
> of my server.


If using Apache, use one php.ini file, and then use a .htaccess
file in that directory to set register_globals.

--
Dave Patton
Canadian Coordinator, Degree Confluence Project
http://www.confluence.org/
My website: http://members.shaw.ca/davepatton/
Reply With Quote
  #3 (permalink)  
Old 02-09-2005
Franck Nijhof - BlueSolid Software
 
Posts: n/a
Default Re: multiple php.ini files

Bob wrote:
> I have some old legacy php scripts that need to run with register globals
> on.
>
> I would prefer not to run with register globals turned on where I don't need
> to.
>
> I am looking for a way of having a separate php.ini file for that directory,
> that has globals on and run with globals off for the rest of my server.
>
> Thanks.
>
>



You could install suPHP (suphp.org).
It offers the possibility to assign an
different php.ini to each virtualhost.


Kind regards,

Franck Nijhof
BlueSolid Software
Reply With Quote
  #4 (permalink)  
Old 02-10-2005
Chung Leong
 
Posts: n/a
Default Re: multiple php.ini files

"Bob" <fake@dontbother.com> wrote in message
news:4209939c$0$29787$c30e37c6@lon-reader.news.telstra.net...
>
> I have some old legacy php scripts that need to run with register globals
> on.
>
> I would prefer not to run with register globals turned on where I don't

need
> to.
>
> I am looking for a way of having a separate php.ini file for that

directory,
> that has globals on and run with globals off for the rest of my server.
>
> Thanks.
>


Not something I've done before, but in Apache, I think you can override a
PHP option on a per-directory basis using the php_value directive. According
to the manual, register_globals is a PHP_INI_PERDIR option.


Reply With Quote
  #5 (permalink)  
Old 02-16-2005
Bob
 
Posts: n/a
Default Solution: multiple php.ini files


"Bob" <fake@dontbother.com> wrote in message
news:4209939c$0$29787$c30e37c6@lon-reader.news.telstra.net...
>
> I have some old legacy php scripts that need to run with register globals
> on.
>
> I would prefer not to run with register globals turned on where I don't

need
> to.
>
> I am looking for a way of having a separate php.ini file for that

directory,
> that has globals on and run with globals off for the rest of my server.
>
> Thanks.
>
>


The solution to this problem was

set register_globals = Off in the php.ini file

in the directory that had the old PHP code, that required register_globals
to be enabled, I put a .htaccess file with

php_flag register_globals On

I additionally had to make sure that the httpd.conf Directory directive was
allowed to have overrides from the .htaccess file



Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 10:20 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0