由于php程序使用了Zend Optimizer,只能使用php5.2, yum 上的php 是5.3的版本,只能重新安装php;安装步骤如下:

先卸载 php5.3的相关东西:

yum remove php php-mysql

下载php 安装包 php-5.2.15.tar.gz ZendOptimizer-3.3.9-linux-glibc23-x86_64.tar.gz  libiconv-1.14.tar.gz  可以在网上直接搜索

安装 libiconv

cd /usr/local/src/php-lib/libiconv-1.14

./configure --prefix=/usr/local/libiconv

make && make install

yum install libpng libpng-devel

yum install libXpm libXpm-devel

yum install libjpeg libjpeg-devel

yum install httpd httpd-devel

yum install mysql mysql-devel

需要拷贝如下文件到lib,php默认会查找/usr/lib/下的so文件 ,否则复制执行不成功
cd /usr/lib
ln -s /usr/lib64/mysql/libmysqlclient.so ./
ln -s /usr/lib64/libpng.so ./
ln -s /usr/lib64/libXpm.so ./
ln -s /usr/lib64/libjpg.so ./

./configure --prefix=/usr/local/php --with-apxs2=/usr/sbin/apxs --with-config-file-path=/etc --with-config-file-scan-dir=/etc/php.d --with-openssl --with-zlib --enable-bcmath --with-bz2 --enable-gd-native-ttf --with-gettext --enable-mbstring --enable-zip --with-iconv=/usr/local/libiconv --with-curl --enable-soap --enable-sockets --enable-ftp --with-mysql --with-pdo-mysql --with-gd

make && make install

编译参数解释:

--prefix=/usr/local/php : 设置安装路径
--with-apxs2=/usr/local/apache/bin/apxs : 编译共享的 Apache 2.0 模块
--with-config-file-path=/etc : 指定配置文件php.ini地址
--with-config-file-scan-dir=/etc/php.d : 指定额外的ini文件目录
--with-openssl : 编译OpenSSL支持
--with-zlib : 编译zlib支持
--enable-bcmath : 启用BC风格精度数学函数
--with-bz2 : BZip2支持
--with-gd : GD支持
--enable-gd-native-ttf : 启用TrueType字符串函数
--with-gettext : 启用GNU gettext支持
--with-mhash : mhash支持
--enable-mbstring : 启用支持多字节字符串
--with-mcrypt : 编译mcrypt加密支持
--enable-zip : 启用zip 读/写支持
--with-iconv=/usr/local/libiconv : iconv支持
--with-curl : CRUL支持
--enable-soap : SOAP支持
--enable-sockets : SOCKETS支持
--enable-ftp : FTP支持
--with-mysql=/usr/local/mysql : 启用mysql支持
--with-pdo-mysql=/usr/local/mysql : 启用pdo-mysql支持
--without-pear : 不安装PEAR

安装完后会生成php配置文件/etc/php.ini

#在/etc/httpd/conf/httpd.conf文件中加入PHP文件类型解析(加在文件最后即可)

Addtype application/x-httpd-php .php

2.配置 ZendOptimizer

tar zxvf  ZendOptimizer-3.3.9-linux-glibc23-x86_64.tar.gz

cp ZendOptimizer-3.3.9-linux-glibc23-x86_64/data/5_2_x_comp/ZendOptimizer.so /usr/lib64/php/modules/

在/etc/php.d内新增配置文件

vi /etc/php.d/zendoptimizer.ini

添加内容:

zend_extension=/usr/lib64/php/modules/ZendOptimizer.so

重启服务器

service httpd restart

使用 phpinfo查看是否 ZendOptimizer.so 安装成功

出现 with Zend Optimizer v3.3 字样说明安装成功了!

安装mysql 5.6.17

1.下载linux源码包 wget http://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.17.tar.gz

