1

我的 php 设置有问题,我肯定知道因为完全相同的库非常适合我在 HIS 服务器上的合作伙伴。

$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
4

3 回答 3

1

更新到 php 5.4 解决了这个问题。

于 2013-04-15T17:44:42.273 回答
0

尝试

$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-12T10:59:24.887 回答
0

实际上你正在设置包含路径

已经这样了

$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 ,否则这种设置包含路径的方法在语法上根本不起作用

于 2013-04-12T11:04:26.260 回答