U3F1ZWV6ZTc5OTgzNDMxMzE1MzJfRnJlZTUwNDYwNDY0NzA3Nzc=

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

The White Page of Syntax Errors,ini_set,error_reporting

Question:
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.

Solution:
First, add these lines to the top of your code:
<?php
ini_set('display_errors',1);
error_reporting(E_ALL);
?>
error_reporting
(PHP 4, PHP 5, PHP 7)

error_reporting - Sets the level of PHP error reporting

Description
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.

ini_set
(PHP 4, PHP 5, PHP 7)

ini_set - Change the value of a configuration option

Description 
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
Comments
No comments
Post a Comment

Post a Comment

NameEmailMessage