- 准备工作:
安装:
虚拟机 ( virtualbox 或是 vmware )
终端连接工具( Xshell 或者 SecureCRT )
(1). Linux安装采用的是centos
下载镜像地址:http://isoredirect.centos.org/centos/7/isos/x86_64/CentOS-7-x86_64-Everything-1611.iso
自行选择下载
- 打开virtualbox 虚拟机
- 点击— 新建—填入新建名称—下一步一直下一步–完成
- 点击 运行 再弹出的框选择你下载好的镜像文件\
- 然后启动,后续的安装可自行百度!
使用xshell 登录远端!
(2) 安装 PHP
php官网 : http://php.net (选择版本)
如果后面选择安装nginx ,
首先要安装:FastCGI 进程管理器(FPM),
地址:http://php.net/manual/zh/install.fpm.install.php
复制php版本download链接使用 wget下载 如:
安装部分依赖:sudo yum install gcc gcc++ libxml2-devel
php下载 : wget http://hk1.php.net/get/php-7.0.19.tar.gz/from/this/mirror
解压: tar -zxvf php-7.0.19.tar.gz
切换目录:cd php-7.0.19.tar.gz
安装php: ./configure --prefix=/usr/local/php7-xu --enable-fpm 编译指定安装目录
编译安装 :
make
sudo make install
安装完成之后cd 切换 根目录测试:
vim test.php
<?php
echo 123;
phpinfo();
使用安装的php执行: /usr/local/php7-xu/bin/php test.php
(3) . 安装apche
官网地址 : http://httpd.apache.org/
- 同样复制apache版本downloads地址链接:
apache下载 : wget http://mirrors.tuna.tsinghua.edu.cn/apache//httpd/httpd-2.4.25.tar.gz
apache解压 : tar -zxvf httpd-2.4.25.tar.gz
切换目录 : cd httpd-2.4.25.tar.gz
执行 : ./configure --prefix=/usr/local/apache
报错 : configure: error: APR not found . Please read the documentation
- 下载所需软件包:
(1)wget http://archive.apache.org/dist/apr/apr-1.4.5.tar.gz
(2)wget http://archive.apache.org/dist/apr/apr-util-1.3.12.tar.gz
(3)wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre2-10.21.tar.bz2
解压:
tar -zxvf apr-1.4.5.tar.gz
tar -zxvf apr-util-1.3.12.tar.gz
- (pcre解压 官网地址:http://www.pcre.org/)
tar -jxvf pcre2-10.21.tar.bz2
./configure --prefix=/usr/local/pcre2-10.21
make
sudo make install
重命名移动去掉版本号:
mv apr apr-util httpd-2.4.25/srclib/
- 重新编译安装:
执行:
./configure --prefix=/usr/local/apache -with-pcre=/usr/local/pcre2-10.21/bin/pcre-config -with-included-apr
make
sudo make install
执行完毕后进入cd /usr/local/pcre2-10.21/bin 目录:
启动:sudo apachectl -k start
(4) Mysql 数据库的安装
官网地址 : https://dev.mysql.com/
安装mysql所需要的一些依赖工具
sudo yum install cmake gcc-c++ ncurses-devel perl-Data-Dumper boost boost-doc boost-devel
下载 : wget https://dev.mysql.com/get/Downloads/MySQL-5.7/mysql-5.7.18.tar.gz
mysql 暂时有点问题 编译会报错 待修改步骤!