gamerhk
Member
Posted 5 years ago #
hi all.
i am in the process of writing a plugin.
i realize when i make a syntax error, nothing will be output and i have to check the apache log.
here is the question:
how can i change wp so that it will report syntax error to client?
like in normal php... if u do
<? invalid syntax' (); ?>
the brwoser will tell u that u have made a syntax error.
how can i make wp behaves like regular php
gamerhk
Member
Posted 5 years ago #
gamerhk
Member
Posted 5 years ago #
WordPress is regular PHP. Turn your PHP error reporting on.
gamerhk
Member
Posted 5 years ago #
no
it won't work
i have error_reporting(E_ALL)
it just shows a blank page whenever i have error
pizdin_dim
Member
Posted 5 years ago #
If you're running under Apache, then it's possible that your host has globally disabled displaying errors. Try adding these two lines to your own ".htaccess" file:
php_flag display_errors on
php_flag display_startup_errors on
Mittineague
Member
Posted 5 years ago #
Because WP parses templates, if a file has an error, you'll only get a "blank page" unless you make an HTTP request directly for the plugin. eg.
http://www.yoursite.com/blogfolder/wp-content/plugins/yourplugin.php
If there are syntax errors you'll then see them. Once the page is OK you'll get an "option not found" type of error depending if the plugin is adding an action, option, filter, etc.