PHP 文件未从 /tmp 移动

PHP Files are not moving from /tmp

在我的 link 中,图像没有显示,因为它们没有从 /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、阿帕奇 2.4.6、PHP5.4.16、Laravel 4.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)。