• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Question Error 500 and no logs available

Aileron79

New Pleskian
Server operating system version
18.04.6
Plesk version and microupdate number
18.0.56
One of my websites hosted on Plesk returns an error 500 and I have no idea how to figure out what is wrong as I do not find any information in any log files. I am running Plesk 18.0.56 on Ubuntu 18.04.6. The website in question is running PHP 7.2.34 (or 7.2.15 which does not make any difference.) This is what I have tried:

  • Checked the /var/www/vhosts/domain/logs/... directory, no errors when accessing the website in the errors or proxy_errors files. The access is recorded though in access_ssl_log, but no errors, obviously.
  • Also checked /var/log/apache2/error.log, /var/log/nginx/error.log, /var/log/php7.2-fpm.log
  • Enabled error_reporting E_ALL and display_errors in the php.ini file
The website is requires ioncube to be loaded. This seems to work though as usually I find ioncube errors in the log files if something is wrong with the ioncube configuration. Also, according to phpinfo(), ioncube is loaded correctly, and ioncube errors start showing up as soon as I turn off the ioncube module in the php settings. So my assumption is that something in the php code is causing a problem, but I have no idea what and I do not have access to the code.

All I need is some more logs to figure out what is wrong - any ideas?
 
The error would be logged in the error_log, not access_log or access_ssl_log. Are you in the right directory? For add-on domains the logs are stored in a level below /logs, named by the domain name. You can also go direct into /var/www/vhosts/<domain>/logs to see all logs of a domain. An error 500 always logs something unless logging was disabled on the domain.
 
Hi Peter,
Thanks for your suggestion - but I can confirm, I am in the right directories. In fact, the page is hosted in a subdomain, the logs are supposed to be in /var/www/vhosts/<domain>/logs/<subdomain>. In addition I checked the error_log in /var/www/vhosts/<domain>/logs and /var/log

The reason I mentioned the access log is that my HTTP request is logged in access_ssl_log like this:

[23/Nov/2023:19:43:40 +0100] "GET / HTTP/1.0" 500 1714 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36"

This indicates that I am looking in the right place, and that the write permissions are ok as well. You can clearly see the 500 response code, but I can't find a trace of this error in any other log files - hence my post. I absolutely agree that any Error 500 should be logged in a place - and it might be, but I don't find it.
 
If your website has an .htaccess file, rename it temporarily and test again if this solves the problem. I suspect that there is that file and it contains the "FollowSymlinks" line that will need to be changed to "SymLinksIfOwnerMatch". Just a guess, but I remember similar situations where no reason was logged and it ended up being that issue.
 
Great thinking, but unfortunately, nothing changed. Also restarted involved services (even though that shouldn't be required when removing a .htaccess). Same behavior as before, no logs to be found. The .htaccess is pretty basic I would say.
RewriteEngine On RewriteCond %{HTTPS} off RewriteRule .* https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
 
Update: Still no success, but in my desperation ran a HTTP request from the browser, and just a second later I used the find command to find all files that have been modified in the seconds before:
find / -type f -mmin -0.1 -not -path "/sys/*" -not -path "/proc/*" > modified_files.txt
then i grepped over all those files in the list to find my IP address:
xargs -d '\n' grep '127.0.0.1' < modified_files.txt
(Of course I used my actual public IP.) I found quite a few access logs, but no error logs. Tried the same with just grepping for ' 500 ' but that yielded no results either.

So, question is if error logging is somehow suppressed?
 
- What log files do you see in /var/www/vhosts/<your domain>/logs?
- Have you tried to temporarily remove the .htaccess file?
- Is there another .htaccess file one level up, in your web space root directory? If so, please rename/remove it.
 
These are the files in the log directory of the subdomain causing the error 500:
-rw-r--r-- 2 root root 0 Nov 23 20:10 proxy_error_log -rw-r--r-- 2 root root 0 Nov 24 06:31 proxy_access_log -rw-r--r-- 2 root root 6747 Nov 24 06:31 access_log.processed -rw-r--r-- 2 root root 156 Nov 25 16:28 access_log -rw-r--r-- 2 root root 11748 Nov 25 16:37 error_log -rw-r--r-- 2 root root 1394 Nov 25 16:43 proxy_access_ssl_log -rw-r--r-- 2 root root 9373 Nov 25 17:08 access_ssl_log
None of them contains information related to the statuscode 500 I get.
In the /log directory of the main domain
-rw-r--r-- 3 root root 19637 Jan 28 2016 xferlog_regular.processed -rw-r--r-- 3 root root 678032 Dec 14 2017 access_log.processed.2.gz -rw-r--r-- 3 root root 607028 Jan 9 2020 access_log.processed.1.gz -rw-r--r-- 3 root root 1120844 May 6 2020 proxy_error_log -rw-r--r-- 3 root root 1064017 May 6 2020 access_ssl_log.processed -rw-r--r-- 3 root root 821917 May 6 2020 access_log.processed -rw-r--r-- 3 root root 0 May 6 2020 access_ssl_log -rw-r--r-- 3 root root 0 May 6 2020 access_log -rw-r--r-- 3 root root 0 May 6 2020 xferlog_regular -rw-r--r-- 3 root root 0 May 6 2020 proxy_access_ssl_log -rw-r--r-- 3 root root 0 May 6 2020 proxy_access_log drwx------ 2 xxxxxxxx root 254 Nov 25 06:35 my.subdomain -rw-r--r-- 3 root root 1392877 Nov 25 16:37 error_log

There is no htaccess file in any directory in the path. In fact, I tried adding a .htaccess file with just this line to route any php errors to a different log - without any access, unfortunately:

php_value error_log /var/www/vhosts/domain/logs/subdomain/error.log
also tried different directories, like /tmp/php.log.

Tried to addingva php directive directly in Plesk:
error_log = /var/www/vhosts/domain/logs/subdomain/error.log
And again, tried /tmp/php.log as well. Unfortunately, without any success.

One thing I found out though: The application I am running is encoded with ioncube so I do not have access to its source code. However, there is a configuration file which is in PHP syntax, meaning it is probably included somewhere in the code. So I added these two lines to the configuration file:
ini_set('error_log', '/tmp/phplog/error.log'); trigger_error('This is a test error', E_USER_ERROR);

This indeed triggered an error message in that file when opening the website. It still produces an empty page and an error 500. Not entirely sure what this means now.
 
Sure that you had enabled in the PHP configuration of plesk log_errors = on ?

this is showing your more detailed information about the error
 
Back
Top