CodeIgniter Forums
CURL Proxy and GoDaddy? Yeah I know... Though it works outside CI - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: CURL Proxy and GoDaddy? Yeah I know... Though it works outside CI (/showthread.php?tid=13881)



CURL Proxy and GoDaddy? Yeah I know... Though it works outside CI - El Forum - 12-09-2008

[eluser]amites[/eluser]
Hello,

I have a question I'm hoping has an answer,

why would
Code:
curl_setopt ($ch, CURLOPT_PROXYTYPE, CURLPROXY_HTTP);

create 2 errors
Code:
Message: Use of undefined constant CURLOPT_PROXYTYPE - assumed 'CURLOPT_PROXYTYPE'
Code:
Message: Use of undefined constant CURLPROXY_HTTP - assumed 'CURLPROXY_HTTP'

it does this on GoDaddy Linux hosting running PHP 4.2, it does not do this on my localhost

the tricky part is that this does not happen while setting CURLOPT_PROXYTYPE in the buggy procedural code I am attempting to replace

any ideas? Please...


CURL Proxy and GoDaddy? Yeah I know... Though it works outside CI - El Forum - 12-10-2008

[eluser]Colin Williams[/eluser]
Well, you get two errors because you try to use two undeclared constants, CURLOPT_PROXYTYPE and CURLPROXY_HTTP.

And building a PHP app on GoDaddy is like building a skyscraper with tools from Black & Decker... it ain't gonna happen.


CURL Proxy and GoDaddy? Yeah I know... Though it works outside CI - El Forum - 12-10-2008

[eluser]redarc[/eluser]
Not really a CI topic.

That said, check that PHP has curl installed (phpinfo()) Last time I looked at their shared hosting, not too long ago, a lot of modules were missing. To get these, their solution is for you to upgrade to their "version" of VPS.


CURL Proxy and GoDaddy? Yeah I know... Though it works outside CI - El Forum - 12-10-2008

[eluser]Pascal Kriete[/eluser]
CURLOPT_PROXYTYPE was added in PHP 5 (curl 7.10), along with the two possible values (CURLPROXY_HTTP, CURLPROXY_SOCKS5) [docs]. You will need to upgrade your version of PHP.


CURL Proxy and GoDaddy? Yeah I know... Though it works outside CI - El Forum - 12-10-2008

[eluser]Phil Sturgeon[/eluser]
Not an answer to the question but if you are doing lots of work with cURL you could be a great candidate to help test this cURL Library I knocked up yesterday.

Let me know if it could be more useful.


CURL Proxy and GoDaddy? Yeah I know... Though it works outside CI - El Forum - 12-10-2008

[eluser]amites[/eluser]
I suppose I should have been more specific,

that same cURL declaration works outside of CI on GoDaddy, it was originally copied directly from a GoDaddy tech (I feel sorry for those guys)

when I run that same code in straight PHP, works fine, when I run that code on my local computer (PHP 5) works fine, I'm wondering why it would trigger an error in CI when it works outside of CI??


CURL Proxy and GoDaddy? Yeah I know... Though it works outside CI - El Forum - 12-10-2008

[eluser]Chris Bandy[/eluser]
CI has errors turned up maybe?