3

I am running a Wordpress blog with cpanel and I get an huge error_log file (40GB) in my public_html folder.

The content:

Warning:  is_readable(): open_basedir restriction in effect. File(/var/www/html/usefulvid/wp-content/uploads/backwpup-cf4b54-logs/) is not within the allowed path(s): (/home/:/usr/lib/php:/usr/local/lib/php:/tmp) in /home/kd29314/public_html/wp-content/plugins/backwpup/inc/class-cron.php on line 76
[17-Apr-2017 01:02:33 UTC] PHP Warning:  is_dir(): open_basedir restriction in effect. File(/var/www/html/usefulvid/wp-content/uploads/backwpup-cf4b54-logs) is not within the allowed path(s): (/home/:/usr/lib/php:/usr/local/lib/php:/tmp) in /home/kd29314/public_html/wp-content/plugins/backwpup/inc/class-file.php on line 163
[17-Apr-2017 01:02:33 UTC] PHP Warning:  file_exists(): open_basedir restriction in effect. File(/var/www/html/usefulvid/wp-content/uploads/backwpup-cf4b54-logs) is not within the allowed path(s): (/home/:/usr/lib/php:/usr/local/lib/php:/tmp) in /home/kd29314/public_html/wp-includes/functions.php on line 1608
[17-Apr-2017 01:02:33 UTC] PHP Warning:  is_dir(): open_basedir restriction in effect. File(/var/www/html/usefulvid/wp-content/uploads) is not within the allowed path(s): (/home/:/usr/lib/php:/usr/local/lib/php:/tmp) in /home/kd29314/public_html/wp-includes/functions.php on line 1613
[17-Apr-2017 01:02:33 UTC] PHP Warning:  is_dir(): open_basedir restriction in effect. File(/var/www/html/usefulvid/wp-content) is not within the allowed path(s): (/home/:/usr/lib/php:/usr/local/lib/php:/tmp) in /home/kd29314/public_html/wp-includes/functions.php on line 1613
[17-Apr-2017 01:02:33 UTC] PHP Warning:  is_dir(): open_basedir restriction in effect. File(/var/www/html/usefulvid) is not within the allowed path(s): (/home/:/usr/lib/php:/usr/local/lib/php:/tmp) in /home/kd29314/public_html/wp-includes/functions.php on line 1613
[17-Apr-2017 01:02:33 UTC] PHP Warning:  is_dir(): open_basedir restriction in effect. File(/var/www/html) is not within the allowed path(s): (/home/:/usr/lib/php:/usr/local/lib/php:/tmp) in /home/kd29314/public_html/wp-includes/functions.php on line 1613
[17-Apr-2017 01:02:33 UTC] PHP Warning:  is_dir(): open_basedir restriction in effect. File(/var/www) is not within the allowed path(s): (/home/:/usr/lib/php:/usr/local/lib/php:/tmp) in /home/kd29314/public_html/wp-includes/functions.php on line 1613
[17-Apr-2017 01:02:33 UTC] PHP Warning:  is_dir(): open_basedir restriction in effect. File(/var) is not within the allowed path(s): (/home/:/usr/lib/php:/usr/local/lib/php:/tmp) in /home/kd29314/public_html/wp-includes/functions.php on line 1613
[17-Apr-2017 01:02:33 UTC] PHP Warning:  is_dir(): open_basedir restriction in effect. File(/) is not within the allowed path(s): (/home/:/usr/lib/php:/usr/local/lib/php:/tmp) in /home/kd29314/public_html/wp-includes/functions.php on line 1613
[17-Apr-2017 01:02:33 UTC] PHP Warning:  is_dir(): open_basedir restriction in effect. File(/) is not within the allowed path(s): (/home/:/usr/lib/php:/usr/local/lib/php:/tmp) in /home/kd29314/public_html/wp-includes/functions.php on line 1613
[17-Apr-2017 01:02:33 UTC] PHP Warning:  is_dir(): open_basedir restriction in effect. File(/) is not within the allowed path(s): (/home/:/usr/lib/php:/usr/local/lib/php:/tmp) in /home/kd29314/public_html/wp-includes/functions.php on line 1613

Context of line 1613 in functions.php

// We need to find the permissions of the parent folder that exists and inherit that.
    $target_parent = dirname( $target );
    while ( '.' != $target_parent && ! is_dir( $target_parent ) ) {
        $target_parent = dirname( $target_parent );
    }

I already read that open_basedir must be changed but I have only access to cpanel and no root access. It seems that I have no access to the php.ini?

.htaccess in public_html folder:

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

# END WordPress
Options +Indexes
IndexOptions -FancyIndexing
    enter code here
1

As you mentioned, you'll be not able to change this by yourself, if you are on shared hosting. There is one working method, but for this you'll need to change every php file. But it isn't a big deal to contact your hoster.

So to make it easy use this howto: http://www.agentwp.com/open_basedir-restriction-in-effect-error-in-wordpress

If you don't want to eliminate the cause of the problem, you can simply setup your logging so, that warning will not written into log. To do so, add following to your htaccess:

php_flag display_startup_errors off
php_flag display_errors off
php_flag html_errors off
php_flag log_errors on
php_flag ignore_repeated_errors off
php_flag ignore_repeated_source off
php_flag report_memleaks on
php_flag track_errors on
php_value docref_root 0
php_value docref_ext 0
php_value error_log /your/path/to/error.log
php_value error_reporting -1
php_value log_errors_max_len 0

<Files PHP_errors.log>
 Order allow,deny
 Deny from all
 Satisfy All
</Files>

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.