Closed GerhardLiebenberg closed 8 years ago
Try \Zend_Mail_Transport_Smtp
. Overall it's not Yii issue.
Hi Samdark,
Yes, the error occurs while trying to load Zend_Mail_Transport_Smtp.
I don't think it will help to import all the zend folders, because Zend_Mail_Transport_Smtp is not a file and Yii will therefore still not find it. Any other ideas?
Ah, thought it's Yii 2.0 issue :)
No ideas.
Could be a php bug: http://stackoverflow.com/questions/22366160/warning-open-basedir-restriction-in-effect-caused-by-trailing-path-after-php-fi
It is working fine if I replace is_file() with @is_file(). I hate to change the core files though.
can you show your php config include_path?
On the server: .:/usr/share/php56:/usr/share/pear
On my pc: include_path = ".;C:\xampp\php\PEAR"
In index.php I have: Yii::import('common.extensions.EZendAutoloader', true); EZendAutoloader::$prefixes = array('Zend'); EZendAutoloader::$basePath = Yii::getPathOfAlias('common.lib') . DIRECTORY_SEPARATOR; Yii::registerAutoloader(array("EZendAutoloader", "loadClass"), true);
In config file I have: 'import' => array( 'common.lib.*',
This bug report describes the same behaviour: https://bugs.php.net/bug.php?id=41518
this is definitifely a server configuration issue, if you do no allow accessing those paths, they should not be in include_path. Either adjust open basedir setting or the include path.
Hi Cebe. I found out last night:
If I have this in index.php:
$r = is_file('/usr/share/pear/Zend_Mail_Transport_Smtp.php');
$app = Yii::createApplication('WebApplication', $config);
then no error is thrown and $r = false.
But if I switch them around:
$app = Yii::createApplication('WebApplication', $config);
$r = is_file('/usr/share/pear/Zend_Mail_Transport_Smtp.php');
then the error is displayed.
I'm busy deleting sections of the application to try and isolate the cause.
that is because the error is a warning, which will be caught by the Yii errorhandler which only takes effect after the application has been created, the problem is still the same, you must not try to access files that are outside the open_basedir restriction.
The warning is displayed when the file is being searched for in /usr/share/pear. But /usr/share/pear is included as one of the valid directories on the server - so the warning does not make sense.
What I noticed is that /usr/share/pear was the last of all the available directories to be inspected. So I'm wondering: a) is there something specifically wrong with /usr/share/pear OR b) is the warning displayed simply because the file was not found in any of the valid paths?
If it is (b), then we have a problem. The server now runs php 5.6.
what is your open_basedir setting? http://php.net/manual/de/ini.core.php#ini.open-basedir
include_path: .:/usr/share/php56:/usr/share/pear
open_basedir: /usr/www/wwws/users/intersfzdk: /usr/wwws/users/intersfzdk: /usr/www/users/intersfzdk: /usr/home/intersfzdk: /usr/local/rmagic: /usr/www/users/he/system: /usr/share/php56: /usr/local/lib/php56: /tmp: /usr/bin: /usr/local/bin: /usr/local/share/www: /usr/www/share/www: /usr/share/misc
Hmm... /usr/share/php56 is in both include_path and open_basedir. But usr/share/pear is only in the include_path.
But usr/share/pear is only in the include_path.
and that is your problem.
Many thanx Cebe. I showed that to the hosting company and they agreed it is their mistake. They are trying to find the problem.
Thank you for your time.
We are hosting with Hetzner. Yii 1.
The following code in YiiBase >> autoload() produces an error:
The error is: is_file(): open_basedir restriction in effect. File(/usr/share/pear/Zend_Mail_Transport_Smtp.php) is not within the allowed path(s):
What I think might be happening:
Zend_Mail_Transport_Smtp is a class in Zend/Mail/Transport/Smtp.php
Everything works fine on my local computer with php 5.4, but the server runs php 5.6. Maybe it is a php issue?