通过pecl的lua php扩展安装失败

MacOS High Sierra

php 7.1

pecl install lua (fails with the following error)

Error:

checking for lua in default path... not found configure: error: Please reinstall the lua distribution - lua.h should be in /include/ ERROR: `/private/tmp/pear/temp/lua/configure --with-php-config=/usr/local/opt/php@7.1/bin/php-config' failed

solution:

pecl download lua

tar xvzf lua-2.0.4.tgz

cd lua-2.0.4

phpize

EDIT "configure" script, find line where lib paths are declared (search for "/usr/lib64 ..." ), add "/usr/local/lib" path, proceed with installation

./configure

make

make install

add path to "lua.so" to your php.ini file