run through root login
Check your status by running:
If you get:
httpd_can_network_connect –> off
This may be your issue.
The Fix :
` Enable httpd_can_network_connect by running:
Test your script again and see if it works. This worked for me so I made sure to set a policy to keep this enabled.
setsebool -P httpd_can_network_connect=1
NOTE: -P sets the policy so it persists over a reboot