A PHP application can generate different levels of errors and warnings during execution. It is important for QA engineers to see these errors in order to troubleshoot the application being tested. However, if you are having trouble displaying all the errors and warnings, you can use the following techniques to enable PHP errors and warnings.
1. Default Way
Use these lines to create logs:
error_log("Hello, errors!" );
The above code has created a log with Hello, errors! To verify, use the following command in cmd:
tail -f /tmp/fervor.log
Update php.ini as described in this (Advanced PHP Error Handling via PHP)
2. Place the below-mentioned code in the index file on top:
ini_set('ignore_repeated_errors', TRUE); // always TRUE
ini_set('display_errors', FALSE); // Error/Exception display, FALSE in production environment or real server.TRUE in development environment
ini_set('log_errors', TRUE); // Error/Exception file logging engine.
ini_set('error_log', 'your/path/to/errors.log'); // Logging file path
error_log("Hello, errors!" );// to set your logs