0

我无法正确配置 PHP。

运行php -I给出以下输出:

php:加载共享库时出错:libcurl.so.3:错误的 ELF 类:ELFCLASS32

这是 strace 命令的输出,我在其中分离了最后的问题区域..

$ strace php -i
execve("/usr/bin/php", ["php", "-i"], [/* 38 vars */]) = 0
brk(0)                                  = 0x1e54f000
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2b676cd36000
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2b676cd37000
access("/etc/ld.so.preload", R_OK)      = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY)      = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=167969, ...}) = 0
mmap(NULL, 167969, PROT_READ, MAP_PRIVATE, 3, 0) = 0x2b676cd38000
close(3)                                = 0
open("/lib64/libcrypt.so.1", O_RDONLY)  = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\360\t`\377=\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=48600, ...}) = 0
mmap(0x3dff600000, 2322880, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x3dff600000
mprotect(0x3dff609000, 2093056, PROT_NONE) = 0
mmap(0x3dff808000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x8000) = 0x3dff808000
mmap(0x3dff80a000, 184768, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x3dff80a000
close(3)                                = 0
open("/usr/lib64/libaspell.so.15", O_RDONLY) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0p\300\2\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=836408, ...}) = 0
mmap(NULL, 2963928, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x2b676cd62000
mprotect(0x2b676ce27000, 2097152, PROT_NONE) = 0
mmap(0x2b676d027000, 28672, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0xc5000) = 0x2b676d027000
mmap(0x2b676d02e000, 31192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x2b676d02e000
close(3)                                = 0
open("/usr/lib64/libpspell.so.15", O_RDONLY) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0p\4\0\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=3888, ...}) = 0
mmap(NULL, 2099280, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x2b676d036000
mprotect(0x2b676d037000, 2093056, PROT_NONE) = 0
mmap(0x2b676d236000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0) = 0x2b676d236000
close(3)                                = 0
open("/usr/local/gmp/lib/libgmp.so.3", O_RDONLY) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\300\232\0\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=399787, ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2b676d237000
mmap(NULL, 2438464, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x2b676d238000
mprotect(0x2b676d28a000, 2097152, PROT_NONE) = 0
mmap(0x2b676d48a000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x52000) = 0x2b676d48a000
close(3)                                = 0
open("/lib64/libdb-4.3.so", O_RDONLY)   = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\20\26\242\4>\0\0\0"..., 832) = 832
lseek(3, 985404, SEEK_SET)              = 985404
read(3, "\4\0\0\0\20\0\0\0\1\0\0\0GNU\0\0\0\0\0\2\0\0\0\4\0\0\0\24\0\0\0", 32) = 32
fstat(3, {st_mode=S_IFREG|0755, st_size=1008656, ...}) = 0
mmap(0x3e04a00000, 3102392, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x3e04a00000
mprotect(0x3e04af1000, 2097152, PROT_NONE) = 0
mmap(0x3e04cf1000, 20480, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0xf1000) = 0x3e04cf1000
close(3)                                = 0




open("/lib64/tls/x86_64/libcurl.so.3", O_RDONLY) = -1 ENOENT (No such file or directory)
stat("/lib64/tls/x86_64", 0x7fff993b0d80) = -1 ENOENT (No such file or directory)
open("/lib64/tls/libcurl.so.3", O_RDONLY) = -1 ENOENT (No such file or directory)
stat("/lib64/tls", 0x7fff993b0d80)      = -1 ENOENT (No such file or directory)
open("/lib64/x86_64/libcurl.so.3", O_RDONLY) = -1 ENOENT (No such file or directory)
stat("/lib64/x86_64", 0x7fff993b0d80)   = -1 ENOENT (No such file or directory)
open("/lib64/libcurl.so.3", O_RDONLY)   = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\350\3\0\0004\0\0\0"..., 832) = 832
close(3)                                = 0
stat("/lib64", {st_mode=S_IFDIR|0755, st_size=12288, ...}) = 0
open("/usr/lib64/tls/x86_64/libcurl.so.3", O_RDONLY) = -1 ENOENT (No such file or directory)
stat("/usr/lib64/tls/x86_64", 0x7fff993b0d80) = -1 ENOENT (No such file or directory)
open("/usr/lib64/tls/libcurl.so.3", O_RDONLY) = -1 ENOENT (No such file or directory)
stat("/usr/lib64/tls", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
open("/usr/lib64/x86_64/libcurl.so.3", O_RDONLY) = -1 ENOENT (No such file or directory)
stat("/usr/lib64/x86_64", 0x7fff993b0d80) = -1 ENOENT (No such file or directory)
open("/usr/lib64/libcurl.so.3", O_RDONLY) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\350\3\0\0004\0\0\0"..., 832) = 832
close(3)                                = 0
stat("/usr/lib64", {st_mode=S_IFDIR|0755, st_size=81920, ...}) = 0
writev(2, [{"php", 3}, {": ", 2}, {"error while loading shared libra"..., 36}, {": ", 2}, {"libcurl.so.3", 12}, {": ", 2}, {"wrong ELF class: ELFCLASS32", 27}, {"", 0}, {"", 0}, {"\n", 1}], 10php: error while loading shared libraries: libcurl.so.3: wrong ELF class: ELFCLASS32
) = 85
exit_group(127)                         = ?

我无法理解它是否能够找到 libcurl 为什么它仍然给出错误。?

4

2 回答 2

1

是否安装了 libcurl?如果您使用的是基于 Debian 的发行版,请尝试:

apt-get install php5-curl
于 2013-02-21T11:21:43.890 回答
0

这似乎是因为 libcurl 已针对错误的体系结构进行编译。

于 2013-02-21T12:28:33.807 回答