Laravel 5.2 - 仅在实时服务器上找不到“GuzzleHttp \ Client”类

时间:2016-02-01 04:18:31

标签: php laravel-5 guzzle

我的配置/邮件'驱动程序'设置为mandrill,主机,端口等,包括在services.php mandrill secret set中。

发送邮件在本地工作正常,但在实时服务器上我得到:

  

未找到类'GuzzleHttp \ Client'

我试过“guzzlehttp / guzzle”:“~5.3 | ~6.0”,然后回到“guzzlehttp / guzzle”:“~4.0”,没有运气。我已经完成了作曲家更新,而dump-autoload在我的直播服务器上仍然没有运气。已经通过其他每个相关的Stackoverflow问题仍然无法解决。

2 个答案:

答案 0 :(得分:1)

请按照以下简单步骤操作:

首先:将此放在班级

use Guzzlehttp\Client;

第二:在您的功能中,而不是使用

$client = new Client();

使用

$client = new \GuzzleHttp\Client();

<强>参考:

http://docs.guzzlephp.org/en/latest/quickstart.html

答案 1 :(得分:-1)

尝试composer需要guzzlehttp / guzzle而不指定版本。为我工作