Install PHP 5.6 on EC2-程序员宅基地

技术标签: 运维  PHP  Summary  php  数据库  

Install PHP 5.6 on EC2

Start with this version
> wget http://ar2.php.net/distributions/php-5.6.16.tar.bz2

Unzip the file
> tar -xvf php-5.6.16.tar.bz2

Configure that
> ./configure --prefix=/home/ec2-user/tool/php-5.6.16 --with-openssl --with-iconv-dir=/usr/lib --with-curl=/opt/local/include/curl --with-mysql --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-mysql --with-pdo-mysql --with-mysqli --with-jpeg-dir=/usr --with-png-dir=/usr --enable-gd-native-ttf --with-fpm-user=www-data --with-fpm-group=www-data --with-libdir=/lib/x86_64-linux-gnu --enable-ftp --with-imap --with-imap-ssl --with-kerberos --with-gettext --with-xmlrpc --with-xsl --enable-opcache --enable-fpm

1 Error Message:
configure: error: xml2-config not found. Please check your libxml2 installation.

Solution:
sudo yum install libxml2-devel

2 Error Message:
configure: error: Cannot find OpenSSL's <evp.h>

Solution:
sudo yum install openssl-devel

3 Error Message:
configure: error: Please reinstall the BZip2 distribution

Solution:
sudo yum install bzip2-devel

4 Error Message:
configure: error: Please reinstall the libcurl distribution -
easy.h should be in <curl-dir>/include/curl/

Solution:
sudo yum install curl-devel

5 Error Message:
If configure fails try --with-vpx-dir=<DIR>
configure: error: jpeglib.h not found.

Solution:
sudo yum install libjpeg-devel

6 Error Message:
If configure fails try --with-vpx-dir=<DIR>
checking for jpeg_read_header in -ljpeg... yes
configure: error: png.h not found.

Solution:
sudo yum install libpng-devel

7 Error Message:
If configure fails try --with-vpx-dir=<DIR>
checking for jpeg_read_header in -ljpeg... yes
checking for png_write_image in -lpng... yes
If configure fails try --with-xpm-dir=<DIR>
configure: error: freetype-config not found.

Solution:
sudo yum install freetype-devel.x86_64 freetype.x86_64

8 Error Message:
configure: error: utf8_mime2text() has new signature, but U8T_CANONICAL is missing. This should not happen. Check config.log for additional information.

Solution:
sudo yum install libc-client-devel

9 Error Message:
configure: error: Cannot find imap library (libc-client.a). Please check your c-client installation.

Solution:
http://php.net/manual/en/imap.requirements.php

I do not think I am using IMAP, so I just get rid of that.
>./configure --prefix=/home/ec2-user/tool/php-5.6.16 --with-openssl --with-iconv-dir=/usr/lib --with-curl=/opt/local/include/curl --with-mysql --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-mysql --with-pdo-mysql --with-mysqli --with-jpeg-dir=/usr --with-png-dir=/usr --enable-gd-native-ttf --with-fpm-user=www-data --with-fpm-group=www-data --with-libdir=/lib/x86_64-linux-gnu --enable-ftp --with-kerberos --with-gettext --with-xmlrpc --with-xsl --enable-opcache --enable-fpm

10 Error Message:
configure: error: mcrypt.h not found. Please reinstall libmcrypt.

Solution:
sudo yum install libmcrypt-devel

11 Error Message:
configure: error: Cannot find libpq-fe.h. Please specify correct PostgreSQL installation path

Solution:
Do I use PostgreSQL, no, so I remove that.
./configure --prefix=/home/ec2-user/tool/php-5.6.16 --with-openssl --with-iconv-dir=/usr/lib --with-curl=/opt/local/include/curl --with-mysql --with-zlib-dir --with-freetype-dir --enable-mbstring --with-libxml-dir=/usr --enable-soap --enable-calendar --with-curl --with-mcrypt --with-zlib --with-gd --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-mysql --with-pdo-mysql --with-mysqli --with-jpeg-dir=/usr --with-png-dir=/usr --enable-gd-native-ttf --with-fpm-user=www-data --with-fpm-group=www-data --with-libdir=/lib/x86_64-linux-gnu --enable-ftp --with-kerberos --with-gettext --with-xmlrpc --with-xsl --enable-opcache --enable-fpm

