laruence / php-lua

This extension embeds the lua interpreter and offers an OO-API to lua variables and functions.
http://pecl.php.net/package/lua
Other
149 stars 50 forks source link

Error installing on Mac OS #45

Closed marvinrabe closed 4 years ago

marvinrabe commented 5 years ago

I get this error when trying to install:

pecl install lua
checking for lua support... yes, shared
checking to specify a custom lua version... yes, shared
checking to specify a custom lua version... yes, shared
checking for lua in default path... found in /usr/local
checking for lua library in default path... not found
configure: error: Please reinstall the lua distribution - lua library should be in <lua-dir>/lib/
ERROR: `/private/tmp/pear/temp/lua/configure --with-php-config=/usr/local/opt/php/bin/php-config' failed

I have installed lua with homebrew brew install lua it is available in version 5.3.5

Lua is available at /usr/local/include/lua/lua.h

~ $ cd /usr/local/include/lua
lua $ ls -l
total 120
-rw-r--r--  1 marvin  staff   8632 26 Jun  2018 lauxlib.h
-rw-r--r--  1 marvin  staff  14837 26 Jun  2018 lua.h
-rw-r--r--  1 marvin  staff    191 26 Jun  2018 lua.hpp
-rw-r--r--  1 marvin  staff  21644  8 Jun 23:35 luaconf.h
-rw-r--r--  1 marvin  staff   1305 26 Jun  2018 lualib.h

And library at /usr/local/lib/liblua.dylib

lua $ ls -l /usr/local/lib/ | grep lua
lrwxr-xr-x    1 marvin  admin    44  8 Jun 23:35 liblua.5.3.5.dylib -> ../Cellar/lua/5.3.5_1/lib/liblua.5.3.5.dylib
lrwxr-xr-x    1 marvin  admin    42  8 Jun 23:35 liblua.5.3.dylib -> ../Cellar/lua/5.3.5_1/lib/liblua.5.3.dylib
lrwxr-xr-x    1 marvin  admin    38  8 Jun 23:35 liblua.dylib -> ../Cellar/lua/5.3.5_1/lib/liblua.dylib
lrwxr-xr-x    1 marvin  admin    41  8 Jun 23:35 liblua5.3.dylib -> ../Cellar/lua/5.3.5_1/lib/liblua5.3.dylib

PHP Version 7.3.4 and Mac OS Version 10.14.4

marvinrabe commented 5 years ago

I found a workaround by creating a link:

sudo ln -s /usr/local/lib/liblua.dylib /usr/lib/liblua.dylib

After that the installation works.

But somehow the library in /usr/local is not found.

Fuitad commented 5 years ago

This worked for me: https://stackoverflow.com/questions/50214769/lua-php-extension-installation-via-pecl-fails