ERROR 500 - Internal Server Error with no log or details

Discussion in 'Installation/Configuration' started by minttux, May 1, 2023.

  1. minttux

    minttux Member

    Hi my server and software details:
    I created a website and move my Wordpress website from local PC on this site and I get ERROR 500 - Internal Server Error but there is no log in:
    /var/www/<mySite>/log/error.log
    /var/log/ispconfig/httpd/<mySite>/error.log
    And they are empty and it's my nginx config:
    # cat /etc/nginx/sites-available/<mySite>.vhost
    Code:
    server {
            listen <my ip>:80;
    
            server_name <mySite> www.<mySite>;
            root   /var/www/<mySite>/web/;
            disable_symlinks if_not_owner from=$document_root;
    
            index index.html index.htm index.php index.cgi index.pl index.xhtml standard_index.html;
    
            error_page 400 /error/400.html;
            error_page 401 /error/401.html;
            error_page 403 /error/403.html;
            error_page 404 /error/404.html;
            error_page 405 /error/405.html;
            error_page 500 /error/500.html;
            error_page 502 /error/502.html;
            error_page 503 /error/503.html;
            recursive_error_pages on;
            location = /error/400.html {
    
                internal;
                auth_basic off;
            }
            location = /error/401.html {
                internal;
                auth_basic off;
            }
            location = /error/403.html {
                internal;
                auth_basic off;
            }
            location = /error/404.html {
                internal;
                auth_basic off;
            }
            location = /error/405.html {
                internal;
                auth_basic off;
            }
            location = /error/500.html {
                internal;
                auth_basic off;
            }
            location = /error/502.html {
                internal;
                auth_basic off;
            }
            location = /error/503.html {
                internal;
                auth_basic off;
            }
    
            error_log /var/log/ispconfig/httpd/<mySite>/error.log;
            access_log /var/log/ispconfig/httpd/<mySite>/access.log combined;
    
            location ~ /\. {
                deny all;
            }
    
            location ^~ /.well-known/acme-challenge/ {
                access_log off;
                log_not_found off;
                auth_basic off;
                root /usr/local/ispconfig/interface/acme/;
                autoindex off;
                index index.html;
                try_files $uri $uri/ =404;
            }
    
            location = /favicon.ico {
                log_not_found off;
                access_log off;
                expires max;
                add_header Cache-Control "public, must-revalidate, proxy-revalidate";
            }
    
            location = /robots.txt {
                allow all;
                log_not_found off;
                access_log off;
            }
    
            location /stats/ {
                index index.html index.php;
                auth_basic "Members Only";
                auth_basic_user_file /var/www/clients/client1/web22/web//stats/.htpasswd_stats;
                add_header Content-Security-Policy "default-src * 'self' 'unsafe-inline' 'unsafe-eval' data:;";
            }
    
            location ^~ /awstats-icon {
                alias /usr/share/awstats/icon;
            }
    
            location ~ \.php$ {
                try_files /71e6ea739b87254716ab15733498e760.htm @php;
            }
    
            location @php {
                try_files $uri =404;
                include /etc/nginx/fastcgi_params;
                fastcgi_pass unix:/var/lib/php8.1-fpm/web22.sock;
                fastcgi_index index.php;
                fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
                fastcgi_intercept_errors on;
            }
    Also I changed PHP version same as my PC PHP 7.4.33 and phpinfo() worked on that site:
    [​IMG]
    Also I try to use ini_set("display_errors",1); in index.php also I turn on display_errors on custom php.ini settings:
    [​IMG]
    But there is no details or log and I got only this page:
    [​IMG]
    So I can't figure out what's the problem
    Any solution?
     
  2. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    Did you check the site URL stored in Wordpress database? If you just copied the files to another server that url is probably wrong. It is in two places, I do not remember what table but names are site_url and home_url.
     
  3. till

    till Super Moderator Staff Member ISPConfig Developer

    Disable custom error pages in site settings to see if a different error message gets displayed. There must be an error message in either the sites error.log or in the global nginx error.log.
     
  4. nhybgtvfr

    nhybgtvfr Well-Known Member HowtoForge Supporter

    @Taleman's post.. table name is wp_options
    note that if you have changed the site's url at all, whilst changing site_url and home_url is usually enough to get the site running and accessible, the old url is likely to still exist in lots of places in the database..
    also if the filepath to the docroot has changed, that can also be in lots of places in the database. *
    it won't necessarily make the site inaccessible, but it could break some bits of it, along with in-site navigation.
    use the search-replace function of wp-cli, or a plugin like 'better search and replace' to fix these..
    or transfer the site to a new server using a wordpress plugin like 'duplicator' by snap-creek, which will handle all these url/path changes for you.
    don't try to change these manually in the db.. there could be thousands, and most of them need to be wordpress aware changes, ie you also need to change the specified string lengths to match the content changes. it can take ages to do manually, and trying to do it using regex is horrendous.

    *note that some plugins may also end up hard-coding the original filepath in some of their files, so they may need to change as well.
    wordfence will likely do this for some hidden files in the docroot, eg .user.ini
     

Share This Page