12 Error Message:
configure: error: xslt-config not found. Please reinstall the libxslt >= 1.1.0 distribution

Solution:
sudo yum install libxslt-devel

Yeah, it works.
> make

> make install
Wrote PEAR system config file at: /home/ec2-user/tool/php-5.6.16/etc/pear.conf
You may want to add: /home/ec2-user/tool/php-5.6.16/lib/php to your php.ini include_path
/home/ec2-user/install/php-5.6.16/build/shtool install -c ext/phar/phar.phar /home/ec2-user/tool/php-5.6.16/bin
ln -s -f phar.phar /home/ec2-user/tool/php-5.6.16/bin/phar
Installing PDO headers: /home/ec2-user/tool/php-5.6.16/include/php/ext/pdo/

Add that to the path
> sudo ln -s /home/ec2-user/tool/php-5.6.16 /opt/php-5.6.16
> sudo ln -s /opt/php-5.6.16 /opt/php

> vi ~/.bash_profile
PATH=$PATH:$HOME/bin:/opt/maven/bin
PATH=$PATH:/opt/sbt/bin
PATH=$PATH:/opt/jdk/bin:/opt/jdk/jre/bin
PATH=$PATH:/opt/node/bin
PATH=$PATH:/opt/php/bin

export PATH

JAVA_HOME=/opt/jdk
export JAVA_HOME

JRE_HOME=/opt/jdk/jre
export JRE_HOME

> sudo ln -s /opt/php/bin/php /usr/bin/php

References:
http://sillycat.iteye.com/blog/2223621
http://sillycat.iteye.com/blog/2149513

http://supportlobby.com/library-errors-when-compile-php-5-on-centos/
http://www.creativ-tech.com/kb/common-php-compile-errors-and-the-corresponding-missing-lib/
版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://blog.csdn.net/magic_dreamer/article/details/84804858

智能推荐

Python数据可视化 | 豆瓣电影Top250数据分析-程序员宅基地

文章浏览阅读2.1w次,点赞48次,收藏191次。本文通过python对已爬取并保存在Excel里的豆瓣电影Top250信息进行数据可视化分析。

html页面耗内存严重,页面优化-如何减少网页的内存与CPU占用-程序员宅基地

文章浏览阅读4.7k次。有的网页看起来并不大但打开会很卡,有的网页虽然很长但使用流畅,占用用户电脑的内存与CPU就影响这些。浏览器问题,有各自的浏览器处理内存问题会影响到,但几乎没办法控制得了,Windows上的:IE系列,刷新回收的量不大,但最小化会释放内存,。Firefox2据说也会在最小化回收,可我从没见过最垃圾,用多少是多少,基本不回收。据说prototype的ajax还会引起内存一直增加。Opera最好。一直控..._html资源占用过高

webHttpBinding、basicHttpBinding和wsHttpBinding区别_basichttpbinding与wshttpbinding与webhttpbinding-程序员宅基地

文章浏览阅读1.1k次。webHttpBinding与basicHttpBinding / wsHttpBinding的区别_basichttpbinding与wshttpbinding与webhttpbinding

linux dmesg路径,Linux命令——dmesg-程序员宅基地

文章浏览阅读251次。前言Linux启动是个复杂的流程,BIOS->MBR->boot loader。。。boot loader阶段有Kernel以及initrd,Kernel通过initrd加载到bootable device的驱动后正式接管根目录文件系统,然后加载各种驱动,准备OS下程序运行环境等等。boot loader详细工作如下图。Kernel做了这么多事情,有什么办法观察内核所作的工作吗? d..._dmesg 路径

python requests get请求 超时_尝试在python中执行get请求时获取[Errno 110]“连接超时”...-程序员宅基地

文章浏览阅读1.4k次。我可以在firefox浏览器中手动访问下面代码中提到的“URL”,并看到json响应如下:{"version" : "1.0","email_address" : "[email protected]"}但是当我试图用下面的代码获取请求时,我得到的是连接超时错误。import requestsURL='https://deviceconfig.pod1.pie.avatar.ext.hp.com/v..._python requests [errno 110] connection timed out

