short-pixel-optimizer / enable-media-replace

Enable Media Replace WordPress plugin
GNU General Public License v2.0
20 stars 27 forks source link

ErrorException thrown with message: is_dir(): open_basedir restriction in effect #79

Closed huubl closed 2 years ago

huubl commented 2 years ago

Hi,

I get this error when using with open_basedir restriction:

ErrorException thrown with message "is_dir(): open_basedir restriction in effect. File(/app/uploads/2021/11/Kennisagenda) is not within the allowed path(s): (/srv/www/:/tmp)"

Stacktrace:
#9 ErrorException in /srv/www/mydomain.com/current/web/app/plugins/enable-media-replace/classes/replacer.php:470
#8 is_dir in /srv/www/mydomain.com/current/web/app/plugins/enable-media-replace/classes/replacer.php:470
#7 EnableMediaReplace\Replacer:doSearchReplace in /srv/www/mydomain.com/current/web/app/plugins/enable-media-replace/classes/replacer.php:230
#6 EnableMediaReplace\Replacer:replaceWith in /srv/www/mydomain.com/current/web/app/plugins/enable-media-replace/views/upload.php:159
#5 require_once in /srv/www/mydomain.com/current/web/app/plugins/enable-media-replace/classes/emr-plugin.php:158
#4 EnableMediaReplace\EnableMediaReplacePlugin:route in /srv/www/mydomain.com/current/web/wp/wp-includes/class-wp-hook.php:303
#3 WP_Hook:apply_filters in /srv/www/mydomain.com/current/web/wp/wp-includes/class-wp-hook.php:327
#2 WP_Hook:do_action in /srv/www/mydomain.com/current/web/wp/wp-includes/plugin.php:470
#1 do_action in /srv/www/mydomain.com/current/web/wp/wp-admin/admin.php:259
#0 require_once in /srv/www/mydomain.com/current/web/wp/wp-admin/upload.php:10
pdobrescu commented 2 years ago

hello @huubl, can you please describe what are you trying to achieve with the open_basedir restriction that you have in place? From what I can see in the message, EMR cannot access/replace that image (/app/uploads/2021/11/Kennisagenda) because it's not in the allowed list of path(s). In other words, the plugin doesn't seem to have proper access to the image files, therefore it cannot replace them. Many times WordPress itself crashes in such situation.

Can you please clarify what would be your expectation to happen in this case? Thanks!