• Resolved Jeremy Malcolm

    (@jeremy-malcolm)


    I have made a staging site but when I try to load it, I get a 500 error in my browser and in the nginx logs I see this:

    2018/07/25 22:19:55 [error] 13013#13013: *242956 FastCGI sent in stderr: "PHP message: PHP Parse error: syntax error, unexpected ';', expecting ',' or ')' in /usr/share/wordpress/prostasia-staging/wp-config.php on line 52" while reading response header from upstream, client: 172.69.22.88, server: prost.asia, request: "GET /prostasia-staging/ HTTP/1.1", upstream: "fastcgi://unix:/var/run/php/php7.2-fpm.sock:", host: "prost.asia"

    Line 52 of the wp-config.php file is this:

    if (!isset($table_prefix = 'wpstg0_';//)) {
        $table_prefix = 'wpstg0_';// = 'wp_';
    }
Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter Jeremy Malcolm

    (@jeremy-malcolm)

    Also these are the last lines I saw in the console when creating the staging site:

    [INFO]-[2018/07/25 19:16:29] Preparing Data Step7: Updating wpstg_rmpermalinks_executed in wpstg0_options 
    [WARNING]-[2018/07/25 19:16:29] Failed to update wpstg_rmpermalinks_executed in wpstg0_options 
    [INFO]-[2018/07/25 19:16:29] Preparing Data Step8: Updating permalink_structure in wpstg0_options 
    [INFO]-[2018/07/25 19:16:29] Preparing Data Step8: Finished Step 8 successfully
    [INFO]-[2018/07/25 19:16:29] Preparing Data Step9: Set staging site to noindex
    [INFO]-[2018/07/25 19:16:29] Preparing Data Step9: Finished Step 9 successfully
    [INFO]-[2018/07/25 19:16:29] Preparing Data Step10: Updating WP_HOME in wp-config.php to https://prost.asia/prostasia-staging
    [INFO]-[2018/07/25 19:16:29] Preparing Data Step10: WP_HOME not defined in wp-config.php. Skipping this step.
    [INFO]-[2018/07/25 19:16:29] Preparing Data: Finished Step 11 successfully
    [INFO]-[2018/07/25 19:16:29] Preparing Data Step11: Updating WP_SITEURL in wp-config.php to https://prost.asia/prostasia-staging
    [INFO]-[2018/07/25 19:16:29] Preparing Data Step11: WP_SITEURL not defined in wp-config.php. Skipping this step.
    [INFO]-[2018/07/25 19:16:29] Preparing Data: Finished Step 11 successfully
    [INFO]-[2018/07/25 19:16:29] Preparing Data Step12: Updating db prefix in wpstg0_options. Error: 
    [INFO]-[2018/07/25 19:16:29] Updating db option_names in wpstg0_options. Error: 
    [INFO]-[2018/07/25 19:16:33] Finish: Deleting clone job's cache files...
    [INFO]-[2018/07/25 19:16:33] Finish: Clone job's cache files have been deleted!
    [INFO]-[2018/07/25 19:16:33] Finish: Verifying existing clones...
    [INFO]-[2018/07/25 19:16:33] Finish: Prostasia Staging's clone job's data is not in database, generating data
    [INFO]-[2018/07/25 19:16:33] Finish: Deleting clone job's cache files...
    [INFO]-[2018/07/25 19:16:33] Finish: Clone job's cache files have been deleted!
    [INFO]-[2018/07/25 19:16:33] Finish: Verifying existing clones...
    [INFO]-[2018/07/25 19:16:33] Finish: Prostasia Staging's clone job's data is not in database, generating data
    Plugin Author Rene Hermenau

    (@renehermi)

    @jeremy-malcolm

    Change Line 52 of the wp-config.php file to this:

    if (!isset($table_prefix = ‘wpstg0_’)) {
    $table_prefix = ‘wpstg0_’;// = ‘wp_’;
    }

    Then it’s working.

    What is the reason for that code?
    That code makes not much sense there. The line should only be:

    $table_prefix = 'wpstg0_';

    In live site:

    $table_prefix = 'wp_';

    That’s default WordPress and should not be changed!

    Thread Starter Jeremy Malcolm

    (@jeremy-malcolm)

    I don’t know what the reason for that code is, because I didn’t write it… I assumed it was from this plugin. But if not, then it must be code from the stock Debian version of WordPress, which is what I’m using. Anyway, by commenting out the “if isset” test, it works now. Thanks.

    Plugin Author Rene Hermenau

    (@renehermi)

    Thanks for the feedback Jeremy. I am glad that its working now

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘PHP parse error’ is closed to new replies.