0

Hi on our dev environment we have show all errors, warnings and notices. I'm getting this:

Notice: Use of undefined constant CURLOPT_PROTOCOLS - assumed 'CURLOPT_PROTOCOLS' in C:\notion\implementation\development\asterix\library\ExternalLibs\panda.php on line 69

Notice: Use of undefined constant CURLPROTO_HTTP - assumed 'CURLPROTO_HTTP' in C:\notion\implementation\development\asterix\library\ExternalLibs\panda.php on line 69

The code on line 69:

    curl_setopt($curl, CURLOPT_PROTOCOLS, CURLPROTO_HTTP);

But the CURL code works, it goes off to the other server and retrieves whats necessary. What do these notices mean?

Thanks very much.

Dave
  • 11,392
  • 5
  • 31
  • 42
  • 1
    See also [my attempt at a canonical answer for causes of this error message](http://stackoverflow.com/questions/2941169/what-does-the-php-error-message-notice-use-of-undefined-constant-mean/8025500#8025500). – John Carter Nov 06 '11 at 06:47

2 Answers2

1

This seemed to be a bug in PHP 5.2.9: #48390

According to the documentation, the option "CURLOPT_PROTOCOLS" is available as of cURL 7.19.4, but PHP is throwing a notice: "Use of undefined constant CURLOPT_PROTOCOLS - assumed 'CURLOPT_PROTOCOLS'"

Also all the "CURLPROTO_*" constants are not available:

Use of undefined constant CURLPROTO_HTTPS - assumed 'CURLPROTO_HTTPS'

I don't know what this setting does exactly, but I would assume in your case, the setting is not applied at all, because curl can't interpret the string "CURLPROTO_HTTP". If it works either way, it may be safer to comment it out, because with the next upgrade, the constants are likely to be there.

Community
  • 1
  • 1
Pekka
  • 442,112
  • 142
  • 972
  • 1,088
  • Thanks Pekka, and I don't know why I didn't turn up that bug report myself while searching. Thanks again! – Dave Mar 13 '10 at 11:52
1

This issue can occur either curl extension is not enabled or available.

Try to install curl extension from [how to download curl on ubuntu][1]

I faced same issue when I was calling a script with php-cli but the extension was not enabled for cli mode.

matang
  • 259
  • 2
  • 9