Bar*_*rtu 5 php linux permissions curl permission-denied
昨天我已经在我的linux主机上更改了我的用户组/用户以获取一组文件.今天我发现CURL正在上升一个权限被拒绝(仅限浏览器访问,适用于SSH)
Couldn't send request: Failed to connect to <server_ip>: Permission denied
Run Code Online (Sandbox Code Playgroud)
文件目前拥有777权限.但我认为它与用户组/用户有关.
ls-所有结果:
-rwxrwxrwx. 1 baknealdi psaserv 533 May 18 05:14 check.php
Run Code Online (Sandbox Code Playgroud)
上市用户群;
root:x:0:
psaserv:x:504:apache,psaftp,psaadm,nginx
psacln:x:505:
Run Code Online (Sandbox Code Playgroud)
而且我已经读过某个地方,selinux可能与它有关.
sestatus结果:
SELinux status: enabled
SELinuxfs mount: /selinux
Current mode: enforcing
Mode from config file: enforcing
Policy version: 24
Policy from config file: targeted
Run Code Online (Sandbox Code Playgroud)
我可以提供任何其他信息,但我真的不知道什么是相关的.
Bar*_*rtu 11
只需在PHP配置中应用这一行代码就可以了;
setsebool -P httpd_can_network_connect 1
Run Code Online (Sandbox Code Playgroud)
它启用了http网络连接.