之前php的编译参数如下,版本是5.6.17
./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/php/etc --enable-fpm --with-fpm-user=php-fpm --with-fpm-group=php-fpm --with-mysql=mysqlnd --with-mysql-sock=/tmp/mysql.sock --with-libxml-dir --with-gd --with-jpeg-dir --with-png-dir --with-freetype-dir --with-iconv-dir --with-zlib-dir --with-mcrypt=/usr/local/libmcrypt --enable-soap --enable-gd-native-ttf --enable-ftp --enable-mbstring --enable-exif --disable-ipv6 --with-pear --with-curl --with-openssl编译通过并成功安装了,
现在我想生成libphp5.so,httpd已经安装了,apxs在/usr/sbin/apxs
我到php源码目录下
执行./configure --with-apxs2=/usr/sbin/apxs
没报错,然后make
出现如下错误
l2 -lz -lm -lxml2 -lz -lm -lxml2 -lz -lm -lcrypt -lxml2 -lz -lm -lxml2 -lz -lm -lxml2 -lz -lm -lcrypt -o sapi/cli/php
ext/phar/.libs/util.o: In function `phar_create_signature':
/usr/local/src/php-5.6.17/ext/phar/util.c:1860: undefined reference to `BIO_new_mem_buf'
/usr/local/src/php-5.6.17/ext/phar/util.c:1869: undefined reference to `PEM_read_bio_PrivateKey'
/usr/local/src/php-5.6.17/ext/phar/util.c:1870: undefined reference to `BIO_free'
/usr/local/src/php-5.6.17/ext/phar/util.c:1879: undefined reference to `EVP_MD_CTX_create'
/usr/local/src/php-5.6.17/ext/phar/util.c:1881: undefined reference to `EVP_PKEY_size'
/usr/local/src/php-5.6.17/ext/phar/util.c:1884: undefined reference to `EVP_sha1'
/usr/local/src/php-5.6.17/ext/phar/util.c:1884: undefined reference to `EVP_DigestInit'
/usr/local/src/php-5.6.17/ext/phar/util.c:1893: undefined reference to `EVP_DigestUpdate'
/usr/local/src/php-5.6.17/ext/phar/util.c:1902: undefined reference to `EVP_SignFinal'
/usr/local/src/php-5.6.17/ext/phar/util.c:1911: undefined reference to `EVP_MD_CTX_destroy'
ext/phar/.libs/util.o: In function `phar_verify_signature':
/usr/local/src/php-5.6.17/ext/phar/util.c:1533: undefined reference to `EVP_sha1'
/usr/local/src/php-5.6.17/ext/phar/util.c:1590: undefined reference to `BIO_new_mem_buf'
/usr/local/src/php-5.6.17/ext/phar/util.c:1600: undefined reference to `PEM_read_bio_PUBKEY'
/usr/local/src/php-5.6.17/ext/phar/util.c:1601: undefined reference to `BIO_free'
/usr/local/src/php-5.6.17/ext/phar/util.c:1611: undefined reference to `EVP_DigestInit'
/usr/local/src/php-5.6.17/ext/phar/util.c:1623: undefined reference to `EVP_DigestUpdate'
/usr/local/src/php-5.6.17/ext/phar/util.c:1631: undefined reference to `EVP_VerifyFinal'
/usr/local/src/php-5.6.17/ext/phar/util.c:1642: undefined reference to `EVP_MD_CTX_cleanup'
/usr/local/src/php-5.6.17/ext/phar/util.c:1633: undefined reference to `EVP_MD_CTX_cleanup'
collect2: ld returned 1 exit status
make: *** [sapi/cli/php] 错误 1
该怎么解决啊?
顶!上去<atarget="_blank"rel="nofollow">http://my.oschina.net/eechen/blog/411534
configure_php.sh
#!/bin/bash
./configure<br>--prefix=/png/php/7.0.0<br>--enable-opcache<br>--enable-fpm<br>--enable-pdo<br>--enable-sockets<br>--enable-exif<br>--enable-soap<br>--enable-ftp<br>--enable-wddx<br>--enable-pcntl<br>--enable-soap<br>--enable-bcmath<br>--enable-mbstring<br>--enable-dba<br>--enable-gd-native-ttf<br>--enable-gd-jis-conv<br>--enable-zip<br>--enable-calendar<br>--enable-shmop<br>--enable-sysvmsg<br>--enable-sysvsem<br>--enable-sysvshm<br>--with-mysqli<br>--with-pdo-mysql<br>--with-pdo-sqlite<br>--with-iconv<br>--with-gmp<br>--with-pspell<br>--with-xmlrpc<br>--with-openssl<br>--with-mhash<br>--with-mcrypt<br>--with-xsl<br>--with-curl<br>--with-pcre-regex<br>--with-gd<br>--with-jpeg-dir=/usr<br>--with-png-dir=/usr<br>--with-zlib-dir=/usr<br>--with-xpm-dir=/usr<br>--with-freetype-dir=/usr<br>--with-gettext=/usr<br>--with-zlib=/usr<br>--with-bz2=/usr<br>--with-recode=/usr<br>--with-ldap<br>--with-pear<br>--with-readline<br>--with-fpm-user=png<br>--with-fpm-group=png<br>--with-apxs2=/png/httpd/2.4.12P/bin/apxs
其中--with-apxs2是用来生成Apache的PHP模块libphp7.so的,不需要可以去掉.
很多参数,phper用知道每一项的意思吗makeclean后,再configure,make...靠,还真行回复<atarget="_blank"rel="nofollow">@hphper:./configure--help就能看到这些配置项的说明.其实大部分对应的就是PHP源代码ext下的各个扩展.--enable开头的表示这个扩展不依赖第三方的库,典型的如--enable-opcache.--with开头的表示这个扩展依赖第三方的库,像--with-curl就依赖第三方的libcurl库,系统需要安装这个库的开发包(头文件,共享库so文件,静态库a文件)才能通过configure配置.有些扩展你不一定会用得上,比如:
sudoapt-getinstallapache2php5php5-mysqlndphp5-gdmysql-server
就可以正常跑Discuz!/WordPress等应用了,可见PHP默认configure就编译了大部分我们常用的库.以后有些扩展库需要使用,还可以phpize/configure/make进行编译安装,这时生成的扩展库是so共享库,需要在php.ini显式载入.
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。