I just did a fresh install of phplist, but when I attempt to access it in my browser, I get an empty page with status code = "500 Internal Server Error"

I'm running CentOS 7 and phplist is being served on apache v2.4.6 with php v5.6.33.

I can see the query in my apache's access_log, but there are no entries in the error_log. The vhost config file and .htaccess files all seem ok.

Please help me debug why phplist is giving me a 500 error after a fresh install.


After digging through the phplist code for many hours, I fixed this by installing libsodium on my server.

First of all, I found that--by default--phplist will suppress errors from being written to logs. This is not documented anywhere, so I left a note on their documentation page asking them to document how to re-enable error messages to be written to log files (link below)

So to prevent phplist from suppressing errors from your log files, you'll want to change error_reporting(0) to error_reporting(1) in 'lists/admin/init.php' and 'lists/admin/index.php' as I described here.

Then I was able to see the following exception being thrown in the apache error_log file by the 'lists/admin/inc/random_compat/random.php' file, which is part of the random_compat library that's included with phplist.

[Thu Aug 23 00:06:29.560157 2018] [:error] [pid 17617] [client] PHP Fatal error:  Uncaught exception 'Exception' with message 'There is no suitable CSPRNG installed on your system' in /var/www/html/phplist.opensourceecology.org/public_html/lists/admin/inc/random_compat/random.php:204\nStack trace:\n#0 /var/www/html/phplist.opensourceecology.org/public_html/lists/admin/defaultconfig.php(3): random_bytes(10)\n#1 /var/www/html/phplist.opensourceecology.org/public_html/lists/admin/index.php(103): require_once('/var/www/html/p...')\n#2 {main}\n  thrown in /var/www/html/phplist.opensourceecology.org/public_html/lists/admin/inc/random_compat/random.php on line 204

The official response from the maintainers (see issue #99 of the random_compat repo on github) is to simply add '/dev/urandom' to open_basedir in '/etc/php.ini'. Personally, that didn’t seem like the wisest option..

Alternatively, I decided to install libsodium. In CentOS 7, that means just installing the 'php-pecl-libsodium' package and restarting the apache webserver.

yum install php-pecl-libsodium
httpd -t && service httpd restart

For more information on this error, please see my write-up titled fix phplist 500 error due to random_compat.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.