I’ve got a bunch of errors in my error.log that have caused my site to go down. A server reboot seemed to solve it. But I’d like to get some clarity on these as they may shut down the site again. All of this is running on a Windows server with IIS, PHP and MySQL.
One error is calls to an undefined function. The path is right. The file is there. The function is built into wordpress. But sometimes this fatal error is coming up:
PHP Fatal error: Call to undefined function trailingslashit() in pathtofilewp-settings.php on line 321
Does anyone know why it would fail intermittently? Or if there is a best practice solution to prevent this in the future.
I’m using it in this fashion:
define('BLOX_PATH', trailingslashit(get_template_directory_uri()).'framework/Pagebuilder/');
define('BLOX_DIR', trailingslashit(get_template_directory()).'framework/Pagebuilder/');
Also I’m seeing an abundance of these. It’s related to a WordPress plugin requested by the client. It’s a warning about folder permission issues, that much I know. My question is, is it site crashing issue or is it more innocuous in nature?
PHP Warning: is_readable(): open_basedir restriction in effect.
Any thoughts or suggestions are appreciated.
The
trailingslashit
function is defined inwp-includes/formatting.php
. So if you’re using it prior to the line that readsrequire( ABSPATH . WPINC . '/formatting.php' );
inwp-settings.php
the function won’t exist yet, and you will get the error.See this SO thread about the open_basedir restriction.
I had the same error when I moved website on wordpress to another server on Debian.
For me worked: