Centos7.6手工编译安装PHP7.2+nginx1.19.1并部署禅道
Posted passedbylove
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Centos7.6手工编译安装PHP7.2+nginx1.19.1并部署禅道相关的知识,希望对你有一定的参考价值。
本文是从Windows上将禅道12.3.1迁移到Centos7.6
安装步骤如下:
curl -o /usr/local/src/php-7.2.32.tar.gz https://www.php.net/distributions/php-7.2.32.tar.gz
yum install gcc libxml2-devel openssl-devel curl-devel -y
cd /usr/local/src
tar -zxvf php-7.2.32.tar.gz
cd php-7.2.32
#编译安装
./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/php/etc --enable-fpm --with-fpm-user=nobody --with-fpm-group=nobody --enable-mbstring --with-mysql=mysqlnd --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd --with-curl --with-zlib --with-openssl
make&&make install
#配置php
cp /usr/local/src/php-7.2.32/php.ini-production /usr/local/php/etc/php.ini
ln -s /usr/local/php/etc/php.ini /etc/php.ini
cp /usr/local/php/etc/php-fpm.conf.default /usr/local/php/etc/php-fpm.conf
cp /usr/local/src/php-7.2.32/sapi/fpm/init.d.php-fpm /etc/init.d/php-fpm
增加可执行权限
chmod +x /etc/init.d/php-fpm
修改配置文件php.ini
date.timezone = PRC
session.save_path="/var/lib/php/session"
记得要手动创建下这个目录
mkdir -p /var/lib/php/session
cd /usr/local/php/etc/php-fpm.d/*.conf
cp www.conf.default www.conf
service php-fpm start
yum install -y gcc gcc-c++ pcre pcre-devel zlib zlib-devel openssl openssl-devel
#下载安装nginx
curl -o /usr/local/src/nginx-1.19.1.tar.gz http://nginx.org/download/nginx-1.19.1.tar.gz
cd /usr/local/src/
tar -zxvf nginx-1.19.1.tar.gz
#编译安装nginx
./configure --prefix=/usr/local/nginx --with-http_ssl_module --with-http_gzip_static_module --pid-path=/usr/local/nginx/conf/nginx.pid --with-pcre
make&&make install
#建立软链接
cd /etc/
ln -s /usr/local/nginx/conf/nginx.conf nginx.conf
cd /usr/sbin
ln -s /usr/local/nginx/sbin/nginx nginx
#下载禅道
#1、禅道项目管理软件源码下载
#、一定要下载中文版,否则后面不能继续进行
curl -o /usr/local/src/ZenTaoPMS.12.3.1.zip http://dl.cnezsoft.com/zentao/12.3.1/ZenTaoPMS.12.3.1.zip?i=1
cd /usr/local/src
unzip ZenTaoPMS.12.3.1.zip
mdir /opt/zentao/
mv zentaopms/* /opt/zentao/
#配置权限
chmod o=rwx -R /opt/zentao/tmp/
chmod o=rwx -R /opt/zentao/www/data
chmod o=rwx -R /var/lib/php/session
#编辑配置
vim /etc/nginx.conf
worker_processes 4;
pid conf/nginx.pid;
location /
root /opt/zentao/www;
index index.php index.html index.htm;
location ~ \\.php$
root /opt/zentao/www; fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
chown -R nobody:nobody /var/lib/php
service php-fpm restart
nginx -s reload
#创建禅道账户
create database zentao;
CREATE USER zentao@localhost IDENTIFIED BY Honghu@2019-2018;
GRANT SELECT, INSERT, UPDATE, DELETE, ALTER, CREATE, DROP, INDEX, LOCK TABLES, REFERENCES ON zentao.* TO zentao@localhost;
FLUSH PRIVILEGES;
CREATE USER zentao@127.0.0.1 IDENTIFIED BY Honghu@2019-2018;
GRANT SELECT, INSERT, UPDATE, DELETE, ALTER, CREATE, DROP, INDEX, LOCK TABLES, REFERENCES ON zentao.* TO zentao@127.0.0.1;
FLUSH PRIVILEGES;
CREATE USER zentao@% IDENTIFIED BY Honghu@2019-2018;
GRANT SELECT, INSERT, UPDATE, DELETE, ALTER, CREATE, DROP, INDEX, LOCK TABLES, REFERENCES ON zentao.* TO zentao@%;
FLUSH PRIVILEGES;
#数据迁移
1、导出禅道表结果,远程连接过去执行
2、将xampp\\zentao\\www\\data\\upload上传到/opt/zentao/www/data/upload/
3、给上传目设置权限sudo chmod -R 777 /opt/zentao/www/data/upload/
本文参考:https://yq.aliyun.com/articles/645384
安装成功后如下
以上是关于Centos7.6手工编译安装PHP7.2+nginx1.19.1并部署禅道的主要内容,如果未能解决你的问题,请参考以下文章
centos7.6环境的php7.2.24环境安装opencc4php模块
centos7.6环境的php7.2.24环境安装opencc4php模块