


错误解决:error while loading shared libraries: libcurl.so.4: cannot open shared object file: No such file or directory,errorwhileloading
执行以下代码,生成唯一的UID
<span>$fp</span> = <span>popen</span>("/xxx/bin/tools/uuidgen system", "r"<span>);// </span><span>$uid</span> = <span>fread</span>(<span>$fp</span>, 40960<span>); </span><span>pclose</span>(<span>$uid</span>);
问题:返回结果$uid为空。实际上执行popen函数后能够返回内容 resource(39) of type (stream)
。
resource popen ( string
$command
, string $mode
)
参数:$command 命令,$mod 模式。
打开一个指向进程的管道,该进程由派生给定的 command 命令执行而产生。
如果未找到要执行的命令,会返回一个合法的资源,它允许访问shell返回的任何错误信息。
/* 加入重定向以得到标准错误输出 stderr。 */
<span>$fp</span> = <span>popen</span>("/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

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Atom editor mac version download
The most popular open source editor

Dreamweaver CS6
Visual web development tools

mPDF
mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

SublimeText3 Chinese version
Chinese version, very easy to use

MantisBT
Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.