/bin/thttpd: can't load library 'libcrypt.so.0问题解决

本文介绍了如何解决在运行thttpd时遇到的'can't load library 'libcrypt.so.0'问题,通过修改Makefile并进行静态链接编译来修复。
         在arm 的打印信息里面看到如下信息
======try to start thttpd=====
/bin/thttpd: can't load library 'libcrypt.so.0'

看来是找不到这个库文件,百度一下发现如下解决办法
5.出现“cannot load the lib xxxxx”
A:查看thttpd以来的动态库
  arm-9tdmi-linux-gnu-readelf -d thttpd
  ************************************************************************

Dynamic section at offset 0x11368 contains 22 entries:
  Tag        Type                         Name/Value
 0x00000001 (NEEDED)                     Shared library: [libcrypt.so.0]
 0x00000001 (NEEDED)                     Shared library: [libc.so.0]
 0x0000000c (INIT)                       0x9468
 0x0000000d (FINI)                       0x15acc
 0x00000019 (INIT_ARRAY)                 0x2135c
 0x0000001b (INIT_ARRAYSZ)               4 (bytes)
 0x0000001a (FINI_ARRAY)                 0x21360
 0x0000001c (FINI_ARRAYSZ)               4 (bytes)
 0x00000004 (HASH)                       0x8108
 0x00000005 (STRTAB)                     0x8cd0
 0x00000006 (SYMTAB)                     0x84a0
 0x0000000a (STRSZ)                      1022 (bytes)
 0x0000000b (SYMENT)                     16 (bytes)
 0x00000015 (DEBUG)                      0x0
 0x00000003 (PLTGOT)                     0x21440
 0x00000002 (PLTRELSZ)                   872 (bytes)
 0x00000014 (PLTREL)                     REL
 0x00000017 (JMPREL)                     0x9100
 0x00000011 (REL)                        0x90d0
 0x00000012 (RELSZ)                      48 (bytes)
 0x00000013 (RELENT)                     8 (bytes)
 0x00000000 (NULL)                       0x0

  ************************************************************************
可以看出thttpd以来libcrypt和libc lib,将arm-linux-tools的lib目录下的相应库文件拷贝至target的/lib目录
如果依然出现错误,将libnss_files lib拷贝至target的/lib目录,bean个人认为是前两个库依赖libnss_files[未验证]。

当然, 也可以直接使用静态库文件

cd thttpd-2.25b/

vi Makefile
指定静态链接二进制文件
LDFLAGS = static

重新编译

