©
Ce document utilise Manuel du site Web PHP chinois Libérer
此 » PECL 扩展未与 PHP 捆绑。
安装此 PECL 扩展相关的信息可在手册中标题为 PECL 扩展的安装章节中找到。更多信息如新的发行版本、下载、源文件、 维护人员信息及变更日志等,都在此处: » http://pecl.php.net/package/lua.
PECL 扩展的 DLL 当前不可用。参见 在 Windows 上构建章节。
[#1] rutgerspeksnijder at hotmail dot com [2015-10-26 13:07:51]
Ignore my previous note, I forgot to add in where to use the PECL command to install phplua.
Installation on Ubuntu 14.04
"*.*" means version number
Packages to install (sudo apt-get install):
Install php5
Install php-pear
Install php5-dev
Install lua*.*
Install liblua*.*
Create soft link of /usr/include/lua TO /usr/include/lua*.*:
sudo ln -s /usr/include/lua*.*/ /usr/include/lua
Find liblua*.*.so and liblua*.*.a files in /usr/lib.
If they don't exist, they could be in /usr/lib/x86_64-linux-gnu or /usr/lib/i386-linux-gnu depending on OS.
Copy them from that directory into /usr/lib as liblua.so and liblua.a (WITHOUT VERSION NUMBER).
Example:
sudo cp /usr/lib/x86_64-linux-gnu/liblua5.2.a /usr/lib/liblua.a
Now execute the following command (1.1.0 is the version at the time of writing this):
sudo pecl install lua-1.1.0
Add extension=lua.so to php.ini file (could be /etc/php5/(cli/apache)/php.ini)
Hope this helps.
[#2] rutgerspeksnijder at hotmail dot com [2015-10-26 13:04:42]
Installation on Ubuntu 14.04
"*.*" means version number
Packages to install (sudo apt-get install):
Install php5
Install php-pear
Install php5-dev
Install lua*.*
Install liblua*.*
Create soft link of /usr/include/lua TO /usr/include/lua*.*:
sudo ln -s /usr/include/lua*.*/ /usr/include/lua
Find liblua*.*.so and liblua*.*.a files in /usr/lib.
If they don't exist, they could be in /usr/lib/x86_64-linux-gnu or /usr/lib/i386-linux-gnu depending on OS.
Copy them from that directory into /usr/lib as liblua.so and liblua.a (WITHOUT VERSION NUMBER).
Example:
sudo cp /usr/lib/x86_64-linux-gnu/liblua5.2.a /usr/lib/liblua.a
Add extension=lua.so to php.ini file (could be /etc/php5/(cli/apache)/php.ini)
Hope this helps.
[#3] rutgerspeksnijder at hotmail dot com [2015-10-26 13:02:54]
Installation on Ubuntu 14.04
"*.*" means version number
Packages to install (sudo apt-get install):
Install php5
Install php-pear
Install php5-dev
Install lua*.*
Install liblua*.*
Create soft link of /usr/include/lua TO /usr/include/lua*.*:
sudo ln -s /usr/include/lua*.*/ /usr/include/lua
Find liblua*.*.so and liblua*.*.a files in /usr/lib.
If they don't exist, they could be in /usr/lib/x86_64-linux-gnu or /usr/lib/i386-linux-gnu depending on OS.
Copy them from that directory into /usr/lib as liblua.so and liblua.a (WITHOUT VERSION NUMBER).
Example:
sudo cp /usr/lib/x86_64-linux-gnu/liblua5.2.a /usr/lib/liblua.a
Add extension=lua.so to php.ini file (could be /etc/php5/(cli/apache)/php.ini)
Hope this helps.
[#4] posti at taitavasti dot fi [2013-04-15 13:29:30]
Simple guide to install phplua on CentOS 6.3:
Run these commands in terminal as root:
$yum install php-pear php-devel gcc lua-devel lua-static
$mkdir /usr/include/lua
$ln -s /usr/include/lua.h /usr/include/lua/lua.h
$pecl install lua-1.0.0
Then edit /etc/php.ini and add the following line below the similar ones:
extension=lua.so
Finally restart your web server and you should be all done!
I spent days googling around, trying and failing and gathering up what needs to be installed when you just have apache2 and php5 installed and working.
Thus there is this bug preventing pecl from finding lua.h, which is fixed by the symlink created above. The bug is already submitted:
https://bugs.php.net/bug.php?id=60641
Hope this info helps some body else too!