尝试访问localhost时权限被拒绝

问题描述 投票:0回答:1

在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已停用,顺便说一下。

php localhost fuseki
1个回答
0
投票

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

见这里:firewalld

© www.soinside.com 2019 - 2024. All rights reserved.