资讯专栏INFORMATION COLUMN

源码安装php5.6之旅

tuomao / 836人阅读

摘要:官网下载依次在目录中执行遇到报错半年之后,又遇到了的问题,看来要短兵相接了久之前,安装了这个修改还是同样的报错只好百度一下了。手动安装报错源码安装搞不定了,试试看安装。

官网下载php5.6

依次在目录中执行:

./buildconf --force

./configure --prefix=/data/php-fpm --with-apxs2=/usr/sbin/apxs --enable-fpm --with-fpm-user=myname --with-fpm-group=myname --with-mysqli --with-pdo-mysql --with-iconv-dir --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir=/usr --enable-xml --disable-rpath --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --with-curl --enable-mbregex --enable-mbstring --with-mcrypt --enable-ftp --with-gd --enable-gd-native-ttf --with-openssl --with-mhash --enable-pcntl --enable-sockets --with-xmlrpc --enable-zip --enable-soap --without-pear --with-gettext --disable-fileinfo --enable-maintainer-zts

遇到报错:

configure: error: Cannot find OpenSSL"s 

半年之后,又遇到了openssl的问题,看来要短兵相接了!

N久之前,安装了这个openssl-1.0.1q

修改configure

./configure --prefix=/data/php-fpm --with-apxs2=/usr/sbin/apxs --enable-fpm --with-fpm-user=myname --with-fpm-group=myname --with-mysqli --with-pdo-mysql --with-iconv-dir --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir=/usr --enable-xml --disable-rpath --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --with-curl --enable-mbregex --enable-mbstring --with-mcrypt --enable-ftp --with-gd --enable-gd-native-ttf --with-openssl=/data/openssl-1.0.1q --with-mhash --enable-pcntl --enable-sockets --with-xmlrpc --enable-zip --enable-soap --without-pear --with-gettext --disable-fileinfo --enable-maintainer-zts

还是同样的报错

只好百度一下了。

参考这个:Link

尝试

brew install openssl

发现已经安装过了openssl

brew info openssl

发现缺少了一个makebuild的依赖

brew install makebuild

安装这个依赖之后,再次查看openssl的info

brew info openssl

哦?!依赖报错没有了

思考了一下,我是否可以直接用brew install安装的openssl来安装php,so。。。

./configure --prefix=/data/php-fpm --with-apxs2=/usr/sbin/apxs --enable-fpm --with-fpm-user=myname --with-fpm-group=myname --with-mysqli --with-pdo-mysql --with-iconv-dir --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir=/usr --enable-xml --disable-rpath --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --with-curl --enable-mbregex --enable-mbstring --with-mcrypt --enable-ftp --with-gd --enable-gd-native-ttf --with-openssl=usr/local/Cellar/openssl/1.0.2f --with-mhash --enable-pcntl --enable-sockets --with-xmlrpc --enable-zip --enable-soap --without-pear --with-gettext --disable-fileinfo --enable-maintainer-zts

T_T感动的落泪了。终于换了一个报错

configure: error: Cannot locate header file libintl.h

搜到了大牛的一篇文章:

google了一下,这里有解决办法:PHP with Intl and Gettext on OSX Lion。

大致步骤是:

1、安装ICU

tar xzvf icu4c-4_8_1-src.tgz
cd icu/source
./runConfigureICU MacOSX
make
sudo make install

2、安装PHP自带的intl扩展

找了半天终于找到了下载地址

wget http://download.icu-project.org/files/icu4c/4.2.1/icu4c-4_2_1-src.tgz  

执行完最后的sudo make install之后,再次执行./configure

waiting...

依旧报错:

configure: error: Cannot locate header file libintl.h

执行第二步: 安装php自带的intl扩展

./configure --prefix=/data/php-fpm --with-apxs2=/usr/sbin/apxs --enable-fpm --with-fpm-user=www --with-fpm-group=www --with-mysqli --with-pdo-mysql --with-iconv-dir --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir=/usr --enable-xml --disable-rpath --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --with-curl --enable-mbregex --enable-mbstring --with-mcrypt --enable-ftp --with-gd --enable-gd-native-ttf --enable-intl --with-openssl=/usr/local/Cellar/openssl/1.0.2f --with-mhash --enable-pcntl --enable-sockets --with-xmlrpc --enable-zip --enable-soap --without-pear --with-gettext --disable-fileinfo --enable-maintainer-zts