2.安装cmake等依赖软件

  1. yum -y install  gcc gcc-c++ gcc-g77 autoconf automake zlib* fiex* libxml* ncurses-devel libmcrypt* libtool-ltdl-devel* make cmake

3:编译安装

  1. [root@server182 ~]# groupadd mysql
  2. [root@server182 ~]# useradd -r -g mysql mysql
  3. [root@server182 ~]# tar -zxvf mysql-5.6.17.tar.gz
  4. [root@server182 ~]# cd mysql-5.6.17
  5. [root@server182 mysql-5.6.17]# cmake .
  6. [root@server182 mysql-5.6.17]# make && make install
  7. -------------------------默认情况下是安装在/usr/local/mysql
  8. [root@server182 ~]# chown -R mysql.mysql /usr/local/mysql
  9. [root@server182 ~]# cd /usr/local/mysql/scripts
  10. [root@server182 ~]# ./mysql_install_db --user=mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data
  11. [root@server182 ~]# cd /usr/local/mysql/support-files
  12. [root@server182 support-files]# cp mysql.server /etc/rc.d/init.d/mysqld
  13. [root@server182 support-files]# cp my-default.cnf /etc/my.cnf
  14. [root@server182 ~]# chkconfig -add mysqld
  15. [root@server182 ~]# chkconfig mysqld on
  16. [root@server182 ~]# service mysqld start
  17. Starting MySQL SUCCESS!
  18. [root@server182 support-files]# mysql
  19. Welcome to the MySQL monitor.  Commands end with ; or \g.
  20. Your MySQL connection id is 1
  21. Server version: 5.6.10 Source distribution
  22. Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
  23. Oracle is a registered trademark of Oracle Corporation and/or its
  24. affiliates. Other names may be trademarks of their respective
  25. owners.
  26. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
  27. mysql>
  28. mysql> status;
  29. --------------
  30. mysql  Ver 14.14 Distrib 5.6.10, for Linux (i686) using  EditLine wrapper
  31. Connection id:  1
  32. Current database:
  33. Current user:  root@localhost
  34. SSL:    Not in use
  35. Current pager:  stdout
  36. Using outfile:  ''
  37. Using delimiter:  ;
  38. Server version:  5.6.10 Source distribution
  39. Protocol version:  10
  40. Connection:  Localhost via UNIX socket
  41. Server characterset:  utf8
  42. Db    characterset:  utf8
  43. Client characterset:  utf8
  44. Conn.  characterset:  utf8
  45. UNIX socket:  /tmp/mysql.sock
  46. Uptime:    5 min 45 sec
  47. Threads: 1  Questions: 5  Slow queries: 0  Opens: 70  Flush tables: 1  Open tables: 63  Queries per second avg: 0.014
  48. -------------
  49. mysql>

安装完毕。

