Title: php function is_readable bug
Last modified: May 31, 2022

---

# php function is_readable bug

 *  Resolved [crewstyle](https://wordpress.org/support/users/crewstyle/)
 * (@crewstyle)
 * [3 years, 12 months ago](https://wordpress.org/support/topic/php-function-is_readable-bug/)
 * Hi there,
 * There is a bug in the `framework/extensions-manager.php` which breaks my website.
   
   Here is the stack:
 * `Warning: is_readable(): open_basedir restriction in effect. File(/config.php)
   is not within the allowed path(s): (...)` in `in .../plugins/blocksy-companion/
   framework/extensions-manager.php (line 464)`
 * In some cases, the $filepath variable is NULL. Same case on line 448 with the
   $path variable.
 * Could you please fix it?
 * Thanks a lot
    Achraf

Viewing 5 replies - 1 through 5 (of 5 total)

 *  Plugin Author [Creative Themes](https://wordpress.org/support/users/creativethemeshq/)
 * (@creativethemeshq)
 * [3 years, 12 months ago](https://wordpress.org/support/topic/php-function-is_readable-bug/#post-15694244)
 * Hi [@crewstyle](https://wordpress.org/support/users/crewstyle/),
 * From the limited logs that you provided, it seems that you have an unusual structure
   in your wp-content/plugins directory.
    Can you please provide more details on
   that?
 * Also, if you could output the contents of the `BLOCKSY_PATH` constant and provide
   here the full path of it, it’d help us to debug this problem.
 * —
 * The logic that the `extensions-manager` follows, is to look in every directory
   from `BLOCKSY_PATH . 'framework/extensions'` and look for the `config.php` file.
   When found, it’ll be loaded.
    It seems like your folder structure prevents this
   process in some way.
 * —
 * Looking forward to your reply so that we can get this fixed!
 *  Thread Starter [crewstyle](https://wordpress.org/support/users/crewstyle/)
 * (@crewstyle)
 * [3 years, 11 months ago](https://wordpress.org/support/topic/php-function-is_readable-bug/#post-15762029)
 * Hi 👋
 * I’m sorry I didn’t see your response and I’m still facing this issue.
    To add
   some more details, I use Blocksy in a multisite WP configuration, with subdomains.
   And I try to access to extensions tab.
 * Here is the output of the `BLOCKSY_PATH` constant:
    `/home/(...)/web/statics/
   plugins/blocksy-companion/`
 * My website uses GetOlympus framework to work. Which means:
    – the webroot folder
   is web/ – the wp-content folder’s name is statics – and all the default WP constants
   are defined thanks to the framework
 * It seems `BLOCKSY_PATH` has a good value.
    If you need some more details, tell
   me.
 * Right now, from the file `blocksy-companion/framework/extensions-manager.php`,
   my fix is to change (line 448):
    `if (is_readable($path . '/readme.php')) {` 
   Into: `if (!is_null($path) && is_readable($path . '/readme.php')) {`
 * And (line 464):
    `if (is_readable($file_path . '/config.php')) {` Into: `if (!
   is_null($file_path) && is_readable($file_path . '/config.php')) {`
 * Can you check please?
 * Thanks
    Achraf
 *  Plugin Author [Creative Themes](https://wordpress.org/support/users/creativethemeshq/)
 * (@creativethemeshq)
 * [3 years, 11 months ago](https://wordpress.org/support/topic/php-function-is_readable-bug/#post-15763491)
 * Hi Achraf,
 * Thanks a lot for the research that you’ve done.
 * If `BLOCKSY_PATH` has a good value, then, most likely, the `read_installed_extensions()`
   method gets a `null` from somewhere. Can you please post here the output of `
   glob($single_path . '/*', GLOB_ONLYDIR)` from this method? We will see which 
   of the returned values cause the issue with trying to read the `config.php` file
   of the extension.
 * I’m thinking there is a small miss (like an empty directory or an unusual file)
   in your filesystem that is breaking the extensions discovery mechanism that we
   use.
 * If you could dig a little deeper in this direction and post your findings, that
   would be great.
    Of course we can just blindly add the `is_null()` check, this
   is not hard, but first we want to understand the situation that we are dealing
   with.
 * Also, besides that, could you please reach out at `hq at creativethemes dot com`?
   We have a small proposal for a potential colaboration between us.
 * Thanks and looking forward to hear from you soon.
 *  Thread Starter [crewstyle](https://wordpress.org/support/users/crewstyle/)
 * (@crewstyle)
 * [3 years, 11 months ago](https://wordpress.org/support/topic/php-function-is_readable-bug/#post-15769553)
 * Hi team,
 * Here is the output of the $all_extensions var:
 *     ```
       array(5) {
         [0]=>
         string(109) "/home/(...)/web/statics/plugins/blocksy-companion/framework/extensions/cookies-consent"
         [1]=>
         string(114) "/home/(...)/web/statics/plugins/blocksy-companion/framework/extensions/newsletter-subscribe"
         [2]=>
         string(109) "/home/(...)/web/statics/plugins/blocksy-companion/framework/extensions/product-reviews"
         [3]=>
         string(102) "/home/(...)/web/statics/plugins/blocksy-companion/framework/extensions/trending"
         [4]=>
         string(101) "/home/(...)/web/statics/plugins/blocksy-companion/framework/extensions/widgets"
       }
       ```
   
 * By the way, I’ll send you a mail today.
 * Bye 🙂
 *  Plugin Author [Creative Themes](https://wordpress.org/support/users/creativethemeshq/)
 * (@creativethemeshq)
 * [3 years, 11 months ago](https://wordpress.org/support/topic/php-function-is_readable-bug/#post-15775153)
 * [@crewstyle](https://wordpress.org/support/users/crewstyle/) thanks for the reply.
   That one has a good value too… Very strange…
 * Is the Olympus framework that you mentioned public? How can we test it on our
   end?
    Or, if you could do a minimal setup in [LocalWP](https://localwp.com/) 
   and send us over an export of the setup with reproduction, we’ll take care of
   the fix from the Companion side.
 * Waiting for your reply and thanks again for your messages!

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘php function is_readable bug’ is closed to new replies.

 * ![](https://ps.w.org/blocksy-companion/assets/icon-256x256.jpg?rev=3145156)
 * [Blocksy Companion](https://wordpress.org/plugins/blocksy-companion/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/blocksy-companion/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/blocksy-companion/)
 * [Active Topics](https://wordpress.org/support/plugin/blocksy-companion/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/blocksy-companion/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/blocksy-companion/reviews/)

 * 5 replies
 * 2 participants
 * Last reply from: [Creative Themes](https://wordpress.org/support/users/creativethemeshq/)
 * Last activity: [3 years, 11 months ago](https://wordpress.org/support/topic/php-function-is_readable-bug/#post-15775153)
 * Status: resolved