错误codeception需要安装CURL扩展

错误codeception需要安装CURL扩展,curl,laravel,codeception,laravel-5,Curl,Laravel,Codeception,Laravel 5,好的,我正在使用Laravel5阅读关于Larabook的系列教程,我一直在尝试使用Codeception。我的laravel应用程序文件夹名为“larabook” 从my larabook文件夹运行vendor/bin/codecept可以正确地为我提供选项列表。然后我初始化了它,它就工作了。我按照说明创建了一个SignUpCept.php文件,并用以下内容填充它 <?php $I = new FunctionalTester($scenario); $I->am('a gue

好的,我正在使用Laravel5阅读关于Larabook的系列教程,我一直在尝试使用Codeception。我的laravel应用程序文件夹名为“larabook”

从my larabook文件夹运行vendor/bin/codecept可以正确地为我提供选项列表。然后我初始化了它,它就工作了。我按照说明创建了一个SignUpCept.php文件,并用以下内容填充它

<?php 

$I = new FunctionalTester($scenario);
$I->am('a guest');
$I->wantTo('Sign up for a Larabook acount');

$I->amOnPage('/');
$I->click('Sign Up');
$I->seeCurrentUrlEquals('/register');

$I->fillField('Username:', 'JohnDoe');
$I->fillField('Email:', 'john@example.com');
$I->fillField('Password:', 'demo');
$I->fillField('Password Confirmation:', 'demo');
$I->click('Sign Up');

$I->seeCurrentUrlEquals('');
$I->see('Welcome to Larabook!');
现在如果我输入curl--help,我会得到选项列表,这意味着它安装正确,那么为什么会发生这种情况呢?我正在使用windows和vagrant、virtualbox和laravel 5

我的“tests”文件夹位于我的larabook文件夹的根目录中,我的codeception.yml文件如下所示

actor: Tester
paths:
    tests: tests
    log: tests/_output
    data: tests/_data
    helpers: tests/_support
settings:
    bootstrap: _bootstrap.php
    colors: false
    memory_limit: 1024M
modules:
    config:
        Db:
            dsn: ''
            user: ''
            password: ''
            dump: tests/_data/dump.sql
我还在larabook的根目录中正确设置了.env.testing.php。

正在运行

$ curl --help 
表示系统上已安装unix命令行curl程序

这也意味着您的系统上安装了unix curl库

并不意味着您的PHP系统上安装了PHP curl扩展

使用以下PHP代码创建一个小测试文件

phpinfo();
它将列出PHP已安装的所有扩展。我猜PHP curl扩展没有安装


请记住,您正在使用的PHP的命令行版本可能与您正在使用的PHP的web版本不同

正如@Alan所说,如果您没有安装curl for php,在我遇到类似错误的情况下,我只是将其与此一起安装(在Ubuntu 15.10上),然后运行codeception测试

sudo apt-get install php5-curl
备注:如果您已经使用root访问权限,则不需要sudo

如果您正在使用,则可以安装curl扩展:

phpbrew ext install curl
如果出现错误,请安装此库:

sudo apt install libcurl4-openssl-dev

注意:这个解决方案是在Ubuntu 16上测试的

Ahh好的,我知道我必须在php.ini中启用扩展。谢谢
sudo apt install libcurl4-openssl-dev