How to Fix cURL Error 7 Failed to Connect on CentOS
Apr 23, 2021 · Article · 1 min, 125 words
Sometimes we face “cURL error 7: Failed to connect to permission denied” this type of error due to our server permission. Most of the time we face if SELinux is enabled on our server. The curl request is blocked by SELinux.
Login to your server using SSH with root permission. Then just run this command:
setsebool -P httpd_can_network_connect on
After that we have to restart our web server:
# apache server sudo systemctl restart httpd # nginx server sudo systemctl restart nginx
That’s all. Thanks for reading.
Md Obydullah https://shouts.dev/obydul
No comments yet…