0

我在 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安装什么?

或者更好,我应该用什么代替imagecreatefromjpeg

有任何想法吗?

extension=php_gd2.dll在我的 php.ini 中启用了。

但我仍然收到此错误:

未捕获的错误:调用 /var/w 中未定义的函数 imagecreatefromjpeg()

4

1 回答 1

0

根据PHP.net http://php.net/manual/en/image.installation.php#120116

sudo apt-get install php7.0-gd

于 2017-05-18T11:26:02.573 回答