moved cakephp 1.3.8安装映像问题

z9smfwbn  于 2021-06-21  发布在  Mysql
关注(0)|答案(1)|浏览(256)

我正在尝试在服务器之间移动一个旧的cakephp1.3.8安装,并且有一些图像无法显示的问题。
旧服务器:ubuntu 14.04.5 lts apache 2.4.7 mysql 5.5 php 5.5.9 php(gd,mysql)
新服务器:centos 7.5.1804 apache 2.4.6 mysql 5.4 php 5.4 php(gd,mysql)
我已经验证了documentroot指向cake/app/webroot目录,并且在sites config中有allowoverride all指令。还验证了(3).htaccess文件、mod\u重写等。
在core.php中将debug设置为“2”,但记录的唯一错误是关于映像函数:

imagejpeg() [<a href='http://php.net/function.imagejpeg'>function.imagejpeg</a>]: Filename cannot be empty

每个项目页面上发生的事情的示例-
作业现场
非工作场所
其他一切,包括数据库访问都在工作。我对cakephp几乎一无所知,但在浏览各种文件时,我觉得这个函数是从views/projects目录下的文件'detail.ctp'调用的:

<?php echo $html->image('/App/ContentImageView/'.$image3.'/250/400',array('title'=>'Project Image', 'id'=>'MainImg', 'alt'=>'Project I    mage', 'class'=>'border2')); ?>

以及app\ u controller.php中的函数

function ContentImageView($img_path, $w = '75', $h = '75'){
    Configure::write('debug', 2);
    debug($img_path, $showHTML = true, $showFrom = true);
if (empty($img_path)) return;
    $image = str_replace('@@', '/', $img_path);
    if (empty($image)) return;
    $this->autoLayout = false;
    $this->autoRender = false;
    if(empty($image)) return;
    //image resize parameters
    $FileConfig = array();
    $FileConfig['source_image'] = WWW_ROOT . '/'. $image;
    $FileConfig['dynamic_output'] = true;
    $FileConfig['maintain_ratio'] = true;
    $FileConfig['width'] = $w;
    $FileConfig['height'] = $h;
    ini_set('memory_limit', -1)
    $this->ImageLib->clear();
    $this->ImageLib->set($FileConfig);
    $this->ImageLib->resize()
}

所有的代码在旧服务器上都能很好地工作,所以我认为这是某种配置路径问题,但我就是不能把手指放在上面。
谢谢大家。

jpfvwuh4

jpfvwuh41#

我用php5.3.3安装了centos6.9vm,但这个问题并不存在。正如ndm所指出的,必须是php的一个变化。而不是试图找出代码必须更新的地方,我们正在centos 6.9上前进,因为这个网站将很快退休无论如何。
再次感谢所有回应的人。

相关问题