Wordpress php help

I have my companys site (wordpress) from the original dev that I’m trying to host on site with a raspberry pi. I’m not a web guy, or code guy for that matter. I’ve got everything set up correctly as far as I can tell but im getting a php error.

ParseError thrown
syntax error, unexpected ‘new’ (T_NEW)

From googling it looks like a syntax issue with php7 but I cant find the script thats causing it. The error doesnt specify anything else. Can someone point me in a direction to look?

1 Like

Placing this in the index file, should allow you to see what specific errors are being thrown.

ini_set('display_errors', '1');

I found this.

And are you using php 5.6 or php 7?

1 Like

7, also added that line but page displays the same. Am I doing this wrong?

I just realized I can run the php from terminal to get the error output. Did I mention I’m not a code guy? lel

so the output is now

.PHP Deprecated: Non-static method NextGEN_Gallery_Pro::load_product() should not be called statically in /var/www/html/wp-includes/class-wp-hook.php on line 286
PHP Notice: ob_end_clean(): failed to delete buffer. No buffer to delete in /var/www/html/wp-content/plugins/nextgen-gallery/nggallery.php on line 104

ParseError thrown

syntax error, unexpected 'new' (T_NEW)

1 Like

From the start of the line 104

            $status = session_status();
            if (in_array($status, array(PHP_SESSION_DISABLED, PHP_SESSION_NONE), TRUE))
                session_write_close();
            fastcgi_finish_request();
        }
        else {
            throw new E_Clean_Exit;
        }
    }
            elseif (!($exception instanceof E_Clean_Exit)) {
                    ob_end_clean();
                    self::print_exception($exception);
            }
    }

I dont know enough to identify the issue. This appears to just be a plugin issue though so maybe renaming the dir will at least get it running?

Well, all that did is break the web server.

1 Like

@Dynamic_Gravity Thanks for pointing me in the right direction. It was a bad plugin and it looks like I need to update wordpress anyway but im at least able to get into the admin now!

2 Likes

Looks like it’s an error in the way it’s trying to report an error (at least for php7). When your error reporting is causing errors… good times~ /s

I was able to get the site mostly working. I am still having issues with pages not working but the php seems to be ok now. I just have to work through the little problems as they come via google but im at least getting somewhere now.

1 Like

Glad you somewhat got it!

Seems like a plugin which would only work with PHP 5.6.

If you downgrade your version of php in use that might resolve it.