簡體   English   中英

編譯PHP7錯誤

[英]Compiling PHP7 error

我只是想從頭開始構建PHP7。

我使用了以下命令:

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

但是它與錯誤消息打斷了:

/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

已經檢查了很多東西。 我還鏈接了c客戶端的x86版本。 但是到目前為止,沒有任何幫助。 我還設置了CXFLAG -fPIC屁股,它也沒有解決它

如果在Debian 8下出現“ libc-client.a:錯誤添加符號:錯誤值”消息-這可能意味着您作為@Chris West建議進行了@Chris West 但是在Debian 8 amd64 /usr/lib/libc-client.a中-它不適合構建imap擴展庫。 該庫的軟件包版本(php5-imap)取決於包含libc-client.so.2007e.0的libc-client2007e軟件包-這就是您需要的。 只需輸入:

ln -s /usr/lib/libc-client.so.2007e.0 /usr/lib/x86_64-linux-gnu/libc-client.a

並且編譯將成功完成。

我發現了編譯問題背后的問題。

首先,偶然發現此問題的人鏈接了x86_64系統的libc-client.a類:

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

刪除此鏈接這引起了問題。

在configure命令中正確設置lib目錄:

--with-libdir = / lib /

那么你可以用apxs2進行編譯

最后對我有幫助

:)

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM