Magento Forum

Once again: include_path problems
 
jan212
Guru
 
Avatar
Total Posts:  407
Joined:  2008-01-03
 

Hello community, hello magento core members,

i have a lil problem with some include_path settings on my server running on OpenSuse 10.2 with Apache2/ PHP5.2.5/ mySQL 5.0.26/ Plesk 8.3. The default(global) include_path is set to:

.:.:/usr/share/php5:/usr/share/php5/PEAR

This configuration induces a non permanent front- and backend error described here:
http://www.magentocommerce.com/boards/viewthread/1848/

Warning: include_once(Mage/Core/functions.php[function.include-once]failed to open stream: ...
After refreshing the site several times the error disappeard but appeard several times later, sometimes in the frontend and sometimes in backend. cheese

So i tried to fix it and after reading some threads i did the following steps

1. First i checked the path in app/Mage.php, around line 50 with

//Debugging - Include Path Bug
echo "<div>";
echo 
ini_get('include_path'); 
echo 
"</div>";
resulting
/srv/www/vhosts/mydomain.de/subdomains/mysubdomain/httpdocs/magento/app/code/local:/srv/www/vhosts/mydomain.de/subdomains/mysubdomain/httpdocs/magento/app/code/community:/srv/www/vhosts/mydomain.de/subdomains/mysubdomain/httpdocs/magento/app/code/core:/srv/www/vhosts/mydomain.de/subdomains/mysubdomain/httpdocs/magento/lib:.:.:/usr/share/php5:/usr/share/php5/PEAR
and if the bug appears only
.:.:/usr/share/php5:/usr/share/php5/PEAR
--
2. I created a file called vhost.conf which is included by plesk websrvmanager(in httpd.conf) while overwriting the default values to set the include_path manually to the following values
<Directory /srv/www/vhosts/mydomain.de/subdomains/mysubdomain/httpdocs>
#
AllowOverride All
#
#############
php_admin_value include_path "/srv/www/vhosts/mydomain.de/subdomains/mysubdomain/httpdocs/magento:app/code/core:app/code/community:app/code/local:lib"
#############
#
php_admin_value open_basedir "none"
#
</Directory>

With this solution i don’t have the front- & backend include_path bug till yet (praying wink), but still(and clearly) a problem with the PEAR include_path in Magento Connect resulting the following error:

Warning: require_once(PEAR.php): failed to open streamNo such file or directory in /srv/www/vhosts/mydomain.de/subdomains/mysubdomain/httpdocs/magento/downloader/pearlib/php/PEAR/Registry.php on line 28
[0] in 
require_once() in /srv/www/vhosts/mydomain.de/subdomains/mysubdomain/httpdocs/magento/downloader/pearlib/php/PEAR/Registry.php on line 28
[1] in 
require_once("/srv/www/vhosts/mydomain.de/subdomains/mysubdomain/httpdocs/magento/downloader/pearlib/php/PEAR/Re"in /srv/www/vhosts/mydomain.de/subdomains/mysubdomain/httpdocs/magento/lib/Varien/Pear.php on line 25
[2] in 
require_once("/srv/www/vhosts/mydomain.de/subdomains/mysubdomain/httpdocs/magento/lib/Varien/Pear.php"in /srv/www/vhosts/mydomain.de/subdomains/mysubdomain/httpdocs/magento/lib/Varien/Pear/Package.php on line 3
[3] in 
require_once("/srv/www/vhosts/mydomain.de/subdomains/mysubdomain/httpdocs/magento/lib/Varien/Pear/Package.php"in /srv/www/vhosts/mydomain.de/subdomains/mysubdomain/httpdocs/magento/app/code/core/Mage/Adminhtml/controllers/Extensions/LocalController.php on line 22
[4] in 
include("/srv/www/vhosts/mydomain.de/subdomains/mysubdomain/httpdocs/magento/app/code/core/Mage/Adminhtml/c"in /srv/www/vhosts/mydomain.de/subdomains/mysubdomain/httpdocs/magento/app/code/core/Mage/Core/Controller/Varien/Router/Admin.php on line 116
[5] in Mage_Core_Controller_Varien_Router_Admin
->match(Mage_Core_Controller_Request_Httpin /srv/www/vhosts/mydomain.de/subdomains/mysubdomain/httpdocs/magento/app/code/core/Mage/Core/Controller/Varien/Front.php on line 147
[6] in Mage_Core_Controller_Varien_Front
->dispatch() in /srv/www/vhosts/mydomain.de/subdomains/mysubdomain/httpdocs/magento/app/Mage.php on line 431
[7] in Mage
::run("default"in /srv/www/vhosts/mydomain.de/subdomains/mysubdomain/httpdocs/magento/index.php on line 40

Fatal error
: require_once(): Failed opening required 'PEAR.php' (include_path='/srv/www/vhosts/mydomain.de/subdomains/mysubdomain/httpdocs/magento:app/code/core:app/code/community:app/code/local:lib:'in /srv/www/vhosts/mydomain.de/subdomains/mysubdomain/httpdocs/magento/downloader/pearlib/php/PEAR/Registry.php on line 28
--
3. Than i started trying to include PEAR libraries. I logged in via putty/SSH and did a search, found out that the PEAR stuff is located under
/usr/share/psa-horde/pear
confused and wonder about the default include_path posted above.

Setup the vhost.conf -> php_admin_value include_path to

/srv/www/vhosts/mydomain.de/subdomains/mysubdomain/httpdocs/magento:app/code/core:app/code/community:app/code/local:lib:/usr/share/psa-horde/pear:.
causes an error cause the class is allready declared:
/srv/www/vhosts/mydomain.de/subdomains/mysubdomain/httpdocs/magento:app/code/core:app/code/community:app/code/local:lib:/usr/share/psa-horde/pear:.
Fatal errorCannot redeclare _pear_call_destructors() (previously declared in /srv/www/vhosts/mydomain.de/subdomains/mysubdomain/httpdocs/magento/downloader/pearlib/php/PEAR.php:775in /usr/share/psa-horde/pear/PEAR.php on line 796
I saw the pearlib in magento folder “downloader” but still can’t get rid of this problem, also tested to route to the pearlib PEAR within magento root.

Any help on this issue would be nice smile, thanks in advance…

Update
I tried to reset the include_path in ../magento/downloader/pearlib/php/PEAR/Registry.php with

set_include_path ...
but can’t overwrite it…
 
Magento Community Magento Community
Magento Community
Magento Community
 
jan212
Guru
 
Avatar
Total Posts:  407
Joined:  2008-01-03
 

Nobody out there?

 
Magento Community Magento Community
Magento Community
Magento Community
 
jan212
Guru
 
Avatar
Total Posts:  407
Joined:  2008-01-03
 

Hello world!

 
Magento Community Magento Community
Magento Community
Magento Community
 
Moshe
Magento Team
 
Avatar
Total Posts:  1770
Joined:  2007-08-07
Los Angeles
 

if you use php_admin_value in your apache .conf file, this value will not be able to change by setting it in .htaccess or code.

why does it have to be php_admin_value?

 
Magento Community Magento Community
Magento Community
Magento Community
 
jan212
Guru
 
Avatar
Total Posts:  407
Joined:  2008-01-03
 

Hello moshe,

BIG BIG thanks for that hint, thread could be closed. Sometimes i am to fuc*’#g blind to see… Setup the include_path as different php_value in /root/.htaccess and /root/downloader/.htaccess does it for me. smilesmilesmile

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top