安装 PHP5

PHP官网www.php.net
• 当前主流版本为5./7.1
• cd /usr/local/src/
• wget http://cn2.php.net/distributions/php-5.6.30.tar.gz
• tar zxvf php-5.6..tar.gz
• cd php-5.6.
• ./configure --prefix=/usr/local/php --with-apxs2=/usr/local/apache2./bin/apxs
--with-config-file-path=/usr/local/php/etc --with-mysql=/usr/local/mysql --with-pdo-mysql=/usr/local/mysql --with-mysqli=/usr/local/mysql/bin/mysql_config
--with-libxml-dir --with-gd --with-jpeg-dir --with-png-dir --with-freetype-dir --with-iconv-dir --with-zlib-dir --with-bz2 --with-openssl --with-mcrypt --enable-soap --enable-gd-native-ttf --enable-mbstring --enable-sockets --enable-exif • 问题1
configure: error: xml2-config not found. Please check your libxml2 installation.
[root@centos7 php-5.6.]# yum list |grep xml2
[root@centos7 php-5.6.]# yum install -y libxml2-devel.x86_64  • 问题2
configure: error: Cannot find OpenSSL's <evp.h>
[root@centos7 php-5.6.]# yum install -y openssl-devel • 问题3
configure: error: Please reinstall the BZip2 distribution
[root@centos7 php-5.6.]# yum install -y bzip2-devel • 问题4
configure: error: jpeglib.h not found.[root@centos7 php-5.6.]# yum install -y libjpeg-devel • 问题5
configure: error: png.h not found.
[root@centos7 php-5.6.]# yum install -y libpng-devel • 问题6
configure: error: freetype-config not found.
[root@centos7 php-5.6.]# yum install -y freetype-devel • 问题7
configure: error: mcrypt.h not found. Please reinstall libmcrypt.
安装epel扩展源[root@centos7 php-5.6.]# yum install -y epel-release
[root@centos7 php-5.6.]# yum install -y libmcrypt-devel • make && make install • php二进制文件 /usr/local/php/bin/php • 配置文件[root@centos7 php-5.6.]# cp php.ini-production  /usr/local/php/etc/php.ini
• cp php.ini-production /usr/local/php/etc/php.ini
• php配置信息[root@centos7 php-5.6.]# /usr/local/php/bin/php -i |less

安装php7

• cd /usr/local/src/
• wget http://cn2.php.net/distributions/php-7.1.6.tar.bz2
• tar jxvf php-7.1..tar.bz2
• cd php-7.1.
./configure --prefix=/usr/local/php7 --with-apxs2=/usr/local/apache2./bin/apxs --with-config-file-path=/usr/local/php7/etc --with-pdo-mysql=/usr/local/mysql --with-mysqli=/usr/local/mysql/bin/mysql_config --with-libxml-dir --with-gd --with-jpeg-dir --with-png-dir --with-freetype-dir --with-iconv-dir --with-zlib-dir --with-bz2 --with-openssl --with-mcrypt --enable-soap --enable-gd-native-ttf --enable-mbstring --enable-sockets --enable-exif
• make && make install
• ls /usr/local/apache2./modules/libphp7.so
• 查看php加载的模块[root@centos7 php-7.1.]# /usr/local/php7/bin/php -m
• cp php.ini-production /usr/local/php7/etc/php.ini
• apacha使用哪一个PHP?
编辑配置文件: vim /usr/local/apache2./conf/httpd.conf
搜索php,不想用哪个php版本 注释掉即可。

最新文章

  1. c#批量插入数据库Demo
  2. 繁星——jquery的data()方法
  3. mysql 查询优化
  4. 移位运算符(JAVA)
  5. 第一个WP8程序,照相机
  6. cocos基础教程(11)事件分发机制
  7. OpenStack 的windows镜像的开启办法
  8. Python的数据处理学习(二)
  9. javascript 库
  10. Linux 脚本整理
  11. react native ios打包到真机
  12. MYSQL数据库-约束
  13. centos命令自动补全增强
  14. 【译】.NET Core 3.0 中的新变化
  15. 特征选择 (feature_selection)
  16. 工作笔记-table问题汇总(vue单文件组件)
  17. individual project1 12061183
  18. Nginx负载均衡中后端节点服务器健康检查的一种简单方式
  19. 简单示例用例(Simple Example Use Cases)--hive GettingStarted用例翻译
  20. 利用crontab定时备份nginx访问日志(也可以说是定时切分日志)

热门文章

  1. python2 和 python3 区别
  2. 【Ubuntu】任务管理器loadruner
  3. RedHat下安装Python开发环境
  4. Java后端测试概述
  5. Jenkins自动化构建python nose测试
  6. curl Array to string conversion 错误
  7. python matplotlib 画图
  8. JAVA实用工具--javamail
  9. [转]mysql update case when和where之间的注意事项
  10. 【Unity】角色沿路线移动/朝着目标移动