Laravel 5.8.* 在生产环境中使用 GuzzleHttp
Laravel 5.8.* using GuzzleHttp on production
我在我的 laravel 项目中使用 GuzzHttp post 一些数据到 API。在我的本地环境中,我必须使用 cacert.pem 文件验证来创建我的客户端,如下所示:
$client = new \GuzzleHttp\Client(['verify' => 'C:\wamp64\bin\php\php7.2.14\cacert.pem']);
但我不能在我的共享主机上这样做。因此,删除该验证:
$client = new \GuzzleHttp\Client();
内部服务器错误的结果:
[2019-06-11 15:17:10] local.ERROR: GuzzleHttp\Exception\ServerException: Server error: `POST https://pruebas2.mayoristaseguridad.es/tiendaseguridad/02-ConectorLaravelPrestashop/ConectorCategorias.php` resulted in a `500 Internal Server Error` response in /home/admin/web/iberoseguridad.eu/public_html/csv_products/vendor/guzzle/guzzlehttp/guzzle/src/Exception/RequestException.php:113
有没有办法解决这个错误?
不确定这是否有帮助,反正就到这里
// Disable validation entirely (don't do this!).
$client->request('GET', '/', ['verify' => false]);
这最终是远程服务器错误,不是我的。我只需要与服务器的维护者沟通这个错误,现在它工作得很好。
我在我的 laravel 项目中使用 GuzzHttp post 一些数据到 API。在我的本地环境中,我必须使用 cacert.pem 文件验证来创建我的客户端,如下所示:
$client = new \GuzzleHttp\Client(['verify' => 'C:\wamp64\bin\php\php7.2.14\cacert.pem']);
但我不能在我的共享主机上这样做。因此,删除该验证:
$client = new \GuzzleHttp\Client();
内部服务器错误的结果:
[2019-06-11 15:17:10] local.ERROR: GuzzleHttp\Exception\ServerException: Server error: `POST https://pruebas2.mayoristaseguridad.es/tiendaseguridad/02-ConectorLaravelPrestashop/ConectorCategorias.php` resulted in a `500 Internal Server Error` response in /home/admin/web/iberoseguridad.eu/public_html/csv_products/vendor/guzzle/guzzlehttp/guzzle/src/Exception/RequestException.php:113
有没有办法解决这个错误?
不确定这是否有帮助,反正就到这里
// Disable validation entirely (don't do this!). $client->request('GET', '/', ['verify' => false]);
这最终是远程服务器错误,不是我的。我只需要与服务器的维护者沟通这个错误,现在它工作得很好。