WordPress.org

Ready to get started?Download WordPress

Forums

reporting syntax error (7 posts)

  1. gamerhk
    Member
    Posted 7 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
    Member
    Posted 7 years ago #

    does anyone know?

  3. gamerhk
    Member
    Posted 7 years ago #

    push

  4. masquerade
    Member
    Posted 7 years ago #

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

  5. gamerhk
    Member
    Posted 7 years ago #

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

  6. pizdin_dim
    Member
    Posted 7 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
    Member
    Posted 7 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.

Topic Closed

This topic has been closed to new replies.

About this Topic