The White Page of Syntax Errors (WPSE, or “Whoops”)

The White Page of Syntax Errors,ini_set,error_reporting

The White Page of Syntax Errors (WPSE, or “Whoops”)
Symptom: A blank page appears rather than any of your pretty layout or other elements.
Cause: Fatal Error preventing display.

First, add these lines to the top of your code:
(PHP 4, PHP 5, PHP 7)

error_reporting - Sets the level of PHP error reporting

error_reporting ([int $ level]): int

error_reporting () modifies the error_reporting directive during script execution. PHP has several levels of errors, use this function configures this level for the duration (of execution) of your script. If the optional level parameter is not defined, error_reporting () will return only the current error reporting level.

(PHP 4, PHP 5, PHP 7)

ini_set - Change the value of a configuration option

ini_set (string $ varname, string $ newvalue): string

Changes the value of the varname configuration option to the value of newvalue. The value of the configuration option will be modified during the whole execution of the script and for this script specifically. It will return to its default value at the end of the script.

Run the page again. An error should now be displayed pointing to the cause of your problem. More often than not this is caused by a missed semicolon or other closing punctuation (parenthesis, brace, quotation mark, etc).
At the very least, this information will help us narrow down your problem if you still cant see one.

if you want to improve the solution
comment to help the community
No comments
Post a Comment

Post a Comment