Php 未定义常数的使用

Php 未定义常数的使用,php,Php,我在运行从Internet下载的源代码时遇到此错误。如何修复它?这似乎是PHP版本的问题。我使用PHP5.3 [Wed Sep 05 20:31:40 2012] [error] [client 127.0.0.1] PHP Notice: Use of undefined constant CURLOPT_RETURNTRANSFER - assumed 'CURLOPT_RETURNTRANSFER' in /home/hieugioi/Workspace/PHP/Couponic/pro

我在运行从Internet下载的源代码时遇到此错误。如何修复它?这似乎是PHP版本的问题。我使用PHP5.3

[Wed Sep 05 20:31:40 2012] [error] [client 127.0.0.1] PHP Notice:  Use of undefined constant CURLOPT_RETURNTRANSFER - assumed 'CURLOPT_RETURNTRANSFER' in /home/hieugioi/Workspace/PHP/Couponic/protected/modules/location/worklets/WLocationHelper.php on line 209
[Wed Sep 05 20:31:40 2012] [error] [client 127.0.0.1] PHP Notice:  Use of undefined constant CURLOPT_CONNECTTIMEOUT - assumed 'CURLOPT_CONNECTTIMEOUT' in /home/hieugioi/Workspace/PHP/Couponic/protected/modules/location/worklets/WLocationHelper.php on line 210
[Wed Sep 05 20:31:40 2012] [error] [client 127.0.0.1] PHP Notice:  Use of undefined constant CURLOPT_TIMEOUT - assumed 'CURLOPT_TIMEOUT' in /home/hieugioi/Workspace/PHP/Couponic/protected/modules/location/worklets/WLocationHelper.php on line 211
[Wed Sep 05 20:31:40 2012] [error] [client 127.0.0.1] PHP Notice:  Use of undefined constant CURLOPT_FAILONERROR - assumed 'CURLOPT_FAILONERROR' in /home/hieugioi/Workspace/PHP/Couponic/protected/modules/location/worklets/WLocationHelper.php on line 212
[Wed Sep 05 20:31:40 2012] [error] [client 127.0.0.1] PHP Fatal error:  Call to undefined function curl_init() in /home/hieugioi/Workspace/PHP/Couponic/framework/uniprogy/extensions/curl/CURL.php on line 22
[Wed Sep 05 20:33:15 2012] [error] [client 127.0.0.1] PHP Notice:  Use of undefined constant CURLOPT_RETURNTRANSFER - assumed 'CURLOPT_RETURNTRANSFER' in /home/hieugioi/Workspace/PHP/Couponic/protected/modules/location/worklets/WLocationHelper.php on line 209
[Wed Sep 05 20:33:15 2012] [error] [client 127.0.0.1] PHP Notice:  Use of undefined constant CURLOPT_CONNECTTIMEOUT - assumed 'CURLOPT_CONNECTTIMEOUT' in /home/hieugioi/Workspace/PHP/Couponic/protected/modules/location/worklets/WLocationHelper.php on line 210
[Wed Sep 05 20:33:15 2012] [error] [client 127.0.0.1] PHP Notice:  Use of undefined constant CURLOPT_TIMEOUT - assumed 'CURLOPT_TIMEOUT' in /home/hieugioi/Workspace/PHP/Couponic/protected/modules/location/worklets/WLocationHelper.php on line 211
[Wed Sep 05 20:33:15 2012] [error] [client 127.0.0.1] PHP Notice:  Use of undefined constant CURLOPT_FAILONERROR - assumed 'CURLOPT_FAILONERROR' in /home/hieugioi/Workspace/PHP/Couponic/protected/modules/location/worklets/WLocationHelper.php on line 212
[Wed Sep 05 20:33:15 2012] [error] [client 127.0.0.1] PHP Fatal error:  Call to undefined function curl_init() in /home/hieugioi/Workspace/PHP/Couponic/framework/uniprogy/extensions/curl/CURL.php on line 22

安装curl,所有问题都将消失:)

安装
php5 curl
。对于Debian,使用

$ apt-get install php5-curl

首先使用此命令检查您的php版本

php -v
例如,返回PHP7.3.27-9 然后安装此版本的curl模块

sudo apt-get install php7.3-curl

检查curl是否使用phpinfo()安装。这些常量是curl的一部分。谢谢。请发布一个答案。@kwoxer检查curl是否真的与phpinfo()一起安装。不知何故,我需要安装php5.6-curl而不是php5-curl。。。现在它开始工作了。