错误解决:error while loading shared libraries: libcurl.so.4: cannot open shared object file: No such file or directory,errorwhileloading
程序员文章站
2022-04-23 08:14:00
...
错误解决:error while loading shared libraries: libcurl.so.4: cannot open shared object file: No such file or directory,errorwhileloading
执行以下代码,生成唯一的UID
$fp = popen("/xxx/bin/tools/uuidgen system", "r");// $uid = fread($fp, 40960); pclose($uid);
问题:返回结果$uid为空。实际上执行popen函数后能够返回内容 resource(39) of type (stream)
。
resource popen ( string
$command
, string $mode
)
参数:$command 命令,$mod 模式。
打开一个指向进程的管道,该进程由派生给定的 command 命令执行而产生。
如果未找到要执行的命令,会返回一个合法的资源,它允许访问shell返回的任何错误信息。
/* 加入重定向以得到标准错误输出 stderr。 */
$fp = popen("/xxx/bin/tools/uuidgen system 2>&1", "r");
这样,会看到输出错误 error while loading shared libraries: libcurl.so.4: cannot open shared object file: No such file or directory
表示系统不知道libcurl.so放在哪个目录下。
解决办法:
在/etc/ld.so.conf中加入libcurl.so所在的目录。
一般so档案会在/usr/local/lib这个目录下(用户可以自定义目录),所以在/etc/ld.so.conf中加入/usr/local/lib(或用户自定义的目录)这一行,
最后,保存/etc/ld.so.conf,执行命令[root@www]# /sbin/ldconfig -v才能生效。
参考:http://blog.csdn.net/kangear/article/details/9141481
推荐阅读
-
解决启动MongoDB错误:error while loading shared libraries: libstdc++.so.6:cannot open shared object file:
-
解决error while loading shared libraries: libXXX.so.X: cannot open shared object file: No such file
-
error while loading shared libraries: xxx: cannot open shared object file: No such file or directory
-
gmx-MMPBSA — error while loading shared libraries: libgfortran.so.3: cannot open shared object file
-
mysql初始化/usr/local/mysql/bin/mysqld: error while loading shared libraries: libnuma.so.1: cannot open shared object file: No such file or directory
-
错误解决:error while loading shared libraries: libcurl.so.4: cannot open shared object file: No such file or directory,errorwhileloading_PHP教程
-
错误解决:error while loading shared libraries: libcurl.so.4: cannot open shared object file: No such file or directory,errorwhileloading_PHP教程
-
php: error while loading shared libraries: libmysqlclient.so.16: cannot open shared object file: No
-
Error While Loading Shared Libraries, Cannot Open Shared Object File
-
php: error while loading shared libraries: libmysqlclient.so.16: cannot open shared object file: No