I have Apache directive like so:
error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT
display_errors = On
log_errors = On
log_errors_max_len = 10240
error_log = php_errors.log
I get this error on one of my pages - the error is displayed in the browser.
Deprecated: Function money_format() is deprecated in /var/www/html/sample.php on line 152
That's great because it shows me there is an error in my code. But I am surprised it shows me deprecated error when in Apache config I explicitly request to not show me deprecated errors (~E_DEPRECATED).
But, no matter... since it is production environment, I need to see the error, but not see it in the browser. So I set display_errors to Off. But now, I do not see the error, and it is not logged anywhere despite my php.ini config having directives to do so.
Question
How can I see the error in a log (preferably apache's error.log is best), but not in the browser. I am puzzled as to why it is not happening this way, because my php.ini directives seem to be requesting php to do this via log_errors and error_log directives
Virtual Host Config
<VirtualHost *:80>
ServerName apps.domain.com
ServerAdmin [email protected]
DocumentRoot /var/www/html
<Directory /var/www/html>
AllowOverride All
Require all granted
</Directory>
Redirect permanent "/" "https://apps.domain.com/"
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
RewriteEngine on
RewriteCond %{SERVER_NAME} =apps.domain.com
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,QSA,R=permanent]
</VirtualHost>
.htaccess
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteCond %{REQUEST_URI}::$1 ^(/.+)(.+)::\2$
RewriteRule ^(.*) - [E=BASE:%1]
RewriteRule ^(.*)$ %{ENV:BASE}index.php [NC,L]
a+wx. I am onto the next question - why some errors go into apache log and why some go into php.ini-specified log