在Centos 7机器上的PHP 7.2中,我正在尝试访问Apache Jena Fuseki 3.6 SPARQL端点。
Fuseki在端口3030上运行,数据集的名称是ds
,我可以成功运行curl http://localhost:3030/ds
- 即使用户没有任何权限也登录该系统。到目前为止一切似乎都很好。
但是,当我尝试在PHP脚本中执行fopen("http://127.0.0.1:3030/ds","r");
或fopen("http://localhost:3030/ds","r");
时,我总是以PHP Warning: fopen(http://localhost:3030/ds): failed to open stream: Permission denied
结束。
从WWW中获取文件,甚至从像fopen("http://localhost/mytest.html","r");
这样的Apache服务器中获取文件。
是否有访问其他localhost端口所需的特殊权限? qzxswpoi已停用,顺便说一下。
原来,SELinux是问题的原因,阻止Apache在其他端口上进行出站连接。
见这里:firewalld