PHP 文件不会从 /tmp 移动


PHP Files are not moving from /tmp

在我的链接中,图像没有显示,因为它们没有从/tmp移动到指定的目录。php 脚本指针是正确的,并且已经用 file_exists() 验证了这一点。此外,处理图像的脚本在我的机器上正常工作。

我已经检查了 php.net 中定义的所有 php.ini 设置;file_uploads、upload_max_filesize、upload_tmp_dir、post_max_size和max_input_time

我还检查了/tmp的文件模式和上传目录。全部经验证为777。

我已经检查了 php error_log,没有错误。

任何想法都很感激,我已经在上面呆了 6 个小时,没有任何进展......

服务器/应用程序详细信息:CentOS7, Apache 2.4.6, PHP 5.4.16, Laravel4.2

负责此的代码:

public function createTN($image) {
    # Load Zebra Image Library
    require_once public_path().'/uploads/Zebra_Image.php';
    $destinationPath = public_path().'/uploads/thumbnails/';
    $tn = new Zebra_Image();
    $tn->source_path = $image->getRealPath();
    $tn->target_path = $destinationPath.$this->name.'.jpg';
    $tn->jpeg_quality = 60;
    $tn->preserve_aspect_ratio = true;
    $tn->enlarge_smaller_images = true;
    $tn->resize(100, 100, ZEBRA_IMAGE_CROP_CENTER);
}

PS:public_path()是正确的

确保安装了libgd!

http://libgd.github.io/

http://php.net/manual/en/book.image.php

CentOS 用户

  1. yum install gd gd-devel php-gd
  2. 重新启动http服务器(在我的例子中是apache)。