Override php configuration in php files

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
m_kk
Forum Newbie
Posts: 8
Joined: Tue Feb 12, 2008 10:26 am

Override php configuration in php files

Post by m_kk »

Is it possible to override the settings in php.ini file in the .php page. For example I need to the allow_url_include to be on for my program to work. Can i configure it in my php page instead of editing the php.ini file.
Thanks in advance
User avatar
liljester
Forum Contributor
Posts: 400
Joined: Tue May 20, 2003 4:49 pm

Re: Override php configuration in php files

Post by liljester »

try the ini_set() function.
User avatar
Zoxive
Forum Regular
Posts: 974
Joined: Fri Apr 01, 2005 4:37 pm
Location: Bay City, Michigan

Re: Override php configuration in php files

Post by Zoxive »

Look at http://www.php.net (The Manual), it will say if settings can be overridden.

http://us2.php.net/filesystem
User avatar
anjanesh
DevNet Resident
Posts: 1679
Joined: Sat Dec 06, 2003 9:52 pm
Location: Mumbai, India

Re: Override php configuration in php files

Post by anjanesh »

Check out this list.
If the value you want to change has a changeable value of PHP_INI_PERDIR, then edit your directory's .htaccess file. How to change configuration settings: Running PHP as an Apache module

If its a PHP_INI_ALL, then you can set it using ini_set.
Post Reply