I cleaned up the script on one server using tor, and everything worked fine. Moved it to a working server, and the script stopped working. I tried to run cURL manually and got the following output:
curl http://www.google.com --socks5 '127.0.0.1:9050' curl: (7) Can't complete SOCKS5 connection to 0.0.0.0:0. (6)
Relevant information: Tor version 0.2.2.35 | CentOS 6.2 i686
curl --version curl 7.19.7 (i686-pc-linux-gnu) libcurl/7.19.7 NSS/3.12.7.0 zlib/1.2.3 libidn/1.18 libssh2/1.2.2 Protocols: tftp ftp telnet dict ldap ldaps http file https ftps scp sftp Features: GSS-Negotiate IDN IPv6 Largefile NTLM SSL libz
It seems that there is not much information about this particular error message that I could find in my search, just general bad configurations or not running. I use the same configuration on my production server as the development server where it worked.
source share