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 HFSS 中的 H 场图与 MATLAB 中绘制的 B1 场 部分对应不上
  • ¥15 如何在scanpy上做差异基因和通路富集?
  • ¥20 关于#硬件工程#的问题,请各位专家解答!
  • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
  • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
  • ¥30 截图中的mathematics程序转换成matlab
  • ¥15 动力学代码报错,维度不匹配
  • ¥15 Power query添加列问题
  • ¥50 Kubernetes&Fission&Eleasticsearch
  • ¥15 報錯:Person is not mapped,如何解決?