php 报错 Use of undefined constant CURLOPT_*

碰到诸如

Notice: Use of undefined constant CURLOPT_PROTOCOLS - assumed 'CURLOPT_PROTOCOLS' in /home/john/public_html/test/test.php on line 9

Notice: Use of undefined constant CURLPROTO_SFTP - assumed 'CURLPROTO_SFTP' in /home/john/public_html/test/test.php on line 9

这类 Use of undefined constant CURLOPT_* 错误的时候。

打开 php.ini 中 php_curl 的拓展,然后重启服务器,即可。

发表评论

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / 更改 )

Twitter picture

You are commenting using your Twitter account. Log Out / 更改 )

Facebook photo

You are commenting using your Facebook account. Log Out / 更改 )

Google+ photo

You are commenting using your Google+ account. Log Out / 更改 )

Connecting to %s