Error resolution: errorwhileloadingsharedlibraries: libcurl. so.4: cannotopen#dobjectfile: the Nosuchfileordirectory-tianxintian22 executes the following code to generate a unique UID
$fp = popen("/xxx/bin/tools/uuidgen system", "r");//$uid = fread($fp, 40960);pclose($uid);
Problem: The Returned result $ uid is null. Actually, after the popen function is executed, the returned content can be returned.resource(39) of type (stream)
.
ResourcePopen(String$command
, String$mode
)
Parameter: $ command, $ mod mode.
Open an Pipeline pointing to a process, which is generated by running the command derived from a process.
If the command to be executed is not found, a valid resource is returned, which allows access to any error message returned by the shell.
/* Add redirection to get stderr output with a standard error. */
$fp = popen("/xxx/bin/tools/uuidgen system 2>&1", "r");
The error while loading shared libraries: libcurl. so.4: cannot open shared object file: No such file or directory is displayed.
The system does not know which Directory libcurl. so is stored.
Solution:
Add the libcurl. so directory to/etc/ld. so. conf.
Generally, the so file will be in the/usr/local/lib Directory (you can customize the directory), so in the/etc/ld. so. add/usr/local/lib (or user-defined directory) to the conf file,
Finally, save/etc/ld. so. conf and execute the command [root @ www] #/sbin/ldconfig-v to take effect.
Reference: http://blog.csdn.net/kangear/article/details/9141481