[PHP] Setting values of php.ini file at runtime
Dear All, I am wondering if anyone shed some light. i am thinking of setting value for php.ini variables like register_globals = ON/OFF at runtime (within our php script). Is there any function built-in in php?, or can we do it ourselves. Looking forward, Thanks Tariq -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Setting values of php.ini file at runtime
You cannot do it inside a script as the register_globals magic happens before the script starts executing, so toggling the setting at runtime is too late. -Rasmus On Mon, 25 Nov 2002, Tariq Murtaza wrote: Dear All, I am wondering if anyone shed some light. i am thinking of setting value for php.ini variables like register_globals = ON/OFF at runtime (within our php script). Is there any function built-in in php?, or can we do it ourselves. Looking forward, Thanks Tariq -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Setting values of php.ini file at runtime
Excuse me breaking in...somewhat similar problem: Have set up a client recently, preaching security persuaded them into updating so that could run Register_Globals=Off. Now they want to install a 'wiki' which requires (to my horror) Register_Globals=On. Short of two Apache/PHP servers, what is a logical way to structure things so that the 'wiki' runs 'insecure' but other/'my' PHP work runs more securely? Please advise, =dn You cannot do it inside a script as the register_globals magic happens before the script starts executing, so toggling the setting at runtime is too late. -Rasmus On Mon, 25 Nov 2002, Tariq Murtaza wrote: Dear All, I am wondering if anyone shed some light. i am thinking of setting value for php.ini variables like register_globals = ON/OFF at runtime (within our php script). Is there any function built-in in php?, or can we do it ourselves. Looking forward, Thanks Tariq -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Setting values of php.ini file at runtime
a .htaccess file in the directory you want RG OFF (ie /wiki/) should do the trick: IfModule mod_php4.c php_flag register_globals on /IfModule This seems to work for me... on 25/11/02 10:37 PM, DL Neil ([EMAIL PROTECTED]) wrote: Excuse me breaking in...somewhat similar problem: Have set up a client recently, preaching security persuaded them into updating so that could run Register_Globals=Off. Now they want to install a 'wiki' which requires (to my horror) Register_Globals=On. Short of two Apache/PHP servers, what is a logical way to structure things so that the 'wiki' runs 'insecure' but other/'my' PHP work runs more securely? Please advise, =dn You cannot do it inside a script as the register_globals magic happens before the script starts executing, so toggling the setting at runtime is too late. -Rasmus On Mon, 25 Nov 2002, Tariq Murtaza wrote: Dear All, I am wondering if anyone shed some light. i am thinking of setting value for php.ini variables like register_globals = ON/OFF at runtime (within our php script). Is there any function built-in in php?, or can we do it ourselves. Looking forward, Thanks Tariq -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Justin French http://Indent.com.au Web Development Graphic Design -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Setting values of php.ini file at runtime
On Monday 25 November 2002 19:37, DL Neil wrote: Excuse me breaking in...somewhat similar problem: Have set up a client recently, preaching security persuaded them into updating so that could run Register_Globals=Off. Now they want to install a 'wiki' which requires (to my horror) Register_Globals=On. Short of two Apache/PHP servers, what is a logical way to structure things so that the 'wiki' runs 'insecure' but other/'my' PHP work runs more securely? Set it on a per directory basis. If using Apache something like: Directory /home/www.example.com/wiki_directory php_value register_globals 1 /Directory -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * /* There is nothing more silly than a silly laugh. -- Gaius Valerius Catullus */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Setting values of php.ini file at runtime
Justin, Neat! Don't limit thoughts to PHP when can solve it in Apache - thank you, =dn a .htaccess file in the directory you want RG OFF (ie /wiki/) should do the trick: IfModule mod_php4.c php_flag register_globals on /IfModule This seems to work for me... on 25/11/02 10:37 PM, DL Neil ([EMAIL PROTECTED]) wrote: Excuse me breaking in...somewhat similar problem: Have set up a client recently, preaching security persuaded them into updating so that could run Register_Globals=Off. Now they want to install a 'wiki' which requires (to my horror) Register_Globals=On. Short of two Apache/PHP servers, what is a logical way to structure things so that the 'wiki' runs 'insecure' but other/'my' PHP work runs more securely? Please advise, =dn You cannot do it inside a script as the register_globals magic happens before the script starts executing, so toggling the setting at runtime is too late. -Rasmus On Mon, 25 Nov 2002, Tariq Murtaza wrote: Dear All, I am wondering if anyone shed some light. i am thinking of setting value for php.ini variables like register_globals = ON/OFF at runtime (within our php script). Is there any function built-in in php?, or can we do it ourselves. Looking forward, Thanks Tariq -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Justin French http://Indent.com.au Web Development Graphic Design -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Setting values of php.ini file at runtime
Just set register_globals on in the wiki directory. Like this in your httpd.conf: Directory /path/to/wiki php_admin_flag register_globals on /Directory -Rasmus On Mon, 25 Nov 2002, DL Neil wrote: Excuse me breaking in...somewhat similar problem: Have set up a client recently, preaching security persuaded them into updating so that could run Register_Globals=Off. Now they want to install a 'wiki' which requires (to my horror) Register_Globals=On. Short of two Apache/PHP servers, what is a logical way to structure things so that the 'wiki' runs 'insecure' but other/'my' PHP work runs more securely? Please advise, =dn You cannot do it inside a script as the register_globals magic happens before the script starts executing, so toggling the setting at runtime is too late. -Rasmus On Mon, 25 Nov 2002, Tariq Murtaza wrote: Dear All, I am wondering if anyone shed some light. i am thinking of setting value for php.ini variables like register_globals = ON/OFF at runtime (within our php script). Is there any function built-in in php?, or can we do it ourselves. Looking forward, Thanks Tariq -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php