如何解决如何使用 PHP 7.4 Debian 10 Buster 启用 GD
使用以下内容安装 PHP 7.4.5:
git clone https://github.com/kasparsd/php-7-debian.git
cd php-7-debian
./build.sh
sudo ./install.sh
sudo /etc/init.d/php7-fpm start
sudo systemctl enable php7-fpm
sudo systemctl is-enabled php7-fpm
sudo apt install php-gd
sudo phpenmod gd
sudo systemctl restart nginx
sudo /etc/init.d/php7-fpm restart
sudo nginx -s reload
查找已安装的模块:
> php -m | grep gd
(no match)
php_info 配置
Configure Command './configure' '--prefix=/usr/local/php7' '--enable-huge-code-pages' '--with-config-file-scan-dir=/usr/local/php7/etc/conf.d' '--enable-bcmath' '--with-bz2' '--enable-calendar' '--enable-intl' '--enable-exif' '--enable-dba' '--enable-ftp' '--with-gettext' '--with-gd' '--with-jpeg-dir' '--enable-mbstring' '--with-mhash' '--enable-mysqlnd' '--with-mysqli' '--with-mysql-sock=yes' '--with-pdo-mysql' '--with-openssl' '--enable-pcntl' '--with-pspell' '--enable-shmop' '--enable-soap' '--enable-sockets' '--enable-sysvmsg' '--enable-sysvsem' '--enable-sysvshm' '--enable-wddx' '--with-zlib' '--enable-zip' '--without-libzip' '--with-readline' '--with-curl' '--enable-fpm' '--with-fpm-user=www-data' '--with-fpm-group=www-data'
php_info 提及 gd:
GD imaging: Rasmus Lerdorf,Stig Bakken,Jim Winstead,Jouni Ahto,Ilia Alshanetsky,Pierre-Alain Joye,Marcus Boerger
php_info 中没有用于 GD 的部分。
尝试: 我已经看到在 php 7.4 中需要 --gd-enable 但它没有显示在配置中。 安装尝试:
sudo apt install php-gd
sudo phpenmod gd
sudo systemctl restart php-fpm
sudo nginx -s reload
但没有运气...
替代尝试: 使用 ondrej/php 存储库。
sudo add-apt-repository ppa:ondrej/php
但我得到一个例外:
Exception in thread Thread-1:
Traceback (most recent call last):
File "/usr/lib/python3.7/threading.py",line 917,in _bootstrap_inner
self.run()
File "/usr/lib/python3.7/threading.py",line 865,in run
self._target(*self._args,**self._kwargs)
File "/usr/lib/python3/dist-packages/softwareproperties/SoftwareProperties.py",line 688,in addkey_func
func(**kwargs)
File "/usr/lib/python3/dist-packages/softwareproperties/ppa.py",line 386,in add_key
return apsk.add_ppa_signing_key()
File "/usr/lib/python3/dist-packages/softwareproperties/ppa.py",line 273,in add_ppa_signing_key
cleanup(tmp_keyring_dir)
File "/usr/lib/python3/dist-packages/softwareproperties/ppa.py",line 234,in cleanup
shutil.rmtree(tmp_keyring_dir)
File "/usr/lib/python3.7/shutil.py",line 491,in rmtree
_rmtree_safe_fd(fd,path,onerror)
File "/usr/lib/python3.7/shutil.py",line 449,in _rmtree_safe_fd
onerror(os.unlink,fullname,sys.exc_info())
File "/usr/lib/python3.7/shutil.py",line 447,in _rmtree_safe_fd
os.unlink(entry.name,dir_fd=topfd)
FileNotFoundError: [Errno 2] No such file or directory: 'S.gpg-agent.extra'
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。