The reason behind this, you are running the main script under `apache` user. And under that user you are trying to execute such a script that is going to connect another remote location (Spidering or data fetching).
Your SELinux is enabled, and you have to turn off. To do so, below is the command
After disabled the SELinux, you can execute the script that you tried before.