我的php设置出了问题,我知道这是肯定的,因为完全相同的lib在我的伴侣的服务器上工作得很好。
$inc_path = get_include_path();
$inc_path .= PATH_SEPARATOR . "./rtmp" . PATH_SEPARATOR . "./SabreAMF";
set_include_path($inc_path);
require_once 'rtmp/SabreAMF/OutputStream.php';
require_once 'rtmp/SabreAMF/InputStream.php';
require_once 'rtmp/SabreAMF/AMF0/Serializer.php';
require_once 'rtmp/SabreAMF/AMF0/Deserializer.php';
require_once 'rtmp/SabreAMF/TypedObject.php';
这就是我得到的
Warning: require_once(rtmp/SabreAMF/OutputStream.php): failed to open stream: No such file or directory in C:\Program Files (x86)\EasyPHP-12.1\www\phpLoL-master\rtmp\RtmpClient.php on line 7
Fatal error: require_once(): Failed opening required 'rtmp/SabreAMF/OutputStream.php' (include_path='.;C:\php\pear;./rtmp;./rtmp/SabreAMF;./rtmp;./SabreAMF') in C:\Program Files (x86)\EasyPHP-12.1\www\phpLoL-master\rtmp\RtmpClient.php on line 7
发布于 2013-04-16 01:44:42
更新到php 5.4解决了这个问题。
发布于 2013-04-12 18:59:25
尝试使用
$inc_path = $_SERVER['DOCUMENT_ROOT'];
require_once $inc_path.'/rtmp/SabreAMF/OutputStream.php';
require_once $inc_path.'/rtmp/SabreAMF/InputStream.php';
require_once $inc_path.'/rtmp/SabreAMF/AMF0/Serializer.php';
require_once $inc_path.'/rtmp/SabreAMF/AMF0/Deserializer.php';
require_once $inc_path.'/rtmp/SabreAMF/TypedObject.php';
发布于 2013-04-12 19:04:26
实际上,您正在设置包含路径
已经这样了
$inc_path .= PATH_SEPARATOR . "./rtmp" . PATH_SEPARATOR . "./SabreAMF";
set_include_path($inc_path);
因为PHP知道您所包含的任何文件都可能在此路径中,所以您可以像下面这样包含它
require_once 'OutputStream.php';
或
require_once 'AMF0/Deserializer.php';
注意:-我假设您在应用程序引导时执行set_include_path,否则这种设置包含路径的编程方法在所有
中都不起作用
https://stackoverflow.com/questions/15969499
复制相似问题