简体   繁体   中英

Dynamically change php ini variable

I have recently purchase Godaddy Linux Shared hosting. In My site there is one php.ini file in my root(/) directory. As my requirement i have set ini paramete output_buffering=on but it will not take effect in my site. because after changing ini setting we need to restart server, but as it is godaddy's shared server they are not able to restart server. I have talked also in support. But no result. so can any one give solution how can php.ini change will take effect without restart apache server.

I have tried by setting in .htacces as php_value output_buffering on but it won't work.

One solution would be to use ini_set(). http://ca1.php.net/ini_set

ini_set('output_buffering', 'on');

Of course this is not completely ideal, as you have to call it wherever you want output buffering to be enabled.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM