linux 虚拟机 安装 php-7.0.2
1.安装依赖包
yum -y install libxml2 libxml2-devel openssl openssl-devel libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel
yum -y install bzip2 bzip2-devel libcurl libcurl-devel gmp gmp-devel readline readline-devel libxslt libxslt-devel
2. 安装libmcrypt
-> wget http://sourceforge.net/projects/mcrypt/files/Libmcrypt/2.5.8/libmcrypt-2.5.8.tar.gz
-> tar -zxvf libmcrypt-2.5..tar.gz
-> cd libmcrypt-2.5.
-> ./configure
-> make && make install
3. 安装PHP7
-> wget http://cn2.php.net/get/php-7.0.2.tar.gz 下载 php-7.0.2.tar.gz
-> tar -zxvf php-7.0..tar.gz 解压缩
-> cd php-7.0. 进入目录 -> ./configure --prefix=/usr/local/php --with-config-file-path=/etc --enable-fpm --with-fpm-user=www --with-fpm-group=www --enable-inline-optimization --disable-debug --disable-rpath --enable-shared --enable-soap --with-libxml-dir --with-xmlrpc --with-openssl --with-openssl-dir --with-mcrypt --with-mhash --with-pcre-regex --with-pcre-dir --with-sqlite3 --with-zlib --with-zlib-dir --enable-bcmath --with-iconv --with-bz2 --enable-calendar --with-curl --with-cdb --enable-dom --enable-exif --enable-fileinfo --enable-filter --enable-ftp --with-gd --enable-gd-native-ttf --enable-gd-jis-conv --with-jpeg-dir --with-png-dir --with-freetype-dir --with-gettext --with-gmp --enable-json --enable-mbstring --enable-mbregex --enable-mbregex-backtrack --with-libmbfl --with-onig --enable-pdo --with-mysqli=mysqlnd --enable-mysqlnd-compression-support --with-pdo-mysql=mysqlnd --with-pdo-sqlite --with-readline --enable-session --enable-shmop --enable-simplexml --enable-sockets --enable-sysvmsg --enable-sysvsem --enable-sysvshm --enable-wddx --with-xsl --enable-zip --with-pear --enable-opcache
注:
--prefix=/usr/local/php 指定 php 安装目录
--with-config-file-path=/etc 设置php.ini的搜索路径。默认为PREFIX/lib
--enable-fpm 打上PHP-fpm 补丁后才有这个参数,CGI方式安装的启动程序
--with-fpm-user=www
--with-fpm-group=www
--enable-inline-optimization 优化线程
--disable-debug 关闭调试模式
--disable-rpath 关闭额外的运行库文件
--enable-shared 编译共享库,默认yes
--enable-soap soap模块
--with-libxml-dir 打开libxml2库的支持
--with-xmlrpc 打开xml-rpc的c语言
--with-openssl openssl的支持,加密传输时用到的
--with-mcrypt mcrypt算法(函数库需要安装)
--with-mhash mhash算法(函数库需要安装)
--with-pcre-regex 定 PCRE 包含文件和库文件路径
--with-sqlite3
--with-zlib 打开zlib库的支持
--enable-bcmath 打开图片大小调整,用到zabbix监控的时候用到了这个模块
--with-iconv
--with-bz2 打开对bz2文件的支持
--enable-calendar 打开日历扩展功能
--with-curl 打开curl浏览工具的支持
--with-cdb
--enable-dom
--enable-exif 图片的元数据支持
--enable-fileinfo
--enable-filter
--with-pcre-dir perl的正则库安装位置
--enable-ftp 打开ftp的支持
--with-gd 打开gd库的支持
--with-openssl-dir
--with-jpeg-dir 打开对jpeg图片的支持
--with-png-dir 打开对png图片的支持
--with-zlib-dir 打开zlib库的支持
--with-freetype-dir 打开对freetype字体库的支持
--enable-gd-native-ttf 支持TrueType字符串函数库
--enable-gd-jis-conv
--with-gettext 打开gnu 的gettext 支持,编码库用到
--with-gmp
--enable-json
--enable-mbstring 多字节,字符串的支持
--enable-mbregex
--enable-mbregex-backtrack
--with-libmbfl
--with-onig
--enable-pdo
--with-mysqli=mysqlnd mysql安装目录,对mysql的支持
--with-pdo-mysql=mysqlnd
--with-pdo-sqlite
--with-readline
--enable-session
--enable-shmop
--enable-simplexml
--enable-sockets 打开 sockets 支持
--enable-sysvmsg
--enable-sysvsem
--enable-sysvshm
--enable-wddx
--with-xsl 打开XSLT文件支持,扩展了libXML2库 ,需要libxslt软件
--enable-zip 打开对zip的支持
--enable-mysqlnd-compression-support
--with-pear 打开pear命令的支持,PHP扩展用的
--enable-opcache -> 报错解决
报错1-> configure: error: Don't know how to define struct flock on this system, set --enable-opcache=no
解决1-> 编辑 /etc/ld.so.conf 加入/usr/local/lib,在执行ldconfig
-> make
-> make install -> 配置
-> cp php.ini-development /etc/php.ini 复制配置文件 php.ini-development
-> cp /usr/local/php/etc/php-fpm.conf.default /usr/local/php/etc/php-fpm.conf
-> vim /usr/local/php/etc/php-fpm.conf pid = /var/run/php-fpm.pid 去掉前面的分号
error_log = /data/logs/php-fpm/php-fpm.log 去掉前面的分号 -> cd /usr/local/php/etc/php-fpm.d
-> cp www.conf.default www.conf 根据需求配置 -> /usr/local/php/sbin/php-fpm 启动php-fpm
-> kill -INT `cat /var/run/php-fpm.pid` 关闭php-fpm
/usr/local/php/var/run/php-fpm.pid
-> kill -USR2 `cat /var/run/php-fpm.pid` 重启php-fpm
4. 配置域名
-> cd /usr/local/nginx/conf/vhost/
-> vim www.test.com.conf upstream testphpfpm
{
server 127.0.0.1:;
}
log_format testaccess '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" $http_x_forwarded_for';
server
{
listen ;
server_name xxx.xxx.xxx;
index index.shtml index.html index.htm;
root /data/www/project; ssi on;
ssi_silent_errors on;
ssi_types text/shtml;
#error_page = http://xxx.xxx.xxx; location ~ \.php$
{
alias /data/www/project;
fastcgi_pass testphpfpm;
fastcgi_index index.php;
include fastcgi.conf; } /*下面两个IF 是兼容 CI框架 否则CI框架项目无法使用*/
if ($request_uri ~* "^/(static|data|install|\.)/.*"){
set $rule '';
}
if ($rule !~ ''){
rewrite ^/(.+)$ /index.php?/$ last;
} access_log /data/logs/nginx/xxx.xxx.xxx.log testaccess; }
-> :wq 保存退出
5. 分割日志
-> 创建脚本目录
-> cd /data
-> mkdir scripts
-> cd scripts
-> vim nginx_log_splid.sh #!/bin/sh
LOGDIR ="/data/logs/nginx"
FILEDAY = `date -d "-1 days" +%Y%m%d`
/bin/mv $nginx_log_dir/www.test.com.log $LOGDIR /www.test.com.$FILEDAY.log
kill -USR1 `cat /usr/local/nginx/logs/nginx.pid` -> :wq
-> crontab -e 添加一条定时任务
* * * /data/scripts/nginx_log_splid.sh 每晚0点执行nginx_log_splid.sh文件 测试 /usr/local/nginx/sbin/nginx -t
提示 nginx: the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok
nginx: configuration file /usr/local/nginx/conf/nginx.conf test is successful
即为配置成功。
重启 /usr/local/nginx/sbin/nginx -s reload
6. 主机访问虚拟机项目只需要完成下面配置 ^_^
在/usr/local/nginx/conf/vhost目录配置后,在主机的hosts里,将域名指向虚拟机的IP即可
实践
mkdir data/www/project
在project新建一个CI框架项目
www.test.com 直接访问出现CI欢迎界面 成功!
linux 虚拟机 安装 php-7.0.2的更多相关文章
- VMware ESXi CentOS Linux虚拟机安装VMware Tools教
转自VMware ESXi CentOS Linux虚拟机安装VMware Tools教程 | 一米居 http://www.yimiju.com/articles/548.html 最近一周在学习和 ...
- Linux虚拟机安装(rhel 7.4)
Linux虚拟机安装(rhel 7.4) linux 1. 创建虚拟机 1.1. 新建虚拟机 1.2. 启动虚拟机 附录:部分配置 1. 创建虚拟机 1.1. 新建虚拟机 新建虚拟机 典型虚拟机 稍后 ...
- Linux下安装Python3.3.0
Linux下安装Python3.3.0_路易_新浪博客 Linux下安装Python3.3.0 (2013-01-08 11:45:37)
- Kali Linux虚拟机安装完整安装过程及简单配置(视频)
点击播放视频 附:视频中出现的两个txt文本,包含了大致的安装与配置过程: 文本1:KaliLinux虚拟机安装和初步配置 Kali Linux虚拟机安装和初步配置 大家好,今天给大家演示一下在VMw ...
- kail linux 虚拟机安装实录(一) 新建虚拟机
各位晚上好. 现在开始进行kail linux 在虚拟机上的安装. 我所使用的工具如下: kail linux 2.0 x64 http://mirrors.neusoft.edu.cn/kal ...
- VMware Workstation 安装以及Linux虚拟机安装 指北
最近有挺多小伙伴跟我说起虚拟机这个东西,所以,今天就给大家写一篇虚拟机安装使用指北吧. 虚拟机(英语:virtual machine),在计算机科学中的体系结构里,是指一种特殊的软件,可以在计算机平台 ...
- vsphere中的linux虚拟机安装vmware-tools
先在vcenter中选中虚拟机点击安装这个工具,如图 然后这台linux虚拟机的控制台操作,挂载先建立挂载目录 cd /mnt #在挂载建一个用来挂载的文件. mkdir cdrom 使用mount命 ...
- linux虚拟机安装centos6.x
安装系统,作为每一个it技术控们的基本功,对于各位大神和技术大牛们应该是易如反掌或者是家常便饭啦,都是从无数次安装,重装,刷机中一步步走来的.那么今天,我也分享一套装机教程,共各位和我一样的小白参考或 ...
- Linux虚拟机安装(CentOS 6.5,图文详解,需要自查)
Linux虚拟机的安装(图文详解) 下篇会接续Hadoop集群安装(以此为基础) 一.安装准备 VMWorkstation.linux系统镜像(以下以CentOS6.5为例) 二.安装过程详解 关闭防 ...
- linux虚拟机安装演示
做为一名linux初学者来说,在本机上安装linux虚拟机做为平时练习工具极为重要,此方式在充分体验linux操作乐趣的同时,又能保证不破坏已经配置好的服务器.所以虚拟机是一种很好的学习工具了.下面总 ...
随机推荐
- 作业1开发一个简单的python计算器
开发一个简单的python计算器 实现加减乘除及拓号优先级解析 用户输入 1 - 2 * ( (60-30 +(-40/5) * (9-2*5/3 + 7 /3*99/4*2998 +10 * 568 ...
- java 调用系统外部的某个程序
有时候我们java 调用系统外部的某个程序 可能需要调用系统外部的某个程序,此时就可以用Runtime.getRuntime().exec()来调用,他会生成一个新的进程去运行调用的程序. 此方法返回 ...
- 1.1.Task Queue
任务队列是一种跨线程.跨机器工作的一种机制. 任务队列中包含称作任务的工作单元.有专门的工作进程持续不断的监视任务队列,并从中获得新的任务并处理. celery通过消息进行通信,通常使用一 ...
- idea将项目导出为war包
idea 那么好用,早就把eclipse抛弃了.不过每次都是在给项目发包的时候,不得不重新打开eclipse导出为war包.感觉自己蠢蠢的.上网查了一下教程,按照网上的教程设置好了之后,运行项目发现并 ...
- 斯坦福CS229机器学习课程笔记 part3:广义线性模型 Greneralized Linear Models (GLMs)
指数分布族 The exponential family 因为广义线性模型是围绕指数分布族的.大多数常用分布都属于指数分布族,服从指数分布族的条件是概率分布可以写成如下形式:η 被称作自然参数(nat ...
- SpringMVC的控制器接收前端数据的方式
1.请求处理方法中可以出现以下几种参数类型,直接在controller方法形参上定义默认类型的对象,就可以使用这些对象.可以通过下列对象来获取前台传来的参数: ①HttpServletRequest对 ...
- MobileSubstrate
[MobileSubstrate] Cydia Substrate (formerly called MobileSubstrate) is the de facto framework that a ...
- java基础之io流总结四:字符流读写
字符流读写只适用于字符文件. 基本字符流(转换流)读写文件 转换流本身是字符流,但是实例化的时候传进去的是一个字节流,所以叫做转换流 InputStreamReader isr = new Input ...
- python子进程模块subprocess详解与应用实例 之二
1.2. Popen 对象 Popen类的实例有下列方法: 1. Popen.poll() 检查子进程是否已经结束,设置并返回返回码值. 2. Popen.wait() 等待子进程结束,设置并返回返回 ...
- python小程序:备份文件
设计程序,有以下步骤: 需要备份的文件和目录由一个列表指定. 备份应该保存在主备份目录中. 文件备份成一个zip文件. zip存档的名称是当前的日期和时间. 解决方案: 版本一: #!/usr/bin ...