Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Use of undefined constant

Tags:

php

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
like image 203
emeraldhieu Avatar asked Sep 05 '12 13:09

emeraldhieu


People also ask

What is undefined constant in PHP?

Code Inspection: Undefined constantReports the references to constants that are not found in the project files, configured include paths, or among the PHP predefined constants.

How do you check if constant is defined in PHP?

Checking if a PHP Constant is Defined This can be achieved using the PHP defined() function. The defined() function takes the name of the constant to be checked as an argument and returns a value of true or false to indicate whether that constant exists.

How is constant defined in a PHP script?

A constant is an identifier (name) for a simple value. The value cannot be changed during the script. A valid constant name starts with a letter or underscore (no $ sign before the constant name). Note: Unlike variables, constants are automatically global across the entire script.


1 Answers

Install curl and all your problems will disappear :)

like image 91
Nin Avatar answered Sep 28 '22 03:09

Nin