为Codeception启用CURL

时间:2018-06-05 18:30:40

标签: php ubuntu curl codeception

在Ubuntu 18.04 LTS上使用Codeception执行测试时遇到问题。当我执行测试时,我得到一个错误,说明没有安装CURL扩展,但确实如此。 这是我收到的错误消息:

 Codeception requires CURL extension installed to make tests run          
 If you are not sure, how to install CURL, please refer to 
 StackOverflow  

 Notice: PHP for Apache/Nginx and CLI can have different php.ini 
 files.   
 Please make sure that your PHP you run from console has CURL enabled.

我在php.ini文件中启用了curl扩展,但结果保持不变。 我对此问题的任何帮助表示感谢。

1 个答案:

答案 0 :(得分:0)

我想,您在同一系统上使用的PHP版本超过一个。

在命令行php -m |grep curl中尝试。当输出为空时,当前php没有安装curl扩展。如果输出为“ curl”,则输出为“ curl”,您可以使用infront php调用codeception,这样可以确保使用路径中的php。

php codecept run

并且请确保最新以获取代码接收版本。