凑硬币算法C语言,《凑硬币》 动态规划算法入门-程序员宅基地

文章浏览阅读571次。题目描述如果我们有面值为1元、3元和5元的硬币若干枚,如何用最少的硬币凑够11元?思路问题动态规划算法的核心是:每个子问题的状态和状态的转移方程。状态是:dp[i] ,即凑够i元最少需要的硬币的个数转移方程是:dp[i] = min(dp[i-C1]+1,dp[i-C2]+1,dp[i-C3]+1,……,dp[i-Cj]+1])即,每个状态的值都是最小的那个。编写代码说明:通过递归函数dp_fun..._10元最多构成几枚硬币 动态规划

随便推点

C++学习之双端队列depue_depuec++-程序员宅基地

文章浏览阅读1.9k次。6、双端队列deque所谓的deque是”double ended queue”的缩写,双端队列不论在尾部或头部插入元素,都十分迅速。而在中间插入元素则会比较费时,因为必须移动中间其他的元素。双端队列是一种随机访问的数据类型,提供了在序列两端快速插入和删除操作的功能,它可以在需要的时候改变自身大小,完成了标准的C++数据结构中队列的所有功能。Vector是单向开口的连续线性空间,deque则..._depuec++

多年大数据开发经验总结_大数据项目经历-程序员宅基地

文章浏览阅读5.5k次,点赞15次,收藏8次。多年工作经验总结初入行,搞大数据开发。得高人指点,先学mapreduce,不足一年,tez兴,后入此道。朝夕不倦,发愤图强,才能略知一二。无奈后浪推前浪,tez被spark拍在沙滩上,遂投spark之怀。继而抖擞精神,奋袂而起,github、stackoverflow轮番上阵,终七窍通六窍。然乾坤更替,岁月不复,spark转眼成过眼烟云,flink、 beam之流成业界新宠,一时洛阳纸贵,众人..._大数据项目经历

Python实现时间序列分析进行平稳性检验(ADF和KPSS)和差分去趋势(adfuller和kpss算法)项目实战_python adf检验-程序员宅基地

文章浏览阅读1.3k次,点赞18次,收藏20次。Python实现时间序列分析进行平稳性检验(ADF和KPSS)和差分去趋势(adfuller和kpss算法)项目实战_python adf检验

Intellij Idea 设置方法模板_idea if模板-程序员宅基地

文章浏览阅读2w次,点赞5次,收藏6次。设置Idea的方法注释模板 详细配置: /** * @author usernameusername datedate * @time timetime * @method methodmethod * @param paramparam * @return methodretur_idea if模板

MATLAB调用OpenCV流程(MATLAB R2016a+OpenCV3.1.0+VS2010)_matlab写的程序会提到opencv吗-程序员宅基地

文章浏览阅读7.2k次,点赞2次,收藏44次。第一次使用MATLAB和C++混编,综合一些网上的教程,最终实现功能,尽管理解不是很深刻,但先记录下来,以后慢慢领悟。在MATLAB命令行窗口中输入命令“mex -setup C++”,此时显示如下图所示: 在MATLAB命令行窗口中输入命令“mbulid -setup C++”,此时显示如下图所示: 此时编译环境搞定,但是得通过配置文件xml,修改前先编写一个测试代码,文件名为OpenC..._matlab写的程序会提到opencv吗

关于网络安全那点事:MYSQL使用教程-程序员宅基地

文章浏览阅读840次,点赞23次,收藏16次。从时代发展的角度看,网络安全的知识是学不完的,而且以后要学的会更多,同学们要摆正心态,既然选择入门网络安全,就不能仅仅只是入门程度而已,能力越强机会才越多。因为入门学习阶段知识点比较杂,所以我讲得比较笼统,大家如果有不懂的地方可以找我咨询,我保证知无不言言无不尽,需要相关资料也可以找我要,我的网盘里一大堆资料都在吃灰呢。干货主要有:①1000+CTF历届题库(主流和经典的应该都有了)②CTF技术文档(最全中文版)③项目源码(四五十个有趣且经典的练手项目及源码)