Want to subscribe to topics you're interested in?
Become a Member

Wordpress Can't create user

Discussion in 'Blogs & CMS usage' started by Jon Snow, Jul 4, 2017.

  1. Jon Snow

    Jon Snow Active Member

    155
    25
    28
    Jun 30, 2017
    Ratings:
    +30
    Local Time:
    4:22 AM
    Nginx 1.13.4
    MariaDB 10.1.26
    I migrated a wordpress site over to a server I set up with centminmod. The wordpress site works fine but when I try to add a new user, it results in a blank under the username list.

    See screenshot below :

    [​IMG]

    Tried creating three accounts but they're not added. I can't even delete the no-name account. When I edit it, it goes to my first account (my admin account).

    What can I do to make this work again? Thanks!
     
  2. eva2000

    eva2000 Administrator Staff Member

    30,161
    6,785
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,136
    Local Time:
    5:22 PM
    Nginx 1.13.x
    MariaDB 5.5
    maybe sure file permissions for migrated files and directories are correct see FAQ item 2 Getting Started Guide - CentminMod.com LEMP Nginx web stack for CentOS

     
  3. Jon Snow

    Jon Snow Active Member

    155
    25
    28
    Jun 30, 2017
    Ratings:
    +30
    Local Time:
    4:22 AM
    Nginx 1.13.4
    MariaDB 10.1.26
    What file permissions should be used? The three main folders are currently set to 740.
     
  4. eva2000

    eva2000 Administrator Staff Member

    30,161
    6,785
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,136
    Local Time:
    5:22 PM
    Nginx 1.13.x
    MariaDB 5.5
    normal for those main directories, under /public should be 755 for directories and 644 for files
    Code (Text):
    ls -lah /home/nginx/domains/newdomain.com/public
    total 36K
    drwxr-sr-x 2 nginx nginx  151 Aug 11 05:24 .
    drwxr-sr-x 6 nginx nginx   56 Aug 11 05:24 ..
    -rw-r--r-- 1 nginx nginx 1.6K Aug 11 05:24 403.html
    -rw-r--r-- 1 nginx nginx 1.6K Aug 11 05:24 404.html
    -rw-r--r-- 1 nginx nginx 2.1K Aug 11 05:24 500.html
    -rw-r--r-- 1 nginx nginx 2.1K Aug 11 05:24 502.html
    -rw-r--r-- 1 nginx nginx 2.2K Aug 11 05:24 503.html
    -rw-r--r-- 1 nginx nginx 2.1K Aug 11 05:24 504.html
    -rw-r--r-- 1 nginx nginx 2.2K Aug 11 05:24 50x.html
    -rw-r--r-- 1 nginx nginx 1.2K Aug 11 05:24 index.html
    -rw-r--r-- 1 nginx nginx 2.2K Aug 11 05:24 maintenance.html
    
     
  5. eva2000

    eva2000 Administrator Staff Member

    30,161
    6,785
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,136
    Local Time:
    5:22 PM
    Nginx 1.13.x
    MariaDB 5.5
    Also to troubleshoot Nginx and PHP-FPM issues you'd want to check the domain site's vhost access.log and error.log logs located within directory at /home/nginx/domains/yourdomain.com/logs. You can see a full overview at centminmod.com/configfiles.html

    FAQ item 19 has more info on all Centmin Mod relevant log files locations and how to use tail command to view a sample of the entries.

    Also post the contents of your site's nginx vhost http /usr/local/nginx/conf/conf.d/yourdomain.com.conf and/or /usr/local/nginx/conf/conf.d/yourdomain.com.ssl.conf in BBCODE CODE tags as outlined at How to use forum BBCODE code tags | Centmin Mod Community
     
  6. Jon Snow

    Jon Snow Active Member

    155
    25
    28
    Jun 30, 2017
    Ratings:
    +30
    Local Time:
    4:22 AM
    Nginx 1.13.4
    MariaDB 10.1.26
    Files are 640. Wordpress really only has three directories. The rest are just image folders I use to upload via FTP.
    • wp-content
    • wp-admin
    • wp-includes
    Nothing in the error log. The access log doesn't have anything matching wp-admin. It's a lot to go through too because it's a live site and it's getting a lot of page refreshes.

    Could I PM you the vhost contents?
     
  7. eva2000

    eva2000 Administrator Staff Member

    30,161
    6,785
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,136
    Local Time:
    5:22 PM
    Nginx 1.13.x
    MariaDB 5.5
    just replace actual domain name - references in vhost with domain.com via search and replace in text editor before posting :)
     
  8. Jon Snow

    Jon Snow Active Member

    155
    25
    28
    Jun 30, 2017
    Ratings:
    +30
    Local Time:
    4:22 AM
    Nginx 1.13.4
    MariaDB 10.1.26
    Sent in a PM (explained too).

    If it helps, I also got a notification email about the new user :

    No username or email address was mentioned in the email. I also thought centminmod doesn't set up a mail server so I was surprised that Wordpress actually sent an email.

    The email was the hostname of the site (not a regular email address I created).
     
  9. eva2000

    eva2000 Administrator Staff Member

    30,161
    6,785
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,136
    Local Time:
    5:22 PM
    Nginx 1.13.x
    MariaDB 5.5
    For you nginx vhosts for your domain.

    For xenforo check out Nginx Rewrites for Xenforo Friendly Urls - CentminMod.com LEMP Nginx web stack for CentOS

    For Wordpress & xenforo check out the vhost generator at Generate Centmin Mod Nginx Vhost - CentminMod.com LEMP Nginx web stack for CentOS to get an idea of what separately each web app's vhost should look like and you have some differences compared to what they should be.

    You didn't mention if wordpress and xenforo are HTTPS default sites or not ?

    FYI, notice you do not need a .php location context as include file in each nginx vhost takes care of that
    Code (Text):
    include /usr/local/nginx/conf/php.conf;
    


    so your domain.com.ssl.conf vhost might be along the lines of below for starters
    Code (Text):
    # Centmin Mod Getting Started Guide
    # must read http://centminmod.com/getstarted.html
    # For HTTP/2 SSL Setup
    # read http://centminmod.com/nginx_configure_https_ssl_spdy.html
    
    # redirect from www to non-www  forced SSL
    # uncomment, save file and restart Nginx to enable
    # if unsure use return 302 before using return 301
    # server {
    #   server_name domain.com www.domain.com;
    #   return 302 https://$server_name$request_uri;
    # }
    
    server {
      listen 443 ssl http2;
      server_name domain.com www.domain.com;
    
      ssl_dhparam /usr/local/nginx/conf/ssl/domain.com/dhparam.pem;
      ssl_certificate      /usr/local/nginx/conf/ssl/domain.com/domain_com.crt;
      ssl_certificate_key  /usr/local/nginx/conf/ssl/domain.com/domain.key;
      include /usr/local/nginx/conf/ssl_include.conf;
    
      http2_max_field_size 16k;
      http2_max_header_size 32k;
      # mozilla recommended
      ssl_ciphers EECDH+CHACHA20:EECDH+CHACHA20-draft:EECDH+ECDSA+AESGCM:EECDH+aRSA+AESGCM:EECDH+ECDSA+SHA256:EECDH+ECDSA+SHA384:EECDH+aRSA+SHA256:EECDH+aRSA+SHA384:EECDH+AES128:!aNULL:!eNULL:!LOW:!3DES:!MD5:!EXP:!PSK:!SRP:!DSS:!RC4:!EDH-DSS-DES-CBC3-SHA:!EDH-RSA-DES-CBC3-SHA:!KRB5-DES-CBC3-SHA:!CAMELLIA;
      ssl_prefer_server_ciphers   on;
      #add_header Alternate-Protocol  443:npn-spdy/3;
    
      # before enabling HSTS line below read centminmod.com/nginx_domain_dns_setup.html#hsts
      #add_header Strict-Transport-Security "max-age=31536000; includeSubdomains;";
      #add_header X-Frame-Options SAMEORIGIN;
      #add_header X-Xss-Protection "1; mode=block" always;
      #add_header X-Content-Type-Options "nosniff" always;
      #spdy_headers_comp 5;
      ssl_buffer_size 1369;
      ssl_session_tickets on;
    
      # enable ocsp stapling
      resolver 8.8.8.8 8.8.4.4 valid=10m;
      resolver_timeout 10s;
      ssl_stapling on;
      ssl_stapling_verify on;
      ssl_trusted_certificate /usr/local/nginx/conf/ssl/domain.com/ssl-trusted.crt;
    
    # ngx_pagespeed & ngx_pagespeed handler
    #include /usr/local/nginx/conf/pagespeed.conf;
    #include /usr/local/nginx/conf/pagespeedhandler.conf;
    #include /usr/local/nginx/conf/pagespeedstatslog.conf;
    
      # limit_conn limit_per_ip 16;
      # ssi  on;
    
      access_log /home/nginx/domains/domain.com/log/access.log combined buffer=256k flush=5m;
      error_log /home/nginx/domains/domain.com/log/error.log;
    
      include /usr/local/nginx/conf/autoprotect/domain.com/autoprotect-domain.com.conf;
      root /home/nginx/domains/domain.com/public;
      # uncomment cloudflare.conf include if using cloudflare for
      # server and/or vhost site
      #include /usr/local/nginx/conf/cloudflare.conf;
      include /usr/local/nginx/conf/503include-main.conf;
    
      location / {
        include /usr/local/nginx/conf/503include-only.conf;
        rewrite ^/(threads|forums|members|blog)/(.*)$ /forum/$1/$2 redirect;
      
        # Wordpress Permalinks
        try_files $uri $uri/ /index.php?q=$request_uri;
    
        include /usr/local/nginx/conf/wpsecure.conf;
        include /usr/local/nginx/conf/wpnocache.conf;
      }
    
      location /forum/ {
        index index.php index.html;
        try_files $uri $uri/ /forum/index.php?$uri&$args;
     
      }
      location /forum/install/ {
          include /usr/local/nginx/conf/php.conf;
          internal;
      }
      location /forum/internal_data/ {
          internal;
      }
      location /forum/library/ {
          internal;
      }
    
      include /usr/local/nginx/conf/staticfiles.conf;
      include /usr/local/nginx/conf/php.conf;
      include /usr/local/nginx/conf/drop.conf;
      #include /usr/local/nginx/conf/errorpage.conf;
      include /usr/local/nginx/conf/vts_server.conf;
    }
    
     
  10. Jon Snow

    Jon Snow Active Member

    155
    25
    28
    Jun 30, 2017
    Ratings:
    +30
    Local Time:
    4:22 AM
    Nginx 1.13.4
    MariaDB 10.1.26
    Yeah. They're https. Wordpress is domain.com and xenForo is domain.com/forum/
     
  11. eva2000

    eva2000 Administrator Staff Member

    30,161
    6,785
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,136
    Local Time:
    5:22 PM
    Nginx 1.13.x
    MariaDB 5.5
    then focus on getting domain.com.ssl.conf working first
     
  12. Jon Snow

    Jon Snow Active Member

    155
    25
    28
    Jun 30, 2017
    Ratings:
    +30
    Local Time:
    4:22 AM
    Nginx 1.13.4
    MariaDB 10.1.26
    The SSL config you posted looks extremely similar to mine. Some lines are just not in the same structure and the extra security contents for xenForo from the generator isn't there.
     
  13. eva2000

    eva2000 Administrator Staff Member

    30,161
    6,785
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,136
    Local Time:
    5:22 PM
    Nginx 1.13.x
    MariaDB 5.5
    yes extra deny/allow isn't needed for internal directives start with my suggested vhost first
     
  14. eva2000

    eva2000 Administrator Staff Member

    30,161
    6,785
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,136
    Local Time:
    5:22 PM
    Nginx 1.13.x
    MariaDB 5.5
    Was your original wordpress install http or https based ? If it was http based and you now enable https on centminmod, the wordpress based install is still http not https.

    If all else is working now just user edit/add blank, then something else is causing it

    Try disabling all WP plugins + restart nginx and php-fpm to clear caching and try adding user to see if that works. Troubleshoot WP plugins first.

    Also the logs mentioned at Wordpress - Can't create user as sometimes you could be caught in tools/autoprotect.sh cronjob feature outlined at Beta Branch - autoprotect.sh - apache .htaccess check & migration to nginx deny all | Centmin Mod Community. You can quickly confirm if it's the case by commenting out the include line
    Code (Text):
    include /usr/local/nginx/conf/autoprotect/domain.com/autoprotect-domain.com.conf;
    

    You uploaded scripts may have .htaccess deny from all type files in their directories which may need bypassing autoprotect. It's a security feature that no other nginx based stack has as far as I know :)

    So instead, all .htaccess 'deny from all' detected directories now get auto generated Nginx equivalent location match and deny all setups except if you want to manually bypass the directory from auto protection via a .autoprotect-bypass file - details below here.

    You can read a few threads below on how autoprotect.sh may have caught some folks web apps falsely and the workarounds or improvements made to autoprotect.sh with the help of users feedback and troubleshooting.
     
  15. Jon Snow

    Jon Snow Active Member

    155
    25
    28
    Jun 30, 2017
    Ratings:
    +30
    Local Time:
    4:22 AM
    Nginx 1.13.4
    MariaDB 10.1.26
    #1. https -> https.

    #2. Disabled all plugins and used nprestart. Tried adding a user but nothing. It just says the user has been added but when looking through the list of users, it really hasn't been added and the blank profile still exists.

    #3. Deleting the line didn't work but I do have my htaccess files with deny in the folders that were carried over.

    I think #3 might be causing this. Should I delete those htaccess files? When I was setting up my wordpress install, something asked me or suggested something about htaccess, deny and using nginx's magic to replace htaccess.
     
  16. eva2000

    eva2000 Administrator Staff Member

    30,161
    6,785
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,136
    Local Time:
    5:22 PM
    Nginx 1.13.x
    MariaDB 5.5
    if it's #3, don't delete .htaccess files as they come back when you update your scripts/upload new sets of files so instead setup bypass files in those directories Beta Branch - autoprotect.sh - apache .htaccess check & migration to nginx deny all or just comment out with hash # in front of the line
    Code (Text):
    #include /usr/local/nginx/conf/autoprotect/domain.com/autoprotect-domain.com.conf;
    

    then restart nginx+php-fpm
    Code (Text):
    nprestart
    
     
  17. Jon Snow

    Jon Snow Active Member

    155
    25
    28
    Jun 30, 2017
    Ratings:
    +30
    Local Time:
    4:22 AM
    Nginx 1.13.4
    MariaDB 10.1.26
    This didn't work :/ (I edited both the non-SSL and the SSL files then restarted nginx+php-fpm). Should I try the instructions from the link instead or is that just an alternative with the same result?
     
  18. eva2000

    eva2000 Administrator Staff Member

    30,161
    6,785
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,136
    Local Time:
    5:22 PM
    Nginx 1.13.x
    MariaDB 5.5
  19. Jon Snow

    Jon Snow Active Member

    155
    25
    28
    Jun 30, 2017
    Ratings:
    +30
    Local Time:
    4:22 AM
    Nginx 1.13.4
    MariaDB 10.1.26
    @eva2000 Posted a message up there but no reply yet :greyalien:

    I did some more digging and I actually found something. It seems something was actually recorded in the error log :
    Code:
    2017/07/04 04:01:41 [error] 20036#20036: *13653 FastCGI sent in stderr: "PHP message: WordPress database error Duplicate entry '0' for key 'PRIMARY' for query INSERT INTO `wp_users` (`user_pass`, `user_email`, `user_url`, `user_nicename`, `display_name`, `user_registered`, `user_login`) VALUES ('password_characters_here', 'test@test.com', '', 'test', 'Test', '2017-07-04 04:01:41', 'Test') made by edit_user, wp_insert_user
    PHP message: PHP Warning:  in_array() expects parameter 2 to be array, null given in /home/nginx/domains/domain.com/public/wp-content/plugins/wordpress-seo/inc/sitemaps/class-sitemaps-cache.php on line 201" while reading response header from upstream, client: an.ip.was.here, server: domain.com, request: "POST /wp-admin/user-new.php HTTP/2.0", upstream: "fastcgi://127.0.0.1:9000", host: "domain.com", referrer: "https://domain.com/wp-admin/user-new.php"
    Wordpress SEO is Yoast SEO and disabling it doesn't help.
     
  20. eva2000

    eva2000 Administrator Staff Member

    30,161
    6,785
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,136
    Local Time:
    5:22 PM
    Nginx 1.13.x
    MariaDB 5.5
    problem is with the wordpress database itself it seems do you still have original wordpress backup .sql file you created from old server ? do you have access to old server still ? if you have access to old server, might want to make a new sql backup and try that

    https://spigotdesign.com/wordpress-log-redirect-loop/