web-dev-qa-db-ja.com

open_basedir制限により、WordPressに巨大なerror_logが発生します

CpanelでWordpressブログを実行していますが、public_htmlフォルダーに巨大なerror_logファイル(40GB)が記録されています。

コンテンツ:

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

Functions.phpの1613行目のコンテキスト

// 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 );
    }

私はすでにopen_basedirを変更する必要があることを読みましたが、cpanelにのみアクセスでき、rootアクセスはできません。 php.iniにアクセスできないようです。

public_htmlフォルダーの.htaccess:

# 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
3
UsefulVid

前述のように、共有ホスティングを使用している場合、これを自分で変更することはできません。作業方法は1つですが、このためには、すべてのphpファイルを変更する必要があります。しかし、ホスティング業者に連絡することは大したことではありません。

このハウツーを簡単に使用するには、 http://www.agentwp.com/open_basedir-restriction-in-effect-error-in-wordpress

問題の原因を排除したくない場合は、その警告がログに書き込まれないように、単純にログを設定できます。これを行うには、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>
1
Evgeniy