我有一个问题,可以让PHP的肥皂在我的Laravel工作中工作。我创建了可划分的作业,其中我用use SoapClient
导入肥皂,但Laravel无法找到它。
但是,当我在控制器中使用肥皂量时,它可以完美地工作。
我检查了phpini():肯定会启用肥皂。
有什么想法?
我的工作代码:
<?php
namespace AppJobs;
use SoapClient;
use TymonJWTAuthExceptionsJWTException;
use JWTAuth;
use IlluminateBusQueueable;
use IlluminateQueueSerializesModels;
use IlluminateQueueInteractsWithQueue;
use IlluminateContractsQueueShouldQueue;
use IlluminateFoundationBusDispatchable;
class ProcessQueuedRenderRequests implements ShouldQueue
{
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
public function __construct()
{
}
public function handle()
{
$soap = new SoapClient("http://mywsdl");
...
errorlog:
[[2017-11-22 18:17:50] local.ERROR: SymfonyComponentDebugExceptionFatalThrowableError: Class 'SoapClient' not found in /var/www/app/Jobs/ProcessQueuedRenderRequests.php:44
我将Docker与Laradock配置一起使用。便宜的IST以这种方式开始:
docker-compose exec workspace bash
php artisan queue:listen
使用 $soap = new SoapClient("http://mywsdl");
我曾经遇到过同样的问题。
找到了问题。肥皂没有安装在工作区容器中。
当我这样启动便利座时,它有效:
docker-compose exec php-fpm bash
php artisan queue:listen
仍然有点奇怪,因为还应根据我的.env文件安装在工作区容器中。