Wrong ELF class - PHP extension

不羁岁月 提交于 2019-12-12 04:08:38

问题


I am trying to load a PHP extension (sdo.so) but I am getting the following error when I try to run XAMPP.

PHP Warning:  PHP Startup: Unable to load dynamic library '/opt/lampp/lib/php/extensions/no-debug-non-zts-20060613/sdo.so' - /opt/lampp/lib/php/extensions/no-debug-non-zts-20060613/sdo.so: wrong ELF class: ELFCLASS64 in Unknown on line 0

From what I've seen other people say it seems to be something to do with it being compiled on a 64bit machine and it needs 32bit. Is this the root of the problem? If so how would I compile it as 32bit in Fedora 17 as I've only seen solutions for Ubuntu and couldn't get them to work for me.


回答1:


From what I've seen other people say it seems to be something to do with it being compiled on a 64bit machine

It doesn't matter on which machine you compile (the build host). What matters is for what machine you compile (the target host).

You are (apparently) running a 32-bit ix86 PHP, so you need to compile sdo.so for 32-bit ix86 as well.

how would I compile it as 32bit in Fedora 17

./configure CC='gcc -m32' CXX='g++ -m32' && make && make install

should be about it.



来源:https://stackoverflow.com/questions/12092913/wrong-elf-class-php-extension

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!