尝试访问localhost

时间:2018-02-27 18:31:08

标签: php localhost fuseki

在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端口是否需要特殊权限? firewalld已停用,顺便说一句。

1 个答案:

答案 0 :(得分:0)

事实证明SELinux是问题的原因,阻止了Apache在其他端口上进行出站连接。

见这里:http://sysadminsjourney.com/content/2010/02/01/apache-modproxy-error-13permission-denied-error-rhel/