Is there a way to write PHP variables (and arrays) into apache log? To have some server-side debugging ablility directly?
1 Answer
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));