Sample Header Ad - 728x90

Apache2 PHP error_log() doesn't work when called in some PHP code

0 votes
0 answers
31 views
On my Linux Ubuntu system I run apache2 web server in the context of a PHP based web application. phpinfo() reports the following error_log /opt/unetlab/data/Logs/php_errors.txt I.e. error_log() is supposed to send messages to /opt/unetlab/data/Logs/php_errors.txt file. On PHP code that handles the application's REST API, I use error_log() function to log some debugging info. The weird thing is that sometimes error_log() doesn't write anything on the log file. Nevertheless error_log() called from other PHP code's files (e.g.functions.php) works as a charm. Which could be the problem ?
Asked by CarloC (385 rep)
Jun 4, 2025, 02:06 PM
Last activity: Jun 5, 2025, 05:56 AM