reporting syntax error (7 posts)

  1. gamerhk
    Posted 10 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

  2. gamerhk
    Posted 10 years ago #

    does anyone know?

  3. gamerhk
    Posted 9 years ago #


  4. masquerade
    Posted 9 years ago #

    WordPress is regular PHP. Turn your PHP error reporting on.

  5. gamerhk
    Posted 9 years ago #

    it won't work
    i have error_reporting(E_ALL)
    it just shows a blank page whenever i have error

  6. Pizdin Dim
    Posted 9 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

  7. Mittineague
    Posted 9 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.
    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.

Topic Closed

This topic has been closed to new replies.

About this Topic