解释当前log 分析原因,定位具体代码位置并提供解决办法 Dec 31 19:07:05 vcswificam user.notice root: DEBUG : WATCHDOG : Anyka running at PID 560 Dec 31 19:07:06 vcswificam user.notice root: DEBUG : WATCHDOG : Anyka CPU utilization at 36% Dec 31 19:07:06 vcswificam user.notice root: INFO : WATCHDOG : Running Anyka CPU check. (36%) Over: (0/4) Under: (/4) Dec 31 19:07:12 vcswificam user.notice root: DEBUG : WATCHDOG : Anyka running at PID 560 Dec 31 19:07:13 vcswificam user.notice root: DEBUG : WATCHDOG : Anyka CPU utilization at 26% Dec 31 19:07:13 vcswificam user.notice root: INFO : WATCHDOG : Running Anyka CPU check. (26%) Over: (0/4) Under: (/4) Dec 31 19:07:18 vcswificam user.notice root: DEBUG : WATCHDOG : Anyka running at PID 560 Dec 31 19:07:19 vcswificam user.notice root: DEBUG : WATCHDOG : Anyka CPU utilization at 31% Dec 31 19:07:19 vcswificam user.notice root: INFO : WATCHDOG : Running Anyka CPU check. (31%) Over: (0/4) Under: (/4) Dec 31 19:07:25 vcswificam user.notice root: DEBUG : WATCHDOG : Anyka running at PID 560 Dec 31 19:07:25 vcswificam daemon.debug thttpd[447]: spawned CGI process 2532 for file 'cgi-bin/get_signal' Dec 31 19:07:27 vcswificam user.notice root: DEBUG : WATCHDOG : Anyka CPU utilization at 38% Dec 31 19:07:27 vcswificam user.notice root: INFO : WATCHDOG : Running Anyka CPU check. (38%) Over: (0/4) Under: (/4) Dec 31 19:07:32 vcswificam user.notice root: DEBUG : WATCHDOG : Anyka running at PID 560 Dec 31 19:07:33 vcswificam user.notice root: DEBUG : WATCHDOG : Anyka CPU utilization at 22% Dec 31 19:07:33 vcswificam user.notice root: INFO : WATCHDOG : Running Anyka CPU check. (22%) Over: (0/4) Under: (/4) Dec 31 19:07:39 vcswificam user.notice root: DEBUG : WATCHDOG : Anyka running at PID 560 Dec 31 19:07:39 vcswificam user.notice root: DEBUG : WATCHDOG : Anyka CPU utilization at 26% Dec 31 19:07:39 vcswificam user.notice root: INFO : WATCHDOG : Running Anyka CPU check. (26%) Over: (0/4) Under: (/4) Dec 31 19:07:39 vcswificam user.notice root: INFO : WATCHDOG : Running 30 second process... (Firmware version: 48.8.1, Uptime: 19:07:39 up 7 min, load average: 5.15, 3.67, 1.80) Dec 31 19:07:39 vcswificam user.notice root: DEBUG : WATCHDOG : Checking if wifi is configured to station mode. running = station Dec 31 19:07:40 vcswificam user.notice root: DEBUG : WATCHDOG : Checking if wifi is connected. wificonnecttest = 00:0A:52:0A:DF:B6 Dec 31 19:07:40 vcswificam user.notice root: INFO : WATCHDOG : WiFi = Connected. (Current: -35 / Minimum: -75) Dec 31 19:07:42 vcswificam user.notice root: INFO : WATCHDOG : IP = 172.20.1.51, Gateway = 172.20.1.1, Ping Gateway = Fail Dec 31 19:07:42 vcswificam kern.debug kernel: [ 462.250000] ieee80211 phy0: [SCAN] Scan request for 0 SSIDs. Dec 31 19:07:42 vcswificam user.notice root: OK
06-18
[root@165e4e351455 nginx]# tail -f 10 error.log tail: cannot open '10' for reading: No such file or directory ==> error.log <== 2025/06/24 05:54:00 [notice] 1738#1738: signal process started 2025/06/24 05:54:05 [error] 1739#1739: *3 directory index of "/usr/share/nginx/html/" is forbidden, client: 10.0.0.1, server: localhost, request: "GET / HTTP/1.1", host: "10.0.0.12" 2025/06/24 05:54:06 [error] 1739#1739: *3 directory index of "/usr/share/nginx/html/" is forbidden, client: 10.0.0.1, server: localhost, request: "GET / HTTP/1.1", host: "10.0.0.12" 2025/06/24 05:54:28 [error] 1739#1739: *3 directory index of "/usr/share/nginx/html/" is forbidden, client: 10.0.0.1, server: localhost, request: "GET / HTTP/1.1", host: "10.0.0.12" 2025/06/24 05:54:41 [error] 1739#1739: *3 open() "/usr/share/nginx/html/index.php" failed (2: No such file or directory), client: 10.0.0.1, server: localhost, request: "GET /index.php HTTP/1.1", host: "10.0.0.12" 2025/06/24 05:58:20 [notice] 1744#1744: signal process started 2025/06/24 05:58:35 [error] 1745#1745: *4 directory index of "/usr/share/nginx/html/" is forbidden, client: 10.0.0.1, server: localhost, request: "GET / HTTP/1.1", host: "10.0.0.12" 2025/06/24 05:58:37 [error] 1745#1745: *4 directory index of "/usr/share/nginx/html/" is forbidden, client: 10.0.0.1, server: localhost, request: "GET / HTTP/1.1", host: "10.0.0.12" 2025/06/24 05:58:37 [error] 1745#1745: *4 directory index of "/usr/share/nginx/html/" is forbidden, client: 10.0.0.1, server: localhost, request: "GET / HTTP/1.1", host: "10.0.0.12" 2025/06/24 05:58:37 [error] 1745#1745: *4 directory index of "/usr/share/nginx/html/" is forbidden, client: 10.0.0.1, server: localhost, request: "GET / HTTP/1.1", host: "10.0.0.12"
最新发布
06-25
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值