1. 程式人生 > >Lnmp1.4 一鍵安裝包 安裝php readline擴充套件

Lnmp1.4 一鍵安裝包 安裝php readline擴充套件

composer install出現的問題

Problem 1
    - d11wtq/boris v1.0.10 requires ext-readline * -> the requested PHP extension readline is missing from your system.
    - d11wtq/boris v1.0.10 requires ext-readline * -> the requested PHP extension readline is missing from your system.
    - Installation request for d11wtq/boris v1.0.10 -> satisfiable by d11wtq/boris[v1.0.10].

  To enable extensions, verify that they are enabled in your .ini files:
    - /usr/local/php/etc/php.ini
    - /usr/local/php/conf.d/002-zendguardloader.ini
  You can also run `php --ini` inside terminal to see which files are used by PHP in CLI mode.

出現這種問題的原因為

php缺少readline拓展

解決辦法

cd ~/lnmp1.4/src/php-7.1.7/ext/readline
phpize
./configure -with-php-config=/usr/local/php/bin/php-config
make && make install
// 將   extension = readline.so        加入php.ini
// 如果出現問題
configure: error: Please reinstall libedit - I cannot find readline.h
// 解決
wget http://thrysoee.dk/editline/libedit-20170329-3.1.tar.gz
tar -xf libedit-20170329-3.1.tar.gz
cd libedit-20170329-3.1
phpize
./configure -with-php-config=/usr/local/php/bin/php-config
make && make install