Relative path in Integrations.php causing error
-
Hi,
It seems that usage of the relative path in plugin’s includes/integrations/Integrations.php file is causing errors with is_readable() method. The code:
private function load_integrations() { $registered_integrations = array( 'WC_Facebook_WPML_Injector' => '/includes/fbwpml.php', Bookings::class => '/includes/Integrations/Bookings.php', ); foreach ( $registered_integrations as $class_name => $path ) { if ( ! class_exists( $class_name ) && ! is_readable( $path ) ) { $this->integrations[ $class_name ] = $this->plugin->load_class( $path, $class_name ); } } }
Error notice:
FastCGI sent in stderr: "PHP message: PHP Warning: is_readable(): open_basedir restriction in effect. File(/includes/fbwpml.php) is not within the allowed path(s): (/www/OUR_SITE/public:/www/OUR_SITE/mysqleditor:/www/OUR_SITE/web:/www/OUR_SITE/deploy:/www/OUR_SITE/deployment:/www/OUR_SITE/deployments:/usr/share:/tmp) in /www/OUR_SITE/public/wp-content/plugins/facebook-for-woocommerce/includes/Integrations/Integrations.php on line 61" while reading response header from upstream, client: 89.201.230.203, server: OUR_SITE_URL, request: "POST /?wc-ajax=get_refreshed_fragments HTTP/1.0", upstream: "fastcgi://unix:/var/run/php7.4-fpm-OUR_SITE.sock:", host: "OUR_SITE_URL", referrer: "OUR_SITE_URL"
Where OUR_SITE and OUR_SITE_URL represent site name and site URL, respectively.
Could your developers fix the relative paths for the next plugin update using plugin_dir_path( __DIR__ ), for example:
'WC_Facebook_WPML_Injector' => plugin_dir_path( __DIR__ ) . 'includes/fbwpml.php'
,or similar solution, please?Thanks
- The topic ‘Relative path in Integrations.php causing error’ is closed to new replies.