問題現象:
[root@localhost magento2]# pwd
/home/wwwroot/default/magento2
[root@localhost magento2]# composer install
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Warning: The lock file is not up to date with the latest changes in composer.json. You may be getting outdated dependencies. Run update to
update them.
Your requirements could not be resolved to an installable set of packages.
Problem 1
- The requested PHP extension ext-intl * is missing from your system. Install or enable PHP's intl extension.
Problem 2
- The requested PHP extension ext-xsl * is missing from your system. Install or enable PHP's xsl extension.
解決問題:
進入cd /home/freeman/tools/lnmp1.2-full/src/php-5.6.9/ext/intl/
執行$phpize && ./configure --with-php-c/local/php/bin/php-config && make && make install
在這個configure的過程中會出現錯誤,安裝相應的lib就行。
$yum install libicu-devel -y
$yum install libxslt-devel -y
cd /home/freeman/tools/lnmp1.2-full/src/php-5.6.9/ext/xsl/
$phpize && ./configure --with-php-c/local/php/bin/php-config && make && make install
修改php.ini
$vi /usr/local/php/etc/php.ini
增加:
extension=xsl.so
extension=intl.so
然後重啟php服務/etc/init.d/php-fpm restart
再回到/home/wwwroot/magento2下面執行
$composer install
[root@localhost magento2]# composer install
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
- Installing magento/magento-composer-installer (0.1.5)
Downloading: 100%
- Installing braintree/braintree_php (2.39.0)
Downloading: 100%
這樣就成功了。
以上就介紹了如何解決magento2安裝過程中缺少兩個php擴充的問題:ext-intl和ext-xsl,包括了方面的內容,希望對PHP教程有興趣的朋友有所協助。