[英]Class Amp non found
I'm new on amphp and i'd like to try this very simple code first.我是 amphp 的新手,我想先试试这个非常简单的代码。 I downloaded amphp with composer for windows and save all folder created inside my project folder.
我用作曲家为 windows 下载了 amphp 并保存在我的项目文件夹中创建的所有文件夹。
composer require amphp/http-client
Then my code is:然后我的代码是:
<?php
require __DIR__ . './autoload.php';
use Amp\Http\Client\HttpClientBuilder;
use Amp\Http\Client\HttpException;
use Amp\Http\Client\Request;
use Amp\Http\Client\Response;
use Amp\Loop;
$stringa = 'http://www.google.it/';
$request = new Request($stringa, "GET");
$location = $request->getHeader("Location");
var_dump($location);
But I get always 'Fatal error: Uncaught Error: Class 'Amp\Http\Client\Request' not found'但我总是得到'致命错误:未捕获的错误:Class'Amp\Http\Client\Request'未找到'
Any suggest?有什么建议吗?
I use wamp local server with php 7.0我使用带有 php 7.0 的 wamp 本地服务器
Also,after, I need to yield
all the code...另外,之后,我需要
yield
所有代码......
Here are a few things that look for:以下是一些需要寻找的东西:
autoload.php
get included correctly? autoload.php
是否正确包含在内?
.
.
before /autoload.php
./autoload.php
之前。composer require amphp/http-client
so that the libraries will be installed?composer require amphp/http-client
以便安装这些库?vendor/amphp/http-client
directory?vendor/amphp/http-client
目录中?\
in the require
statement.require
语句中使用\
。 Apart from these, I can't think of why the library won't load.除此之外,我想不出为什么图书馆不会加载。 I hope this helps.
我希望这有帮助。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.