• 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

Resolved Weird Wordpress/PHP error behavior on new Plesk/CentOS7 install

ItsDan

New Pleskian
Server operating system version
CentOS Linux release 7.9.2009 (Core)
Plesk version and microupdate number
18.0.46
I'm having some very strange issues after trying to migrate a Wordpress site from one Plesk install to another. It's a fairly large site so I've been doing so manually by zipping/moving/unzipping the files and moving the database myself. Both are on CentOS7, both are the latest Plesk, both are running PHP 7.4.30, both have comparable PHP settings shown in plesk.

When I've finished moving the site I'll be met with a critical error. Checking the logs I see:
AH01071: Got error 'PHP message: PHP Fatal error: Uncaught ErrorException: is_readable(): open_basedir restriction in effect. File(/dev/urandom) is not within the allowed path(s): (/var/www/vhosts/{site}/:/tmp/) in /var/www/vhosts/{site}/httpdocs/wp-includes/class-phpass.php:73

When I pull up that line I see this:
if (@is_readable('/dev/urandom') &&
($fh = @fopen('/dev/urandom', 'rb'))) {
$output = fread($fh, $count);
fclose($fh);
}

So it seems like the @ error suppression operator is being ignored and instead throwing a fatal error? I tried to fix this issue by adding that path to the basedir restriction but then another error occurred which also should have been suppressed. And again these errors didn't occur on the previous install. Resolving that error led me to an issue where a E_USER_DEPRECIATED message from Elementor was also treated as a fatal error.

For the life of me I cannot find a setting mentioned anywhere regarding depreciation warnings being treated as fatal errors, or enabling/disabling the @ suppression operator. I see something where in php8 it wont' silently fail anymore, but again this is PHP 7.4.31.

Any guidance or suggestions are appreciated.
 
Kindly ignore, PEBKAC, another developer had haphazardly registered an error handler that was causing the items to be logged as fatal errors. Why this didn't occur on the old hosting I'm not entirely sure, but one mystery down.
 
Back
Top