Use of undefined constant

php
23,763

Solution 1

Install curl and all your problems will disappear :)

Solution 2

Install php5-curl. For Debian, use

$ apt-get install php5-curl

Solution 3

first check your php version wtith this command

php -v

for example return PHP 7.3.27-9 then install curl module for this version

sudo apt-get install php7.3-curl
Share:
23,763

Related videos on Youtube

emeraldhieu
Author by

emeraldhieu

Updated on April 22, 2021

Comments

  • emeraldhieu
    emeraldhieu about 3 years

    I get this error when running a source code downloaded from Internet. How to fix it? It seems to be the PHP version problem. I use PHP 5.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
    
    • Nin
      Nin almost 12 years
      check if curl is installed using phpinfo()
  • Nin
    Nin almost 8 years
    @kwoxer Check if curl is really installed with phpinfo()
  • kwoxer
    kwoxer almost 8 years
    It was installed. Somehow I needed to install php5.6-curl instead of php5-curl... now it's working.