某些同学在执行php composer.phar install
时,出现错误
90%可能是漏装了PHP的fileinfo扩展了,用宝塔的请直接在宝塔里安装
wget http://us.php.net/get/php-7.1.13.tar.gz/from/this/mirror && mv mirror php-7.1.13.tar.gz
tar zxvf php-7.1.13.tar.gz && cd php-7.1.13/ext
cp -r fileinfo/ /usr/local/php/include/php/ext/
cd /usr/local/php/include/php/ext/fileinfo
/usr/local/php/bin/phpize
./configure
此步骤可能会出现错误:configure: error: Cannot find php-config. Please use --with-php-config=PATH
出现这种情况就找到php-config,用下面这个:
./configure --with-php-config=/usr/local/php/bin/php-config
make && make install
Installing shared extensions: /usr/local/php/lib/php/extensions/no-debug-non-zts-20160303/
extension=/usr/local/php/lib/php/extensions/no-debug-non-zts-20160303/fileinfo.so
service php-fpm restart