我在php7上,但我有一个遗留程序使用:
imagecreatefromjpeg($filename)
所以我尝试安装:
$ sudo apt-get install php5-gd
没有结果:
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package php5-gd is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package 'php5-gd' has no installation candidate
我应该为php7安装什么?
或者更好的是,我应该用{<1}}替换什么?
有什么想法吗?
我在php.ini中启用了imagecreatefromjpeg
。
但我仍然会收到此错误:
未捕获错误:调用未定义的函数imagecreatefromjpeg()in 的/ var /瓦特
答案 0 :(得分:1)
根据PHP.net http://php.net/manual/en/image.installation.php#120116
sudo apt-get install php7.0-gd