TwitterOAuth complains undefined constants

2019-05-30 04:42发布

I am trying to get examples to work using https://github.com/ricardoper/TwitterOAuth

and here is what i get:

Notice: Use of undefined constant CURLOPT_URL - assumed 'CURLOPT_URL' in /var/www/twitter/TwitterOAuth-1/TwitterOAuth/TwitterOAuth.php on line 448

Notice: Use of undefined constant CURLOPT_HEADER - assumed 'CURLOPT_HEADER' in /var/www/twitter/TwitterOAuth-1/TwitterOAuth/TwitterOAuth.php on line 449

Notice: Use of undefined constant CURLOPT_HTTPHEADER - assumed 'CURLOPT_HTTPHEADER' in /var/www/twitter/TwitterOAuth-1/TwitterOAuth/TwitterOAuth.php on line 450

Notice: Use of undefined constant CURLOPT_RETURNTRANSFER - assumed 'CURLOPT_RETURNTRANSFER' in /var/www/twitter/TwitterOAuth-1/TwitterOAuth/TwitterOAuth.php on line 451

Notice: Use of undefined constant CURLOPT_SSL_VERIFYPEER - assumed 'CURLOPT_SSL_VERIFYPEER' in /var/www/twitter/TwitterOAuth-1/TwitterOAuth/TwitterOAuth.php on line 452

Fatal error: Call to undefined function TwitterOAuth\curl_init() in /var/www/twitter/TwitterOAuth-1/TwitterOAuth/TwitterOAuth.php on line 460

did I miss some libraries here?

标签: php twitter
1条回答
迷人小祖宗
2楼-- · 2019-05-30 05:09

The problem is that the php5-curl is not installed. so following the steps should solve the problem.

sudo apt-get install php5-curl
sudo service apache2 restart
查看更多
登录 后发表回答