In the linux environment, composer installs laravel common errors and solutions

1. When composer executes update, etc., an error is reported:

“laravel/framework v5.4.21 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system”

The problem is that the mbstring extension is not installed when php is compiled.

Workaround: Install the mbstring extension

1. cd to the source code package after initial decompression of php.

cd /usr/local/src/php-5.6.29/ext/mbstring

2. Find phpize

find /usr -name phpize

3. Execute the phpize found in the above steps in the current directory

/usr/local/php/bin/phpize

4. Compile and install the mbstring extension

./configure --with-php-config=/usr/local/php/bin/php-config
make
make install

At this time, you can see the path displayed after "make install", such as ll usr/local/php/lib/php/extensions/no-debug-zts-20131226/, you can see the mbstring.so extension generated after compilation

5. Add the extension and restart php-fpm

Add extension=mbstring.so in php.ini. My own php.ini is at /usr/local/php/lib/php.ini

vi /usr/local/php/lib/php.ini 
在最后添加  extension=mbstring.so

Restart the web server. such as nginx

restart php-fpm

killall php-fpm
service php-fpm start
service php-fpm restart

 

Second, the zip extension is not installed

“Failed to download symfony/css-selector from dist: The zip extension and unzip command are both missing, skipping.
The php.ini used by your command-line PHP is: /usr/local/php/lib/php.ini
    Now trying to download from source”

The steps here are the same as in question 1, the mbstring extension is not installed. just cd to 

cd /usr/local/src/php-5.6.29/ext/zip

....

Finally add in php.ini

vi /usr/local/php/lib/php.ini 
在最后添加  extension=zip.so

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325426693&siteId=291194637