Support » Fixing WordPress » Error Message with new version of PHP

  • At the prompting of my web host I upgraded PHP from 5.3 to 7.2. Now I get this error message when I try to access http://www.lynnunderwood.com:

    Parse error: syntax error, unexpected ‘new’ (T_NEW) in /webroot/r/e/resea005/lynunderwood/www/wp-content/plugins/exec-php/exec-php.php on line 22

    What do I do?

    The page I need help with: [log in to see the link]

Viewing 6 replies - 1 through 6 (of 6 total)
  • Moderator t-p

    (@t-p)

    Your exec-php plugin seems to be the error.

    Access your server via SFTP or FTP, or a file manager in your hosting account’s control panel (consult your hosting provider’s documentation for specifics on these), navigate to /wp-content/plugins/ and delete or rename exec-php plugin.

    Thread Starter wperic

    (@wperic)

    That got me in, but now it looks like I need something to replace exec-php plugin to get my php code to work on the site.

    It looks like ezphp is the only option?

    Thanks.

    Moderator t-p

    (@t-p)

    Plugin search: https://wordpress.org/plugins/

    Or, ask at that plugin’s dedicated forum via its page in the Plugin Repository so the plugin’s developers and support community can help you with this.

    Could you copy line 22 of that file (/wp-content/plugins/exec-php/exec-php.php) here so I can have a look.

    Thread Starter wperic

    (@wperic)

    Lines aren’t numbered. I assume the key line is the last one, but here’s the whole plugin code. Thanks.

    <?php
    /*
    Plugin Name: Exec-PHP
    Plugin URI: http://bluesome.net/post/2005/08/18/50/
    Description: Executes <?php ?> code in your posts, pages and text widgets.
    Author: S&ouml;ren Weber
    Author URI: http://bluesome.net
    Version: 4.9
    */
    
    require_once(dirname(__FILE__).'/includes/manager.php');
    
    // ----------------------------------------------------------------------------
    // main
    // ----------------------------------------------------------------------------
    
    global $g_execphp_manager;
    if (!isset($g_execphp_manager))
    	// strange assignment because of explaination how references work;
    	// this will generate warnings with error_reporting(E_STRICT) using PHP5;
    	// http://www.php.net/manual/en/language.references.whatdo.php
    	$GLOBALS['g_execphp_manager'] =& new ExecPhp_Manager();
    
    ?>

    I had a similar issue with another plugin and this article explains the reason and has a fix:
    http://codecaveme.de/blog/en/php-7-and-wordpress-how-to-fix-unexpected-new-t_new-error/

    Try removing & from $GLOBALS['g_execphp_manager'] =& new ExecPhp_Manager();

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Error Message with new version of PHP’ is closed to new replies.