waiting

还是报错。。。。

F!手动安装

cd ext/intl
/usr/local/php/bin/phpize intl
./configure --enable-intl
make

报错:

In file included from /data/php5.6/ext/intl/php_intl.c:25:
./php_intl.h:23:10: fatal error: "php.h" file not found
#include 
         ^
1 error generated.

F

源码安装搞不定intl了,试试看PECL安装。

I can"t open PEAR, so..

Try another method:

http://www.codeweblog.com/configure-error-cannot-locate-header-file-libint/

是不是缺少了gettext底层依赖,所以报错?

未完啊未完 Continue

/php5.6目录下,重新配置configure

./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/php --with-mysql --with-mysqli --enable-pdo --with-pdo-mysql --with-mysql-sock=/tmp/mysql.sock --enable-opcache --enable-cgi --enable-fpm --enable-sockets --enable-mbstring --enable-mbregex --enable-bcmath --enable-xml --enable-zip --with-zlib --with-gd --with-png-dir=/usr/local/lib/libpng --with-jpeg-dir=/usr/local/lib/libjpeg --with-curl --with-mhash=/usr/local/lib/libmhash --with-mcrypt=/usr/local/lib/libmcrypt --with-iconv=/usr/local/lib/libiconv --with-openssl

提示

Cann"t find evp.h 

发现是在安装openssl的时候报错。

查看configure文件

vim configure

在vim命令行下搜索evp.h

找到了openssl的搜索目录。其实在搜索的这三个目录下,没有openssl这个库导致的报错。

将以前下载好的openssl库进行copy,copy到指定的搜索目录。

继续安装。

成功。

参考

http://serverfault.com/questions/415458/php-error-cannot-find-openssls-evp-h

http://note.rpsh.net/posts/2015/10/07/installing-php-intl-extension-os-x-el-capitan/

文章版权归作者所有,未经允许请勿转载,若此文章存在违规行为,您可以联系管理员删除。

转载请注明本文地址:https://www.ucloud.cn/yun/21531.html

相关文章

  • 如何让PHP性能问题不再饱受诟病

    摘要:作为开发中应用最广泛的开源脚本语言,凭借库类丰富,使用简单,安全等特点,成为和等互联网巨头和全球超过网站的主要开发语言,然而性能问题是一直以来饱受诟病的,来自开发组的高驰涛同学将为我们带来他对性能优化方面的思考和建议。 PHP作为Web开发中应用最广泛的开源脚本语言,凭借库类丰富,使用简单,安全等特点,成为Facebook和BAT等互联网巨头和全球超过70%网站的主要开发语言,然而性能...

    warnerwu 评论0 收藏0
  • Ubuntu14.04下安装LAMP环境,以及源码安装PHP5.6和Apache2.4

    摘要:安装在下很多功能都在这个软件包中了,不在区分等软件包了,因此我们可以直接安装注意这边的是为了方便安装,加上它就不需要在进行安装确认,简单粗暴一键完成安装的模块在中的模块有两个软件包,分别是和大多数情况下应该使用第一个。 安装Apache 在Ubunt14.04下很多功能都在apache2这个软件包中了,不在区分mpm-work,mpm-prefork,mpm-event等软件包了,因...

    silvertheo 评论0 收藏0
  • Ubuntu14.04下安装LAMP环境,以及源码安装PHP5.6和Apache2.4

    摘要:安装在下很多功能都在这个软件包中了,不在区分等软件包了,因此我们可以直接安装注意这边的是为了方便安装,加上它就不需要在进行安装确认,简单粗暴一键完成安装的模块在中的模块有两个软件包,分别是和大多数情况下应该使用第一个。 安装Apache 在Ubunt14.04下很多功能都在apache2这个软件包中了,不在区分mpm-work,mpm-prefork,mpm-event等软件包了,因...

    myshell 评论0 收藏0

发表评论

0条评论

最新活动
阅读需要支付1元查看
<