Page 1 of 1

(SOLVED)Where to disable E_DEPRECATED?

Posted: Mon Jun 03, 2013 2:49 pm
by rab
Hi,

The CMSMS documentation says to disable php's E_DEPRECATED by changing the error level setting in php.ini. Our host's support people said we could do this by creating a new php.ini file in the root folder with the line:

Code: Select all

error_reporting = E_ALL & ~E_DEPRECATED
Unfortunately, that didn't work!

Another support person said he thought the CMSMS config.php file was overriding the added php.ini file, thus negating its effect. He suggested instead of adding a new php.ini file, just add this line to CMSMS's config.php file:

Code: Select all

error_reporting(E_ALL &  ~E_DEPRECATED); 
That did work, but...

Since I'm no php guru, I'm wondering if this is OK to do, or if it might cause other problems?

Thanks for any advice!

Re: Where to disable E_DEPRECATED?

Posted: Mon Jun 03, 2013 3:56 pm
by calguy1000
CMSMS does not override the error_reporting stuff UNLESS

a: debug mode is enabled
or
b: some third party module does.... but I haven't seen one that does yet. Modules are loaded too late in the process, changing error_reporting in a module would have limited use.

Re: Where to disable E_DEPRECATED?

Posted: Mon Jun 03, 2013 6:55 pm
by Rolf
What host do you use? You have CPanel?

Re: Where to disable E_DEPRECATED?

Posted: Mon Jun 03, 2013 8:55 pm
by manuel
Dear Rab,

As it happens, i had a chat support session with Arvixe about the same a while ago.
The conclusion at the end of my support session was that i could either enable or disable the error_reporting by setting a custom php.ini. :-\

Because there was no real solution that allowed me to set the *level* of the error_reporting with a custom php.ini, i actually had disabled error_reporting completely!

But now by adding error_reporting(E_ALL & ~E_DEPRECATED & ~E_NOTICE); in the config.php file (thx for the tip) i got everything to work as expected without having to resort to using a custom php.ini file and completely disabling all error_reporting.

So normally, we would be able to set the error_reporting *level* in 3 ways:
- php.ini (apparently not possible on Arvixe at the moment)
- .htaccess (not possible on many hosts so nothing special)
- inside a php script (possible at Arvixe)

So i would be inclined to say that this is an issue of the hosting provider and not of cmsms ;D

And as for the question about this being an issue:
If you upgrade CMSMS it's possible that the custom error_reporting line you added is removed.
Just make sure to re-include it when upgrading and you should be fine.

Greetings,
Manuel

Re: Where to disable E_DEPRECATED?

Posted: Mon Jun 03, 2013 9:02 pm
by rab
I agree - it's a hosting issue, not CMSMS. The only concern I have is if adding the error level code to the config.php file could screw up something else - either now or down the road.

Re: Where to disable E_DEPRECATED?

Posted: Mon Jun 03, 2013 9:07 pm
by manuel
Dear Rab,

I had just edited my reply to include a response about that when i noticed you already responded :)

Greetings,
Manuel

Re: Where to disable E_DEPRECATED?

Posted: Mon Jun 03, 2013 9:11 pm
by rab
Great, thanks!

Re: Where to disable E_DEPRECATED?

Posted: Mon Jun 03, 2013 9:25 pm
by manuel
Dear Rab,

Feel free to slap a [solved] in front of the subject of your first post ;)

Greetings,
Manuel

Re: (SOLVED)Where to disable E_DEPRECATED?

Posted: Tue Jun 11, 2013 3:09 pm
by rab
I've been working with various of Arvixe's support people for over a week now, and one of them seems to have finally come up with a solution. Basically, it's to put a custom php.ini in the Admin folder, not the root. When I added the following php.ini to the Admin folder, it worked!

Code: Select all

upload_max_filesize = 10M
post_max_size = 10M
error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT
register_globals = Off
display_errors = Off
output_buffering = On
max_execution_time = 120
Sure hope this puts an end to this issue!