0

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.

0

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 127.0.0.1:51262] 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.

| improve this answer | |
-1

I was suffering with this error since a few months ago, I had to install phplist old versions.

I just discovered that the new versions of php (in my case I was working with php-5.2 but centos 7 came with php-5.4) has a new parameter (ok... new for me) called "date.timezone". My "/etc/php.ini" now has:

date.timezone = "America/Guayaquil"

You can check the valid timezone names at:

http://php.net/manual/es/timezones.php

Best regards and good luck!

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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