在阿里云 centos 6.3上面安装php5.2(转)的更多相关文章

  1. 阿里云centos中mysql的安装及一些常识知识

    -------------------------------------------------------------------    阿里云centos中mysql的安装 工具WinSCP v ...

  2. [转]阿里云CentOS 7.1使用yum安装MySql5.6.24

    阿里云CentOS 7.1使用yum安装MySql5.6.24 作者:vfhky | 时间:2015-06-25 09:43 | 分类:web 在前面两篇文章<2015博客升级记(四):Cent ...

  3. 阿里云centos postgresql9.4源码安装 精简步骤、问题解答

    阿里云centos环境源码安装postgresql9.4 本文的安装步骤主要来源于http://www.cnblogs.com/mchina/archive/2012/06/06/2539003.ht ...

  4. 如何安装NodeJS到阿里云Centos (64位版本V5-7)

    如何安装NodeJS到阿里云Centos (64位版本V5-7) (Centos与Red Hat® Enterprise Linux® / RHEL, Fedora属于一类) 1) 安装v0.10版 ...

  5. centos 6.5 安装阿里云的一键安装包(nginx+php5.4+mysql5.1)

    安装阿里云提供的Linux一键安装web环境全攻略,本想着会有最复杂 ,没想到阿里云工程师提供的包没有任何限制(开始以为只能在阿里去的主机上使用).开源的精神就是好(注:我是伸手党). 环境  vmw ...

  6. 阿里云centos 安装和配置 DokuWiki

    安装 1) 添加虚拟主机:由于我的 阿里云CentOs服务器 安装了oneinstack的一键部署PHP.JAVA.Nginx等环境,所以域名配置很方便,照着文档一步一步做就可以了 cd /root/ ...

  7. 阿里云Centos 7安装MongoDB 4.2.0

    背景:最近公司项目需要将后台接口优化到100ms内.因此需要对接口逻辑,数据优化做处理, 正好使用到了Redis缓存,mysql,mongoDB的优化,今天记录一下在阿里云centos上安装mongo ...

  8. 阿里云CentOs服务器 安装与配置mysql数据库

    阿里云CentOs服务器 安装与配置mysql数据库 以上为Linux安装mysql数据库 Linux 安装mysql 数据库 一下为mysql 安装教程 Using username "r ...

  9. 阿里云centos安装oracle

    目录 阿里云centos安装oracle 阿里云默认没有swap分区,oracle安装需要 安装Oracle所需的依赖包 创建用户和组 关闭SELINUX(阿里云缺省关闭) 开始安装 使用" ...

随机推荐

  1. 转:Bat命令学习

    转:http://www.cnblogs.com/SunShineYPH/archive/2011/12/13/2285570.html一.基础语法: 1.批处理文件是一个“.bat”结尾的文本文件, ...

  2. LeetCode Search a 2D Matrix(二分查找)

    题意: 有一个矩阵,每行都有序,每行接在上一行尾后仍然有序.在此矩阵中查找是否存在某个数target. 思路: 这相当于用一个指针连续扫二维数组一样,一直p++就能到最后一个元素了.由于用vector ...

  3. OGRE 2.1 Windows 编译

    版权所有,转载请注明链接 OGRE 2.1 Windows 编译 环境: Windows 7 64Bit Visual Studio 2012 OGRE 2.1 CMake 2.8.12.1 OGRE ...

  4. 用Xshell访问 虚拟机里的kali

    1.vim /etc/ssh/sshd_config 2.PermitRootLogin without-password复制 3.把一个PermitRootLogin without-passwor ...

  5. 漫水填充算法 - cvFloodFill() 实现

    前言 漫水填充算法是用来标记一片区域的:设置一个种子点,然后种子点附近的相似点都被填充同一种颜色. 该算法应用性很广,比如目标识别,photoshop 的魔术棒功能等等,是填充类算法中应用最为广泛的一 ...

  6. Python 结巴分词

    今天的任务是对txt文本进行分词,有幸了解到"结巴"中文分词,其愿景是做最好的Python中文分词组件.有兴趣的朋友请点这里. jieba支持三种分词模式: *精确模式,试图将句子 ...

  7. Linux 安装挂载时注意事项

    Linux系统下使用的是目录树系统,所以安装的时候要规划磁盘分区与目录树的挂载.实际上,在Linux系统安装的时候已经提供了相当多的默认模式让你选择分割的方式了,不过无论如何,分割的结果可能都不是能符 ...

  8. ZOJ 1047 Image Perimeters

    原题链接 题目大意:鼠标点击一块,求与之联通的所有区域的边长之和. 解法:广度优先搜索.从选中的这个点开始,往周围8个点依次搜索,访问过的点做上标记.如果该点上下左右的一个或多个方向没有相邻的点,边长 ...

  9. Color Map的生成方法

    /* Return a RGB colour value given a scalar v in the range [vmin,vmax] In this case each colour comp ...

  10. name值与id值在Js获取元素时的区别

    1.适用范围 除base.head.html.script.meta.title标签外,id都可以用:name只适用于select.form.frame.iframe.img.a.input等中. H ...