原文:http://blog.csdn.net/Iloveyougirls/article/details/74276548
原文:https://stackoverflow.com/questions/39384644/extension-gd-is-missing-from-your-system-laravel-composer-update
(推荐:)英文全攻略:https://askubuntu.com/questions/764782/install-laravel-5-on-ubuntu-16-04
脚本支持:https://github.com/emilas44/laravel-5.4-on-Ubuntu/blob/master/script.sh
一、安装PHP常用的扩展
1.PHP扩展:Openssl
sudo apt-get install openssl
2.PHP扩展:PDO
sudo apt-get install pdo_mysql
3.PHP扩展:Mbstring
sudo apt-get install php-mbstring
4.PHP扩展:Tokenizer
sudo apt-get install php-mbstring
5.PHP扩展:XML
![](/qrcode.jpg)
sudo apt-get install php-xml
6.PHP扩展:GD
sudo apt-get install php-gd
再装gd扩展时要注意,php.ini中默认没有引入扩展文件,在/etc/php/7.0/apache2/php.ini文件中找到extension_dir = “ext”,然后去掉前面的分号”;”
二、找到php.ini文件,开启这些常用的扩展才生效
1.进入目录
cd /etc/php/7.0/apache2
2.打开php.ini
sudo vi php.ini
3.按i进行编辑,找到这些扩展,去掉前面的分号(;)
4.按Esc,然后键入:wq突出并保存
5.重启apache
sudo service apache2 restart
注意:使用Linux时,一定注意权限问题,/var/www目录一定要给权限,不然还是无法访问项目
老外的处理:
Open your php.ini and uncomment this line:
;extension=php_gd2.dll
I have installed php7, I did the following to solve exactly the same error
sudo apt-get install php7.0-gd
sudo apt-get install php7.0-intl
sudo apt-get install php7.0-xsl
I have installed php7, I did the following to solve exactly the same error
sudo apt-get install php7.0-gd
sudo apt-get install php7.0-intl
sudo apt-get install php7.0-xsl
sudo apt-get install php7.0-bcmath
sudo apt-get install php7.0-bz2
sudo apt-get install php7.0-calendar
sudo apt-get install php7.0-ctype
sudo apt-get install php7.0-curl
sudo apt-get install php7.0-dom
sudo apt-get install php7.0-enchant
sudo apt-get install php7.0-exif
sudo apt-get install php7.0-fileinfo
sudo apt-get install php7.0-ftp
sudo apt-get install php7.0-gd
sudo apt-get install php7.0-gettext
sudo apt-get install php7.0-gmp
sudo apt-get install php7.0-iconv
sudo apt-get install php7.0-intl
sudo apt-get install php7.0-json
sudo apt-get install php7.0-ldap
sudo apt-get install php7.0-mbstring
sudo apt-get install php7.0-mysqli
sudo apt-get install php7.0-mysqlnd
sudo apt-get install php7.0-opcache
sudo apt-get install php7.0-pdo
sudo apt-get install php7.0-phar
sudo apt-get install php7.0-posix
sudo apt-get install php7.0-pspell
sudo apt-get install php7.0-readline
sudo apt-get install php7.0-shmop
sudo apt-get install php7.0-simplexml
sudo apt-get install php7.0-snmp
sudo apt-get install php7.0-soap
sudo apt-get install php7.0-sockets
sudo apt-get install php7.0-sqlite3
sudo apt-get install php7.0-sysvmsg
sudo apt-get install php7.0-sysvsem
sudo apt-get install php7.0-sysvshm
sudo apt-get install php7.0-wddx
sudo apt-get install php7.0-xml
sudo apt-get install php7.0-xsl
以下不能一次性全部安装,因为要选y
sudo apt-get install php7.0-recode
sudo apt-get install php7.0-dba
sudo apt-get install php7.0-imap
sudo apt-get install php7.0-interbase
sudo apt-get install php7.0-odbc
sudo apt-get install php7.0-pgsql
sudo apt-get install php7.0-tidy
sudo apt-get install php7.0-zip
以下部分无法安装
我使用的是ubuntu 16.04 32位系统,如果有不同情况还请不宁赐教,
xmlreader
xmlrpc
xmlwriter
pdo_dblib
pdo_firebird
pdo_mysql
pdo_oci
pdo_odbc
pdo_pgsql
pdo_sqlite
com_dotnet
date
filter
hash
libxml
mcrypt
oci8
openssl
pcntl
pcre
reflection
session
skeleton
spl
standard
vtokenizer
zlib
php-7.0 扩展列表
bcmath
bz2
calendar
com_dotnet
ctype
curl
date
dba
dom
enchant
exif
fileinfo
filter
ftp
gd
gettext
gmp
hash
iconv
imap
interbase
intl
json
ldap
libxml
mbstring
mcrypt
mysqli
mysqlnd
oci8
odbc
opcache
openssl
pcntl
pcre
pdo
pdo_dblib
pdo_firebird
pdo_mysql
pdo_oci
pdo_odbc
pdo_pgsql
pdo_sqlite
pgsql
phar
posix
pspell
readline
recode
reflection
session
shmop
simplexml
skeleton
snmp
soap
sockets
spl
sqlite3
standard
sysvmsg
sysvsem
sysvshm
tidy
vtokenizer
wddx
xml
xmlreader
xmlrpc
xmlwriter
xsl
zip
zlib