web-dev-qa-db-fra.com

restriction open_basedir causant une énorme error_log dans WordPress

J'utilise un blog Wordpress avec cpanel et un énorme fichier error_log (40 Go) est stocké dans mon dossier public_html.

Le contenu:

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

Contexte de la ligne 1613 dans 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 );
    }

J'ai déjà lu que open_basedir doit être changé, mais je n'ai accès qu'à cpanel et pas d'accès root. Il semble que je n'ai pas accès au php.ini?

.htaccess dans le dossier public_html:

# 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

Comme vous l'avez mentionné, vous ne pourrez pas changer cela vous-même si vous utilisez un hébergement partagé. Il existe une méthode de travail, mais pour cela, vous devrez changer tous les fichiers php. Mais ce n'est pas grave de contacter votre hébergeur.

Donc, pour faciliter les choses, utilisez ce guide: http://www.agentwp.com/open_basedir-restriction-in-effect-error-in-wordpress

Si vous ne voulez pas éliminer la cause du problème, vous pouvez simplement configurer votre journalisation afin que cet avertissement ne soit pas écrit dans le journal. Pour ce faire, ajoutez ce qui suit à votre 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