Php Mac上的GD库:“;未定义的函数干预\Image\Gd\imagecreatefrompng();

Php Mac上的GD库:“;未定义的函数干预\Image\Gd\imagecreatefrompng();,php,macos,laravel,gd,Php,Macos,Laravel,Gd,我在一个laravel项目中面临一些GD问题。我的phpinfo说GD已启用,但我得到了“undefined function interference\Image\GD\imagecreatefrompng()”错误 当我尝试执行此操作时,我正在处理这些问题: public function update(Request $request, $id) { //Show the image echo '<img src="'.$_POST['img_val'].'" />

我在一个laravel项目中面临一些GD问题。我的phpinfo说GD已启用,但我得到了“undefined function interference\Image\GD\imagecreatefrompng()”错误

当我尝试执行此操作时,我正在处理这些问题:

public function update(Request $request, $id)
{

  //Show the image
  echo '<img src="'.$_POST['img_val'].'" />';

  //Get the base-64 string from data
  $filteredData=substr($_POST['img_val'], strpos($_POST['img_val'], ",")+1);

  //Decode the string
  $unencodedData=base64_decode($filteredData);

  //Save the image
  $storagepath = storage_path('app/images/users/' . Auth::user()->id);
  $imgoutput = File::put($storagepath.'/flyer2.png', $unencodedData);


  return view('backend.flyers.index')->withImgoutput($imgoutput);
                                     //->withStoragepath($storagepath);

}
公共功能更新(请求$Request,$id)
{
//显示图像
回声';
//从数据中获取base-64字符串
$Filteredata=substr($邮政['img\u val'],strpos($邮政['img\u val'],“,”)+1);
//解码字符串
$unencodedData=base64_解码($filteredData);
//保存图像
$storagepath=存储路径('app/images/users/'.Auth::user()->id);
$imgoutput=File::put($storagepath.'/flyer2.png',$unencodedData);
返回视图('backend.flyers.index')->带有imgoutput($imgoutput);
//->带存储路径($storagepath);
}

在执行过程中的什么时候会收到错误消息?我正在将图像保存在laravel项目的文件夹中。当我尝试在浏览器中查看图像时,收到错误消息。Photoshop还告诉我该文件已损坏。如果你有任何与此问题相关的代码或设置,你也应该发布它们。我帮不了你,因为我对laravel一无所知,但是你写得越好,你得到答案的可能性就越大。公共函数更新(Request$Request,$id){//显示图像回显“”;//从数据$filteredata=substr($\u POST['img\u val',strpos($\u POST['img\u val',“,”)+1)获取base-64字符串;//解码字符串$unnecodedata=base64_Decode($filteredata);$storagepath=storage_path('app/images/users/'.Auth::user()->id);$imgoutput=File::put($storagepath./flyer.jpg',$unnecodedata);返回视图('backend.flyers.index')->带imgoutput($imgoutput);//->带存储路径($storagepath)这是我用来保存图像的函数。通过尝试在我的浏览器中查看它,我收到了错误消息。在执行的什么时候,您收到了错误消息?我正在将图像保存在laravel项目的文件夹中。当我尝试在浏览器中查看图像时,收到错误消息。Photoshop还告诉我该文件已损坏。如果你有任何与此问题相关的代码或设置,你也应该发布它们。我帮不了你,因为我对laravel一无所知,但是你写得越好,你得到答案的可能性就越大。公共函数更新(Request$Request,$id){//显示图像回显“”;//从数据$filteredata=substr($\u POST['img\u val',strpos($\u POST['img\u val',“,”)+1)获取base-64字符串;//解码字符串$unnecodedata=base64_Decode($filteredata);$storagepath=storage_path('app/images/users/'.Auth::user()->id);$imgoutput=File::put($storagepath./flyer.jpg',$unnecodedata);返回视图('backend.flyers.index')->带imgoutput($imgoutput);//->带存储路径($storagepath)这是我用来保存图像的函数。通过尝试在浏览器中查看,我收到了错误消息