dongyu5104 2015-12-14 16:52
浏览 290
已采纳

编译PHP7错误

I just wanted to build PHP7 from Scratch.

I used this command:

cd php-7.0.0

./configure --prefix=/usr/local/php/7.0.0 --with-pdo-pgsql --with-zlib-dir --with-freetype-dir --enable-mbstring --with-libxml-dir=/usr --enable-soap --enable-calendar --with-curl --with-mcrypt --with-zlib --with-gd --with-pgsql --disable-rpath --enable-inline-optimization --with-bz2 --with-zlib --enable-sockets --enable-sysvsem --enable-sysvshm --enable-pcntl --enable-mbregex --enable-exif --enable-bcmath --with-mhash --enable-zip --with-pcre-regex --with-pdo-mysql --with-mysqli --with-mysql-sock=/var/run/mysqld/mysqld.sock --with-jpeg-dir=/usr --with-png-dir=/usr --enable-gd-native-ttf --with-openssl --with-fpm-user=www-data --with-fpm-group=www-data --with-libdir=/lib/x86_64-linux-gnu --enable-ftp --with-imap=shared,/usr --with-imap-ssl --with-kerberos --with-gettext --with-xmlrpc --with-xsl --enable-opcache --enable-fpm  --sysconfdir=/etc/php7/ --with-xpm-dir=/usr --enable-intl --with-ldap --enable-mysqlnd --with-pear=/usr/local/php/7.0.0/pear --with-apxs2 --enable-dtrace --disable-phpdbg --enable-zend-signals

make clean

make

But it breaks with the the Error Message:

/bin/sh /usr/src/php7/php-7.0.0/libtool --silent --preserve-dup-deps --mode=compile cc  -Iext/imap/ -I/usr/src/php7/php-7.0.0/ext/imap/ -DPHP_ATOM_INC -I/usr/src/php7/php-7.0.0/include -I/usr/src/php7/php-7.0.0/main -I/usr/src/php7/php-7.0.0 -I/usr/src/php7/php-7.0.0/ext/date/lib -I/usr/include/libxml2 -I/usr/X11 -I/usr/include/freetype2 -I/usr/include/c-client -I/usr/src/php7/php-7.0.0/ext/mbstring/oniguruma -I/usr/src/php7/php-7.0.0/ext/mbstring/libmbfl -I/usr/src/php7/php-7.0.0/ext/mbstring/libmbfl/mbfl -I/usr/include/postgresql -I/usr/src/php7/php-7.0.0/ext/sqlite3/libsqlite -I/usr/src/php7/php-7.0.0/ext/zip/lib -I/usr/src/php7/php-7.0.0/TSRM -I/usr/src/php7/php-7.0.0/Zend    -I/usr/include -g -O2 -fvisibility=hidden -DZEND_SIGNALS    -c /usr/src/php7/php-7.0.0/ext/imap/php_imap.c -o ext/imap/php_imap.lo
/bin/sh /usr/src/php7/php-7.0.0/libtool --silent --preserve-dup-deps --mode=link cc -DPHP_ATOM_INC -I/usr/src/php7/php-7.0.0/include -I/usr/src/php7/php-7.0.0/main -I/usr/src/php7/php-7.0.0 -I/usr/src/php7/php-7.0.0/ext/date/lib -I/usr/include/libxml2 -I/usr/X11 -I/usr/include/freetype2 -I/usr/include/c-client -I/usr/src/php7/php-7.0.0/ext/mbstring/oniguruma -I/usr/src/php7/php-7.0.0/ext/mbstring/libmbfl -I/usr/src/php7/php-7.0.0/ext/mbstring/libmbfl/mbfl -I/usr/include/postgresql -I/usr/src/php7/php-7.0.0/ext/sqlite3/libsqlite -I/usr/src/php7/php-7.0.0/ext/zip/lib -I/usr/src/php7/php-7.0.0/TSRM -I/usr/src/php7/php-7.0.0/Zend    -I/usr/include -g -O2 -fvisibility=hidden -DZEND_SIGNALS    -o ext/imap/imap.la -export-dynamic -avoid-version -prefer-pic -module -rpath /usr/src/php7/php-7.0.0/modules -avoid-version -module -L/usr/lib/x86_64-linux-gnu/mit-krb5 -L/usr/lib/x86_64-linux-gnu ext/imap/php_imap.lo -L/usr/lib/x86_64-linux-gnu/mit-krb5 -lc-client -lcrypt -lpam -lgssapi_krb5 -lkrb5 -lk5crypto -lcom_err -lssl -lcrypto
/usr/bin/ld: /usr/lib/x86_64-linux-gnu/libc-client.a(osdep.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/usr/lib/x86_64-linux-gnu/libc-client.a: error adding symbols: Bad value
collect2: error: ld returned 1 exit status
Makefile:1027: recipe for target 'ext/imap/imap.la' failed
make: *** [ext/imap/imap.la] Error 1

Check a lot of things already. I also linked the x86 Version of the c-client. But nothing helped so far. I also set the CXFLAG -fPIC butt that didn't solved it either

  • 写回答

2条回答 默认 最新

  • dongpu1879 2016-01-13 09:41
    关注

    I found the Problem behind the compiling issue.

    First of all, who stumbles about this problem linked the libc-client.a class for x86_64 systems:

    ln -s /usr/lib/libc-client.a /usr/lib/x86_64-linux-gnu/libc-client.a

    remove this link This is causing the issue.

    set the lib directory in the configure command correct:

    --with-libdir=/lib/

    then you can compile with apxs2

    This helped for me, at last

    :)

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 Linux环境下CA证书更新问题
  • ¥15 sqlserver语句提取结果以外数据
  • ¥60 微信小程序如何上传QQ聊天文件
  • ¥300 开发的系统遭到无良商家的破解,请问如何防止再次发生,并追回损失
  • ¥15 java代码写在记事本上后在cmd上运行时无报错但又没生成文件
  • ¥15 关于#python#的问题:在跑ldsc数据整理的时候一直抱这种错误,要么--out识别不了参数,要么--merge-alleles识别不了参数(操作系统-linux)
  • ¥15 PPOCRLabel
  • ¥15 混合键合键合机对准标识
  • ¥100 现在不懂的是如何将当前的相机中的照片,作为纹理贴图,映射到扫描出的模型上
  • ¥15 安卓OpenCV人脸识别分类器加载