我使用WAMP作为我的PHP框架。我正在试着测试这段代码
<?php
require_once "C:\wamp\www\factual-php-driver-master\Factual.php";
$factual= new Factual("/*API Key*/","/*API Secret*/");
$query= new FactualQuery;
$query->limit(3);
$res= $factual->fetch("places", $query);
print_r($res->getData());
?>我的Factual.php文件的路径是绝对正确的,但是该文件返回以下错误
警告: require_once(C:\wamp\wwwactual-php-driver-master\Factual.php):未能打开流:第2行C:\wamp\www\foodmeets\restaurants.php中的无效参数
致命错误: require_once():第2行C:\wamp\www\foodmeets\restaurants.php中的C:\wamp\www\foodmeets\restaurants.php中的require_once():失败的打开要求C:\wamp\www\foodmeets\restaurants.php(include_path=.;C:\pear‘)
请注意,我已经使用命令执行了PHP安装环境的测试。
php -f test.php yourFactualKey yourFactualSecret [logfile]正如实际驱动程序(V3)中提到的那样,PHP (https://github.com/Factual/factual-php-driver)
发布于 2016-05-31 09:00:44
您必须转义\f ( \f元字符用于查找表单提要字符)。
require_once "C:\wamp\www\\factual-php-driver-master\Factual.php";发布于 2016-05-31 09:01:37
反斜杠被PHP转换成特殊字符。例如,...arrays\news.php被转化为
...arrays
ews.php
你应该像这样逃离他们
"C:\NucServ\www\vv\static\arrays\news.php"; = $path =或使用单打,如下所示:
'C:\NucServ\www\vv\static\arrays\news.php'; $path =
而且,你的如果是混乱的。你不应该再打开文件了。只需使用您已经拥有的$fp。
https://stackoverflow.com/questions/37541160
复制相似问题