buildroot httpd php

时间:2023-12-22 21:47:02
/********************************************************************
* buildroot httpd php
* 说明:
* 在buildroot中选择了php,但是在测试的时候发现总是出现下面这行
* 错误,库是存在的,但是却没有放对正确的位置,通过创建软链接解决。
*
* 2016-9-22 深圳 南山平山村 曾剑锋
*******************************************************************/ 一、参考文档:
error while loading shared libraries: libmysqlclient.so./: cannot open shared object file
http://blog.chinaunix.net/xmlrpc.php?r=blog/article&uid=25135004&id=3012725 二、报错:
php: error while loading shared libraries: libmysqlclient.so.: cannot open shared object file: No such file or directory 三、原因:
找不到libmysqlclient.so.,通过find命令使能找到的。 四、解决办法:
在能找到的库目录下创建软链接就行了。 五、操作流程:
# find . -iname php
./usr/bin/php
./usr/lib/php
# LD_TRACE_LOADED_OBJECTS= /usr/bin/php
libcrypt.so. => /lib/libcrypt.so. (0x76f9c000)
libdl.so. => /lib/libdl.so. (0x76f8f000)
libreadline.so. => /usr/lib/libreadline.so. (0x76f53000)
libncurses.so. => /usr/lib/libncurses.so. (0x76f1e000)
libmysqlclient.so. => not found
libnsl.so. => /lib/libnsl.so. (0x76f00000)
libm.so. => /lib/libm.so. (0x76e59000)
libz.so. => /usr/lib/libz.so. (0x76e3f000)
libcrypto.so.1.0. => /usr/lib/libcrypto.so.1.0. (0x76ce8000)
libssl.so.1.0. => /usr/lib/libssl.so.1.0. (0x76c8f000)
libxml2.so. => /usr/lib/libxml2.so. (0x76b80000)
libgcc_s.so. => /lib/libgcc_s.so. (0x76b57000)
libc.so. => /lib/libc.so. (0x76a17000)
/lib/ld-linux.so. (0x76fd5000)
# find . -iname libmysqlclient.so.
./usr/lib/mysql/libmysqlclient.so.
# ln -s /usr/lib/mysql/libmysqlclient.so. /usr/lib/libmysqlclient.so.
# LD_TRACE_LOADED_OBJECTS= /usr/bin/php
libcrypt.so. => /lib/libcrypt.so. (0x76f17000)
libdl.so. => /lib/libdl.so. (0x76f0a000)
libreadline.so. => /usr/lib/libreadline.so. (0x76ece000)
libncurses.so. => /usr/lib/libncurses.so. (0x76e99000)
libmysqlclient.so. => /usr/lib/libmysqlclient.so. (0x76e2d000)
libnsl.so. => /lib/libnsl.so. (0x76e0f000)
libm.so. => /lib/libm.so. (0x76d68000)
libz.so. => /usr/lib/libz.so. (0x76d4e000)
libcrypto.so.1.0. => /usr/lib/libcrypto.so.1.0. (0x76bf7000)
libssl.so.1.0. => /usr/lib/libssl.so.1.0. (0x76b9e000)
libxml2.so. => /usr/lib/libxml2.so. (0x76a8f000)
libgcc_s.so. => /lib/libgcc_s.so. (0x76a66000)
libc.so. => /lib/libc.so. (0x76926000)
/lib/ld-linux.so. (0x76f50000) 六、测试代码:
. busybox httpd /etc/httpd.conf配置:
I:index.php
*.php:/usr/bin/php-cgi
. index.php代码:
<html>
<head>
</head>
<body>
<h1>zengjf</h1> <?php // 最好加上php,有可能不解析
echo "zengjf";
?> <? // 这里能不能解析要看/etc/php.ini中的short_open_tag是否是on状态
echo system("ls /");
?> <?
phpinfo();
?> </body>
</html>