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 ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
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. |
|
|||
|
"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/ |
|
|||
|
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 |
|
|||
|
"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. |
|
|||
|
"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 |