So I have a custom widget with block defined in module's config.xml:



Block's file is under app/code/local/Phil/Gwidgets/Block/Slider.php

I believe this is where the problem starts. I insert the widget into Wysiwyg editor in back-and, refresh the front-end and it doesn't appear. I check system log and there's this error:

Warning: file_exists(): open_basedir restriction in effect. File(/usr/share/php5/Mage/Phil/Gwidgets/Block/Slider.php) is not within the allowed path(s): (/home/www/xyz/:/usr/bin/) in /home/www/xyz/html/app/code/core/Mage/Core/functions.php on line 145

So after setting up logging function in functions.php I've found out that these are the directories where autoloader attempts to find by block class:


It nearly does it here:


It would find it without '/Mage' in the path.

So the question is why Magento looks for Slider.php in ...local/Mage/... rather than ...local/....?

I'd appreciate any advice on how to fix this issue. :)

  • @zhartaunik thanks for the link but I think that my problem has more to do with Magento's way of parsing plugin configuration.
    – Alan
    Apr 13, 2015 at 12:49
  • Show your Slider.php
    – zhartaunik
    Apr 13, 2015 at 12:51
  • @zhartaunik The problem is that Magento can't find Slider.php so I can have anything inside.
    – Alan
    Apr 14, 2015 at 12:06

2 Answers 2


This problem appears because your php tries to access /usr/share/php5 directory but server does not allow that. Check permission of /usr/share/php5 directory.

Answering the question why this folder is in 'include_paths' - check your php.ini configuration and virtual host config maybe it is set there. Default value of include_paths is .:/usr/share/php:/usr/share/pear.

  • 1
    Thanks Oleksii. You are right. The problem here is that Magento should look for my file in /home/www/xyz/html/app/code/local/Phil/Gwidgets/Block/Slider.php and not /home/www/xyz/html/app/code/local/Mage/Phil/Gwidgets/Block/Slider.php. In such case it wouldn't have to look for it in /usr/share/php5 and the error wouldn't appear. The question is why Magento looks for it in ...local/Mage/... rather than ...local/....
    – Alan
    Apr 14, 2015 at 7:42

I've made two changes to my widget.xml file and the problem disappeared:

1) In definition of a widget I've changed type and module name.

<gwidgets_slider type="gwidgets/widget_slider" translate="label description" module="gwidgets">

2) I've extended template tag from:



  <default translate="label">
   <label>Slider template</label>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.