命令行显示扩展“gd”已启用,但 WordPress 表示未启用。终端和 phpinfo() 显示不同的 PHP 版本

命令行显示扩展“gd”已启用,但 WordPress 表示未启用。终端和 phpinfo() 显示不同的 PHP 版本

php -v正在显示5.5.9 phpinfo()正在显示5.6.22

WordPress 报告说我必须启用gdimagic扩展才能进行图像处理。

配置命令phpinfo()显示以下内容:

'./configure' '--cache-file='''/home/subrara/.phpbrew/cache/config.cache'''' '--prefix=/home/subrara/.phpbrew/php/php-5.6.22' '--with-config-file-path=/home/subrara/.phpbrew/php/php-5.6.22/etc' '--with-config-file-scan-dir=/home/subrara/.phpbrew/php/php-5.6.22/var/db' '--disable-all' '--enable-session' '--enable-short-tags' '--with-zlib=/usr' '--with-libdir=lib/x86_64-linux-gnu' '--with-mysql=mysqlnd' '--with-mysqli=mysqlnd' '--with-pdo-mysql=mysqlnd' '--with-mysql-sock=/var/run/mysqld/mysqld.sock' '--with-curl=/usr' '--enable-json' '--with-gd=shared,/usr' '--enable-gd-native-ttf' '--with-jpeg-dir=/usr' '--with-png-dir=/usr' '--with-freetype-dir=/usr' '--enable-ftp' '--with-apxs2=/usr/bin/apxs2' '--enable-libxml' '--enable-simplexml' '--enable-xml' '--enable-xmlreader' '--enable-xmlwriter' '--with-xsl' '--with-libxml-dir=/usr' '--启用-opcache' '--启用-bcmath' '--with-bz2=/usr' '--启用-calendar' '--启用-cli' '--启用-ctype' '--启用-dom' '--启用-fileinfo' '--启用-filter' '--启用-shmop' '--启用-sysvsem' '--启用-sysvshm' '--启用-sysvmsg' '--启用-mbregex' '--启用-mbstring' '--with-mhash=/usr' '--with-mcrypt=/usr' '--启用-pcntl' '--with-pcre-regex' '--with-pcre-dir=/usr' '--启用-pdo' '--启用-phar' '--enable-posix' '--with-readline=/usr' '--enable-sockets' '--enable-tokenizer' '--with-openssl=/usr' '--enable-zip' '--with-pear=/home/subrara/.phpbrew/php/php-5.6.22/lib/php'

我不太明白上述内容。

从终端(Ubuntu 14.04),当我运行时sudo apt-get install php5-gd,它说

php5-gd已经是最新版本。

据我所知,该phpinfo()版本是我在运行任何 PHP / WordPress 网站时应该考虑的版本,并且似乎我需要安装并启用这些扩展5.6.22,但我不知道如何!

的输出php -i | grep 'GD\|ImageMagick'是:

GD Support => enabled
GD Version => 2.1.1-dev
GDM_LANG => en_US
GDMSESSION => ubuntu
_SERVER["GDM_LANG"] => en_US
_SERVER["GDMSESSION"] => ubuntu

在这种情况下,我该如何启用gd5.6.22imagic版本的扩展?

编辑:
是否可以安装 php7 及其所需的扩展并使用它?这会给在 localhost 中构建的网站运行带来麻烦吗?

相关内容