I have set display_errors = Off and error logging to file. That ini (/opt/lsws/lsphp7/lib/php.ini) is loaded and used.
Problem:
I have cron scripts (php) running and was surprised to see the notice error printed (which prevented php generated mails going out):
I verified this behaviour:
if I run a script in CLI
I get
I really should not see ANY errors printed out!
Any ideas?
It looks like CLI uses some other ini even if it says it uses the /opt/lsws/lsphp7/lib/php.ini, or simply ignores it.
I don't want to use error_reporting(0); because I need to see logged errors.
ini file is loaded correctly (where "display_errors = Off"):
phpinfo(INFO_GENERAL) run (that same php script above in correct form) in shell shows
(LSWS Enterprise 4-CPU 5.2.5)
Problem:
I have cron scripts (php) running and was surprised to see the notice error printed (which prevented php generated mails going out):
Code:
Notice: Undefined variable: xxxxxxxxx in /..../.php
on line 3852
if I run a script in CLI
PHP:
<?php
p hpinfo(INFO_GENERAL);
?>
Code:
Parse error: syntax error, unexpected 'hpinfo' (T_STRING) in /root/phpinfo.php on line 3
Any ideas?
It looks like CLI uses some other ini even if it says it uses the /opt/lsws/lsphp7/lib/php.ini, or simply ignores it.
I don't want to use error_reporting(0); because I need to see logged errors.
ini file is loaded correctly (where "display_errors = Off"):
phpinfo(INFO_GENERAL) run (that same php script above in correct form) in shell shows
Code:
PHP Version => 7.2.3
Server API => LiteSpeed V7.0
Loaded Configuration File => /opt/lsws/lsphp7/lib/php.ini
Scan this dir for additional .ini files => (none)
Additional .ini files parsed => (none)
PHP API => 20170718
PHP Extension => 20170718
Zend Extension => 320170718
Zend Extension Build => API320170718,NTS
PHP Extension Build => API20170718,NTS
Debug Build => no
Last edited by a moderator: