【发布时间】:2020-02-04 12:58:20
【问题描述】:
尝试在 localhost 中运行应用程序时,我加载 cafile 流失败:`C:\wamp64\bin\php\php7.2.18\extras\ssl\cacert.pem' 但我设置了我的 php.ini:
curl.cainfo ="C:\wamp64\bin\php\php7.2.18\extras\ssl\cacert.pem"
openssl.cafile="C:\wamp64\bin\php\php7.2.18\extras\ssl\cacert.pem"
我的代码:-
<?php
use Illuminate\Support\Carbon;
use Intervention\Image\Facades\Image;
use Goutte\Client;
Route::get('/', function () {
$client = new Client();
$crawler = $client->request('GET', 'https://laracasts.com/skills/laravel');
$crawler->filter('img')->each(
/**
* @param $node
*/
function ($node) {
$currentData = carbon::now()->toDateString();
$img = $node->attr('src');
$imageName = pathinfo($img, PATHINFO_EXTENSION);
$image = $currentData . "-" . uniqid() . "." . $imageName;
$file = file_get_contents('https://laracasts.com/skills/laravel');
// $save =file_put_contents( public_path('image/'.$image),$file);
}
);
return view('welcome');
});
我是一个学习编码的新手,请在这方面帮助我。
【问题讨论】:
-
请添加您的代码