Support » Fixing WordPress » Nginx FastCGI php-fpm mysql Database Error

  • Resolved chad480

    (@chad480)


    This is a fresh install of WordPress with Zero plugins and TwentySeventeen. I’m getting the following truncated errors in my nginx error log.

    2016/12/19 22:41:00 [error] 3138#0: *258 FastCGI sent in stderr: “PHP message: WordPress database error Table ‘fileninja_cloud.fn_options’ doesn’t exist for query INSERT INTO fn_options (option_name, option_value, autoload) VALUES (‘nonce_key’, ‘k-8S7oUQ8/N->0S$

    PHP message: WordPress database error Table ‘fileninja_cloud.fn_options’ doesn’t exist for query INSERT INTO fn_options (option_name, option_value, autoload) VALUES (‘nonce_salt’, ‘f5{{*TedwH-_$6XerpUz4KL5,N ;n{@7eB#IJvu9>0aFro#sDyHMr^p!F?/^eCw)’, ‘no’) ON DUPL$

    I’m using an ‘fn_’ not ‘wp_’ prefix. I verified that the auto-generated WordPress tables are all prefixed with ‘fn_’ as desired.

    I then ran the following mysql query, and received the output below. NOTE: I’ve shortened the option_values.

    mysql> SELECT * FROM fileninja_cloud.fn_options WHEREoption_name` = “nonce_salt”;
    +———–+————-+—————————+———-+
    | option_id | option_name | option_value | autoload |
    +———–+————-+—————- ———-+———-+
    | 106 | nonce_salt | #Q=nYMl94h%-7/[ | no |
    +———–+————-+—————————+———-+
    1 row in set (0.00 sec)

    mysql> SELECT * FROM fileninja_cloud.fn_options WHERE option_name = “nonce_key”;
    +———–+————-+—————————+———-+
    | option_id | option_name | option_value | autoload |
    +———–+————-+—————————+———-+
    | 105 | nonce_key | r!6[8ojIjZJuPQ_2 | no |
    +———–+————-+—————————+———-+
    1 row in set (0.00 sec)`

    My FastCGI nginx settings

    # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
    location ~ \.php$ {
        try_files $uri =404;
        fastcgi_pass   127.0.0.1:9000;
        fastcgi_index  index.php;
        fastcgi_param  SCRIPT_FILENAME  /scripts$fastcgi_script_name;
        fastcgi_param  SCRIPT_NAME      $fastcgi_script_name;
        include        fastcgi_params;
    }

    The pages seem to display correctly. Though I do see a notice that the site has an “Unprotected Connection”. I’ve setup a brand new security certificate, but the browser doesn’t trust the certificate for some reason. The server is sitting behind an elastic load balancer on amazon ec2.

    You can see the site here: https://bedrocktools.com/

    I do not know if the site certificate issue is related in any way to the FastCGI error on nginx.

    Any suggestions are appreciated.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The solution the “Unprotected Connection” is to add this to functions.php so that PHP / WordPress knows that HTTPS should be ON.

    if(isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https') {
        $_SERVER['HTTPS']='on';
    }

    However, when I try to login to the WordPress Admin for the site with the same username and password as before I get “Sorry, you are not allowed to access this page.”

    • This reply was modified 2 years, 4 months ago by  chad480.
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Nginx FastCGI php-fpm mysql Database Error’ is closed to new replies.