`
sillycat
  • 浏览: 2539314 次
  • 性别: Icon_minigender_1
  • 来自: 成都
社区版块
存档分类
最新评论

Install PHP 5.6 on EC2

 
阅读更多
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/
分享到:
评论

相关推荐

    Ubuntu 18.04 Install PHP 5.6.md

    linux上安装php

    Dockerfile 安装php5.6镜像

    RUN yum install -y gcc gcc-c++ make gd-devel libxml2-devel libcurl-devel libjpeg-devel libpng-devel openssl-devel ADD php-5.6.31.tar.gz /tmp/ RUN cd /tmp/php-5.6.31 && \ ./configure --prefix=/usr/...

    php-5.6.37.tar.gz下载及php5.6源码安装说明

    yum install -y libxml2-devel openssl-devel libcurl-devel libjpeg-devel libpng-devel libicu-devel openldap-devel ./configure --prefix=/usr/local/php \ --with-config-file-path=/usr/local/php/etc \ --...

    PHP5.6版本安装redis扩展(内附扩展包文件)

    在PHP5.6版本中,为了充分利用Redis的功能,我们需要安装并配置PHP的Redis扩展。以下是一个详细的步骤指南,帮助您完成这个过程。 首先,了解Redis扩展的作用。Redis扩展为PHP提供了一个接口,允许开发者直接在PHP...

    CentOS 通过yum来升级php到php5.6

    ### CentOS 通过 YUM 升级 PHP 至 PHP5.6 的详细步骤及知识点 在 CentOS 系统中,有时我们需要对系统中的 PHP 版本进行升级,以便满足某些应用程序的需求或者利用新版本中提供的功能与性能改进。本文将详细介绍如何...

    linux 下php5.6源码

    2. **下载源码**:从官方仓库或镜像站点获取PHP5.6的源码包,例如`php-5.6.34.tar.gz`。 3. **解压源码**:使用`tar -zxvf php-5.6.34.tar.gz`命令解压缩源码。 4. **配置**:进入解压后的目录,运行`./configure ...

    php5.6_centos.tar.gz

    《PHP 5.6在CentOS系统中的应用与配置详解》 PHP(Hypertext Preprocessor)是一种广泛使用的开源脚本语言,尤其适用于Web开发,可嵌入到HTML中使用。PHP 5.6作为其重要的一个版本,在很多现有的项目中仍然被广泛...

    apache2.4+php5.6安装

    本教程将详细介绍如何在Windows环境下安装Apache2.4和PHP5.6,这两个组件是搭建LAMP(Linux, Apache, MySQL, PHP)或WAMP(Windows, Apache, MySQL, PHP)服务器的关键部分。 首先,让我们开始Apache2.4的安装步骤...

    linux wdcp apache php升级5.6

    下载根目录,执行#sh install_php5.6.sh , 例如有iconv方面错误,执行#sh iconv_ins.sh ,注意安装后路径, 看是否修改php脚本配置的路径./configure --with-iconv==/usr/local/libiconv 。

    php5.4、5.5、5.6的php_mongo-1.6.6扩展

    标题中的“php5.4、5.5、5.6的php_mongo-1.6.6扩展”指的是适用于PHP 5.4、5.5和5.6版本的一个名为php_mongo的扩展,版本号为1.6.6。这个扩展是针对MongoDB数据库的一种接口,它允许PHP程序员使用PHP语言与MongoDB...

    zend-loader-php5.6-windows-x86.zip

    标题 "zend-loader-php5.6-windows-x86.zip" 暗示了这是一个专为运行在Windows x86架构上的PHP 5.6版本设计的Zend Loader组件的压缩包。Zend Loader是 Zend Technologies 提供的一款重要的PHP扩展,主要用于增强PHP...

    centos php5.6环境安装 mongo.so扩展

    2. **下载源码**:从PECL(PHP Extension Community Library)官网或者GitHub上下载PHP-mongo的源码包。由于这里提供了未编译的文件,可以直接使用解压后的源码。 3. **编译与安装**:进入源码目录,执行以下命令...

    php xdebug5.6

    **PHP Xdebug 5.6:深度解析与配置指南** Xdebug是一款强大的PHP扩展,专为开发者设计,用于提升PHP的开发效率和调试体验。它提供了丰富的功能,如代码调试、性能分析、变量查看以及错误日志记录等,极大地简化了...

    CentOS7下源码编译配置Apache2.4+MySQL5.6+PHP71

    在本文中,我们将深入探讨如何在CentOS 7操作系统上通过源代码编译来安装Apache 2.4、MySQL 5.6和PHP 7.1。这个过程对于那些希望自定义软件配置或在没有预装包的环境中部署这些服务的系统管理员来说非常有用。 首先...

    Inter Base V5.6数据库

    README FOR INTERBASE 5.6 Online documentation and Release Notes For a description of new features and changes in InterBase 5.6, use Acrobat Reader to view the ReleaseNotes.pdf file. In addition, the...

    Linux5.6_x64 Install Oracle 11g R2详细过程-Sam.docx

    Linux5.6_x64 Install Oracle 11g R2详细过程-Sam.docx

    CentOS6.5一键安装Mysql5.6

    "install_mysql"这个压缩包文件包含了MySQL 5.6的安装源代码或二进制文件。首先,解压这个压缩包: ``` tar -zxvf install_mysql ``` 然后,根据解压后的文件结构,找到MySQL的安装文件,可能是`mysql-community-...

    php-5.6_LAMP

    2. **错误处理**:PHP5.6改进了错误报告机制,引入了异常处理,允许开发者使用try-catch语句来捕获和处理运行时错误,提高了程序的健壮性。 3. **数组操作**:PHP5.6提供了更多的数组处理函数,如array_column()...

    centos系统php 5.6对应的mongo.so下载及源码

    centos系统php 5.6对应的mongo.so下载及源码 $ php -v 版本是5.6安装 不是的话 找到对应的版本再装 命令都相同只是版本号不同 在centos 64 7.2 测试通过 $ wget http://pecl.php.net/get/mongo-1.6.12.tgz $ tar -...

Global site tag (gtag.js) - Google Analytics