我正在尝试自己编译PHP,因为我想使用PHPBrew在多个版本的PHP之间切换.
我已经在这个过程中解决了很多问题,但是对于这个问题,我无法进一步解决.我在make过程中收到此错误消息:
/usr/bin/ld: /usr/libpcre.a(pcre_exec.o): relocation R_X86_64_32S against `_pcre_ucd_stage1' can not be used when making a shared object; recompile with -fPIC
/usr/libpcre.a: error adding symbols: Bad value
collect2: error: ld returned 1 exit status
make: *** [libPHP5.5.5.la] Fehler 1
Error
我需要从/usr/libpcre.a添加一个符号链接 – > /usr/lib/x86_64-linux-gnu/libpcre.a之前,否则他会抱怨找不到libpcre.a.
我还尝试添加“EXTRACFLAGS = -fPIC”来制作,但它不会改变任何东西.这是我第一次编译某些东西,所以我甚至不确定我是否掌握了正确的基础知识.
这是在Ubuntu 13.10下(在12.04没有看到相同的问题).这是我的PHPBrew命令:
PHPbrew install 5.5.5 +default+MysqL+pdo+apxs2
这将导致生成以下配置选项:
./configure ‘–prefix=/home/malte/.PHPbrew/PHP/PHP-5.5.5’
‘–with-config-file-path=/home/malte/.PHPbrew/PHP/PHP-5.5.5/etc’
‘–with-config-file-scan-dir=/home/malte/.PHPbrew/PHP/PHP-5.5.5/var/db’ ‘–with-pear=/home/malte/.PHPbrew/PHP/PHP-5.5.5/lib/PHP’
‘–disable-all’ ‘–enable-phar’ ‘–enable-session’
‘–enable-short-tags’ ‘–enable-tokenizer’ ‘–with-pcre-regex’
‘–with-zlib=/usr’ ‘–with-libdir=lib/i386-linux-gnu’
‘–with-MysqL=MysqLnd’ ‘–with-MysqLi=MysqLnd’
‘–with-pdo-MysqL=MysqLnd’ ‘–enable-pdo’
‘–with-apxs2=/usr/bin/apxs2’ ‘–enable-dom’ ‘–enable-libxml’
‘–enable-simplexml’ ‘–enable-xml’ ‘–enable-xmlreader’
‘–enable-xmlwriter’ ‘–with-xsl’ ‘–with-libxml-dir=/usr’
‘–enable-bcmath’ ‘–with-bz2=/usr’ ‘–enable-calendar’ ‘–enable-cli’
‘–enable-ctype’ ‘–enable-dom’ ‘–enable-fileinfo’ ‘–enable-filter’
‘–enable-shmop’ ‘–enable-sysvsem’ ‘–enable-sysvshm’
‘–enable-sysvmsg’ ‘–enable-json’ ‘–enable-mbregex’
‘–enable-mbstring’ ‘–with-mhash’ ‘–with-mcrypt=/usr’
‘–enable-pcntl’ ‘–with-pcre-regex=/usr’ ‘–with-pcre-dir=/usr’
‘–enable-phar’ ‘–enable-posix’ ‘–with-readline=/usr’
‘–enable-sockets’ ‘–enable-tokenizer’ ‘–enable-zip’ 2>&1 >
/home/malte/.PHPbrew/build/PHP-5.5.5/build.log
我想我已经安装了所有相关的软件包:
dpkg --get-selections | grep pcre
libpcre++0:amd64 install
libpcre3:amd64 install
libpcre3:i386 install
libpcre3-dev:amd64 install
libpcrecpp0:amd64 install
任何帮助真的很感激!
解决方法:
您需要使用与位置无关的代码重建libpcre.直接的方法是构建或安装使用-fPIC构建的libpcre共享对象(例如libpcre.so).
由于库存档位于/usr/lib / x86_64-linux-gnu中,因此共享对象也可能存在.尝试将-L /usr/lib / x86_64-linux-gnu添加到PHP的LDFLAGS.这也将使您免于符号链接到/ usr.
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。