I’m trying to put My Yii application on a server where the function ini_set is disabled.
I always get this error:
[06-Oct-2013 16:28:57 Africa/Algiers] PHP Warning: ini_set() has been disabled for security reasons in /home/mywebsite/public_html/testquizz/framework/web/CHttpSession.php on line 89
I searched in Google but I didn’t found anything about this.
Ugh! Well, there’s still a chance to modify the settings touched by [font=“Courier New”]ini_set()[/font] via a [font=“Courier New”].htaccess[/font] file. What exactly are you trying to change?
That won’t happen. disable_functions can only be altered from within PHP’s config, there is no way for a .htaccess file to override that. However, you can still modify other PHP settings in your .htaccess. See here.
Unfortunately this will not solve the problem, as CHttpSession will continue calling the ini_set.
You have to substitute CHttpSession with another session (CCache or CDb) or you can copy the class in your protected/components, change the name and edit it in order to fit the server requirements.
In a word: CHttpSession REQUIRE ini_set, so you cannot use CHttpSession. Altering the server config in order to fit
CHttpSession will not solve the problem, as it will continue calling.
Thank you for all your propositions, it helps me a lot.
Just for information: I’m using these two modules: Yii-Auth and Yii-User
I changed the source code where I used the CHttpSession in my application and I can see the login page. But when I try to login I get blank page with this error in my logs:
PHP Fatal error: Class 'CStringValidator' not found in /home/mdi/public_html/mywebsite/framework/validators/CValidator.php on line 187
And when I refresh, I can see my dashboard, but the ‘model/admin’ pages don’t display entirely.
It’s not the question wether you installed APC (or a similar opcode cache). It’s wether the original hoster did so. Got any access to the server’s logfiles?