Learn about Centmin Mod LEMP Stack today
Register Now

Wordpress wordpress pages showing php code instead of content.

Discussion in 'Blogs & CMS usage' started by harryneopotter, Jan 29, 2016.

Tags:
  1. harryneopotter

    harryneopotter Member

    70
    3
    8
    Aug 16, 2015
    Ratings:
    +8
    Local Time:
    7:16 AM
    Nginx 1.9.3
    MariaDB 10.0
  2. harryneopotter

    harryneopotter Member

    70
    3
    8
    Aug 16, 2015
    Ratings:
    +8
    Local Time:
    7:16 AM
    Nginx 1.9.3
    MariaDB 10.0
    Did that too, a few times.
     
  3. eva2000

    eva2000 Administrator Staff Member

    55,903
    12,281
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,868
    Local Time:
    11:46 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    also post output for command
    Code:
    ls -lAhrt /root/centminlogs/
     
  4. eva2000

    eva2000 Administrator Staff Member

    55,903
    12,281
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,868
    Local Time:
    11:46 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    you can use pastebin.com for it too
     
  5. harryneopotter

    harryneopotter Member

    70
    3
    8
    Aug 16, 2015
    Ratings:
    +8
    Local Time:
    7:16 AM
    Nginx 1.9.3
    MariaDB 10.0
    nginx log :

    Code:
    2016/01/27 00:47:00 [error] 25222#25222: *200590 "/usr/local/nginx/html/administrator/index.php" is not found (2: No such file or directory), client: 208.52.154.240, server: xxx.xxx.com, request: "GET /administrator/ HTTP/1.0"
    2016/01/29 02:23:40 [error] 25222#25222: *220706 open() "/usr/local/nginx/html/manager/html" failed (2: No such file or directory), client: 61.160.247.34, server: xxx.xxx.com, request: "GET /manager/html HTTP/1.1", host: "xx.xx.xx.xx:80"
    2016/01/29 03:15:28 [error] 25222#25222: *220961 open() "/usr/local/nginx/html/img/baidu_jgylogo1.gif" failed (2: No such file or directory), client: 45.58.54.243, server: xxx.xxx.com, request: "GET http://www.baidu.com/img/baidu_jgylogo1.gif HTTP/1.1", host: "www.baidu.com"
    2016/01/29 03:58:27 [error] 25222#25222: *221272 open() "/usr/local/nginx/html/server-status" failed (2: No such file or directory), client: 173.199.171.248, server: xxx.xxx.com, request: "HEAD /server-status HTTP/1.1", host: "xx.xx.xx.xx"
    no entries for today in php-fpm log file.

    Will post the output as soon as php upgrade completes.
     
  6. eva2000

    eva2000 Administrator Staff Member

    55,903
    12,281
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,868
    Local Time:
    11:46 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    and from /home/nginx/domains/yourdomain.com/logs/* ?
     
  7. harryneopotter

    harryneopotter Member

    70
    3
    8
    Aug 16, 2015
    Ratings:
    +8
    Local Time:
    7:16 AM
    Nginx 1.9.3
    MariaDB 10.0
  8. eva2000

    eva2000 Administrator Staff Member

    55,903
    12,281
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,868
    Local Time:
    11:46 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
  9. eva2000

    eva2000 Administrator Staff Member

    55,903
    12,281
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,868
    Local Time:
    11:46 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
     
  10. harryneopotter

    harryneopotter Member

    70
    3
    8
    Aug 16, 2015
    Ratings:
    +8
    Local Time:
    7:16 AM
    Nginx 1.9.3
    MariaDB 10.0

    yes. all invalid files.
     
  11. harryneopotter

    harryneopotter Member

    70
    3
    8
    Aug 16, 2015
    Ratings:
    +8
    Local Time:
    7:16 AM
    Nginx 1.9.3
    MariaDB 10.0

    here it is :

    Code:
    total 8.6M
    -rw-r--r-- 1 root root 9.8K Dec 29 09:30 centminmod_1.2.3-eva2000.08_291215-043007_yuminstall_centos6.log
    -rw-r--r-- 1 root root  55K Dec 29 09:31 centminmod_yumtimes_291215-043007.log
    -rw-r--r-- 1 root root   37 Dec 29 09:31 centminmod_profiletimes_291215-043007.log
    -rw-r--r-- 1 root root 236K Dec 29 09:31 centminmod_downloadtimes_291215-043007.log
    -rw-r--r-- 1 root root  199 Dec 29 09:31 securedtmp.log
    -rw-r--r-- 1 root root   45 Dec 29 09:34 centminmod_libresslinstalltime_291215-043007.log
    -rw-r--r-- 1 root root 1.3K Dec 29 09:35 gcc_native.log
    -rw-r--r-- 1 root root 952K Dec 29 09:38 centminmod_ngxinstalltime_291215-043007.log
    -rw-r--r-- 1 root root   58 Dec 29 09:45 centminmod_phpinstalltime_291215-043007.log
    -rw-r--r-- 1 root root  26K Dec 29 09:49 centminmod_1.2.3-eva2000.08_291215-043007_yum-log.log
    -rw-r--r-- 1 root root   20 Dec 29 09:49 install.utc.time.log
    -rw-r--r-- 1 root root 2.7M Dec 29 09:49 centminmod_1.2.3-eva2000.08_291215-043007_install.log
    -rw-r--r-- 1 root root   49 Dec 29 09:49 firstyum_installtime_291215-042755.log
    -rw-r--r-- 1 root root 1.2K Dec 30 09:35 centminmod_wpcli_install_301215-093526.log
    -rw-r--r-- 1 root root  38K Dec 30 09:39 centminmod_1.2.3-eva2000.08_301215-093437_wordpress_addvhost.log
    -rw-r--r-- 1 root root 2.1K Jan  6 18:20 centminmod_1.2.3-eva2000.08_060116-181821_yuminstall_centos6.log
    -rw-r--r-- 1 root root  33K Jan  6 18:20 centminmod_yumtimes_060116-181821.log
    -rw-r--r-- 1 root root   37 Jan  6 18:20 centminmod_profiletimes_060116-181821.log
    -rw-r--r-- 1 root root 2.4M Jan  6 18:37 centminmod_1.2.3-eva2000.08_060116-181821_php_upgrade.log
    -rw-r--r-- 1 root root  189 Jan  8 11:41 centminmod_1.2.3-eva2000.08_080116-114107_apc_reinstall.log
    -rw-r--r-- 1 root root  52K Jan  8 11:41 centminmod_1.2.3-eva2000.08_080116-114107_apc_install.log
    -rw-r--r-- 1 root root  866 Jan 18 07:14 centminmod_wpcli_update_180116-071426.log
    -rw-r--r-- 1 root root  36K Jan 18 07:21 centminmod_1.2.3-eva2000.08_180116-071419_wordpress_addvhost.log
    -rw-r--r-- 1 root root  110 Jan 29 13:51 centminmod_1.2.3-eva2000.08_290116-134448_apc_reinstall.log
    -rw-r--r-- 1 root root  379 Jan 29 13:51 zendopcache_passfile.txt
    -rw-r--r-- 1 root root  11K Jan 29 13:51 centminmod_1.2.3-eva2000.08_290116-134448_zendopcache_install_submenu.log
    -rw-r--r-- 1 root root 1.8K Jan 29 13:58 centminmod_1.2.3-eva2000.08_290116-135802_git_envsetup.log
    -rw-r--r-- 1 root root  247 Jan 29 13:59 centminmod_1.2.3-eva2000.08_290116-135802_git_updatecur_branch.log
    -rw-r--r-- 1 root root  331 Jan 29 14:01 centminmod_1.2.3-eva2000.08_290116-135802_git_updatenew_branch.log
    -rw-r--r-- 1 root root 3.6K Jan 29 14:05 centminmod_1.2.3-eva2000.08_290116-140417_git_updatenew_branch.log
    -rw-r--r-- 1 root root 1.8K Jan 29 14:08 centminmod_1.2.3-eva2000.08_290116-140757_git_envsetup.log
    -rw-r--r-- 1 root root  247 Jan 29 14:09 centminmod_1.2.3-eva2000.08_290116-140757_git_updatecur_branch.log
    -rw-r--r-- 1 root root  469 Jan 29 14:10 centminmod_1.2.3-eva2000.08_290116-140757_git_updatenew_branch.log
    -rw-r--r-- 1 root root  247 Jan 29 14:12 centminmod_1.2.3-eva2000.08_290116-141205_git_updatecur_branch.log
    -rw-r--r-- 1 root root 1.8K Jan 29 14:13 centminmod_1.2.3-eva2000.08_290116-141205_git_envsetup.log
    -rw-r--r-- 1 root root 2.1K Jan 29 14:16 centminmod_1.2.3-eva2000.08_290116-141205_yuminstall_centos6.log
    -rw-r--r-- 1 root root  41K Jan 29 14:16 centminmod_yumtimes_290116-141205.log
    -rw-r--r-- 1 root root   38 Jan 29 14:16 centminmod_profiletimes_290116-141205.log
    -rw-r--r-- 1 root root 2.0M Jan 29 14:35 centminmod_1.2.3-eva2000.08_290116-141205_php_upgrade.log
    
     
  12. eva2000

    eva2000 Administrator Staff Member

    55,903
    12,281
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,868
    Local Time:
    11:46 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    when specifically did the php code start showing up ? see if it matches with any timestamps of those listed logs

    php upgraded ?
     
  13. harryneopotter

    harryneopotter Member

    70
    3
    8
    Aug 16, 2015
    Ratings:
    +8
    Local Time:
    7:16 AM
    Nginx 1.9.3
    MariaDB 10.0
    Yup..upgraded...

    It happened sometime in the last 8-10 hours (not sure the exact time, last checked was 10 hours back, was working fine.).
     
  14. eva2000

    eva2000 Administrator Staff Member

    55,903
    12,281
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,868
    Local Time:
    11:46 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    and php upgrade didn't help ?

    it's really is strange as it's virtually impossible if the configuration remained the same, to suddenly stop parsing php code and serve php code just for wordpress frontend but not backend.
     
  15. harryneopotter

    harryneopotter Member

    70
    3
    8
    Aug 16, 2015
    Ratings:
    +8
    Local Time:
    7:16 AM
    Nginx 1.9.3
    MariaDB 10.0
    exactly...I am really baffled at this...never seen this before.
    Surprisingly, the home page is working, but none of the other pages are. Sometimes even homepage doesnt work, but refreshing a couple of times, it comes back. But the other pages never load at all. Just the code.

    Admin panel is working properly. Only I have the server access and I didnt login at all on the server today. Just logged in once yesterday, ran the TOP command..and exited. Nothing else in the past 3-4 days atleast.
     
  16. eva2000

    eva2000 Administrator Staff Member

    55,903
    12,281
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,868
    Local Time:
    11:46 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    sounds like wp super cache issue

    try disabling wp super cache and reverting to none wp super cache nginx vhost configuration

    like below
    Code:
    # Centmin Mod Getting Started Guide
    # must read http://centminmod.com/getstarted.html
    
    # redirect from non-www to www
    # uncomment, save file and restart Nginx to enable
    # if unsure use return 302 before using return 301
    #server {
    #            listen   80;
    #            server_name domain.com;
    #            return 301 $scheme://www.domain.com$request_uri;
    #       }
    
    server {
      server_name domain.com www.domain.com;
    
    # 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=60m;
      error_log /home/nginx/domains/domain.com/log/error.log;
    
      root /home/nginx/domains/domain.com/public;
    
      # prevent access to ./directories and files
    location ~ (?:^|/)\. {
       deny all;
      }
    
    #include /usr/local/nginx/conf/wpsupercache_domain.com.conf;
    
      location / {
    
      # Enables directory listings when index file not found
    #autoindex  on;
    
      # for wordpress super cache plugin
    #try_files /wp-content/cache/supercache/$http_host/$cache_uri/index.html $uri $uri/ /index.php?q=$uri&$args;
    
      # Wordpress Permalinks
    try_files $uri $uri/ /index.php?q=$uri&$args;
    
      }
    
    location ~* /(wp-login\.php) {
        limit_req zone=xwplogin burst=1 nodelay;
        #limit_conn xwpconlimit 30;
       #auth_basic "Private";
      # auth_basic_user_file /home/nginx/domains/domain.com/htpasswd_wplogin; 
       #include /usr/local/nginx/conf/php-wpsc.conf;
       include /usr/local/nginx/conf/php.conf;
    }
    
    location ~* /(xmlrpc\.php) {
        limit_req zone=xwprpc burst=45 nodelay;
        #limit_conn xwpconlimit 30;
       #include /usr/local/nginx/conf/php-wpsc.conf;
       include /usr/local/nginx/conf/php.conf;
    }
    
      include /usr/local/nginx/conf/wpsecure_domain.com.conf;
      #include /usr/local/nginx/conf/php-wpsc.conf;
      include /usr/local/nginx/conf/php.conf;
      include /usr/local/nginx/conf/staticfiles.conf;
      include /usr/local/nginx/conf/drop.conf;
      #include /usr/local/nginx/conf/errorpage.conf;
    include /usr/local/nginx/conf/vts_server.conf;
    }
    and then restart nginx and php-fpm
    Code:
    nprestart
     
  17. eva2000

    eva2000 Administrator Staff Member

    55,903
    12,281
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,868
    Local Time:
    11:46 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
  18. harryneopotter

    harryneopotter Member

    70
    3
    8
    Aug 16, 2015
    Ratings:
    +8
    Local Time:
    7:16 AM
    Nginx 1.9.3
    MariaDB 10.0
    didnt help. Even the homepage is gone now .... code..code everywhere.
     
  19. harryneopotter

    harryneopotter Member

    70
    3
    8
    Aug 16, 2015
    Ratings:
    +8
    Local Time:
    7:16 AM
    Nginx 1.9.3
    MariaDB 10.0
    If I use any maintenance plugin to show a maintenance page, that works fine without any issue.

    Can this be related to permalinks ?

    htaccess doesnt work with nginx, so where do I look for rewrite rules ?
     
  20. eva2000

    eva2000 Administrator Staff Member

    55,903
    12,281
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,868
    Local Time:
    11:46 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    could be but this is permalinks rewrite rule
    Code:
    # Wordpress Permalinks
    try_files $uri $uri/ /index.php?q=$uri&$args;