How do I turn on all error and warnings and log them to a file, but to set up all of that within the script (not changing anything in php.ini)?
I want to define a fi
See
Example
error_log("You messed up!", 3, "/var/tmp/my-errors.log");
You can customize error handling with your own error handlers to call this function for you whenever an error or warning or whatever you need to log occurs. For additional information, please refer to the Chapter Error Handling in the PHP Manual