Reputation: 500
Is there a way to write PHP variables (and arrays) into apache log? To have some server-side debugging ablility directly?
Upvotes: 0
Views: 307
Reputation: 87
You can use error_log function. It will log to the web server error log regarding the its settings. It will work in any case - apache, nginx, php-cgi, php-fpm
To write variables you can use
error_log('MyObject is '.var_export($my_object, true));
Upvotes: 3