0

I've setup php5-cli and everything's working great except I keep getting emails containing deprecated notices such as:

PHP Deprecated:  Comments starting with '#' are deprecated in /etc/php5/cli/conf.d/mcrypt.ini on line 1 in Unknown on line 0

Within the cron files that are running I also have:

error_reporting(E_ALL & ~E_NOTICE & ~E_DEPRECATED);

If I understand correctly that should report all errors except for notices and deprecated messages. I also have this specified within the php.ini for cli.

2 Answers 2

1

The file /etc/php5/cli/conf.d/mcrypt.ini is evaluated before your error_reporting() function is called.

Just correct the file (replace # by ;) and you're fine.

1

Your logic is incorrect with the ands. Based on what you have written, it will report all as long as its NOT both E_NOTICE and E_DEPRECATED, whereas you probably meant either or.

error_reporting(E_ALL ^ ( E_NOTICE | E_DEPRECATED));

The above says, report all errors except E_NOTICE or E_DEPRECATED.

2
  • Unfortunately, it's still sending deprecated emails. Should I make a similar adjustment within the php.ini ?
    – Ben
    Aug 29, 2010 at 3:51
  • 1
    Based on the this bug (bugs.launchpad.net/ubuntu/+source/php-mcrypt/+bug/540208), the error is being thrown BY the command line client--meaning its happening before your script is being run. Theoretically, yes, adding this to the php.ini file would work--but make sure you add it to the right one; there is a hierarchy to how configs get read in.
    – Andrew M.
    Aug 29, 2010 at 4:03

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .