centos7.6,nginx1.18,php-7.4.6,mysql-5.7.30 安装
#1、下载,来自各官网 nginx-1.18.0.tar.gz php-7.4.6.tar.gz mysql-5.7.30-linux-glibc2.12-x86_64.tar.gz #下载到本地再传到服务器,比直接wget快 #2、准备工作 yum install -y libxml2 libxml2-devel bzip2 bzip2-devel libcurl libcurl-devel libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel gmp gmp-devel libmcrypt libmcrypt-devel readline readline-devel libxslt libxslt-devel zlib zlib-devel glibc glibc-devel glib2 glib2-devel ncurses curl gdbm-devel db4-devel libXpm-devel libX11-devel gd-devel gmp-devel expat-devel xmlrpc-c xmlrpc-c-devel libicu-devel libmcrypt-devel libmemcached-devel yum install libsqlite3x-devel -y
yum install oniguruma-devel -y
yum install -y gcc gcc-c++ openssl-devel
yum install pcre pcre-devel zlib zlib-devel -y groupadd www
useradd -M -s /sbin/nologin www groupadd mysql
useradd -M -s /sbin/nologin mysql #openssl升级安装
#参考
https://www.cnblogs.com/itbsl/p/11275728.html #php7 编译需要高本版zlib,libzip >= 0.11
#libzip-1.2.0.tar.gz
#libzip-1.6X需要高版本cmake,我机器安装报错就没有用 cd libzip-1.2.0
./configure
make && make install #在网上找到的教程到了这一步就直接让你继续在PHP源码目录里面执行configure程序继续配置了,其实你虽然已经安装了libzip1.2,但是PHP的configure程序依然找不到,不知道你安装在哪,你得告诉PHP的configure程序,我安装了libzip 1.2,并且安装在何处。以前是用ldconfig来通告系统所需动态库文件的位置,现在用pkg-config。我刚刚提供的方法安装的libzip默认被安装到了 /usr/local/lib 在这个目录下你能看到libzip.so libzip.so.5 libzip.so.5.0.0 还有一个pkgconfig目录。所以,真正的解决方法来了,在你configure的会话窗口直接输入如下内容:
export PKG_CONFIG_PATH="/usr/local/lib/pkgconfig/" #参考:https://www.cnblogs.com/equation/p/12352596.html #tools 解压目录
#nginx 安装
#参考 https://blog.csdn.net/nouswait/article/details/83105378
#https://blog.csdn.net/qq_42303254/article/details/87886098 cd /opt/nginx/tools/nginx-1.8.0
./configure --user=www --group=www --prefix=/opt/ngin
make && make install #php 安装
cd php
./configure --prefix=/opt/php --with-config-file-path=/etc --with-fpm-user=www --with-fpm-group=www --with-curl --with-freetype --enable-gd --with-gettext --with-iconv-dir --with-kerberos --with-libdir=lib64 --with-libxml --with-mysqli --with-openssl --with-pdo-mysql --with-pdo-sqlite --with-pear --with-jpeg --with-zip --with-xmlrpc --with-xsl --with-zlib --with-bz2 --with-mhash --enable-fpm --enable-bcmath --enable-inline-optimization --enable-mbregex --enable-mbstring --enable-opcache --enable-pcntl --enable-shmop --enable-soap --enable-sockets --enable-sysvsem --enable-sysvshm --enable-xml --enable-fpm #php 安装参考
https://hqidi.com/150.html
https://www.cnblogs.com/liubaoqing/p/12176017.html #mysql 安装
#参考https://www.cnblogs.com/haima/p/12276063.html ./mysqld –initialize --defaults-file=/etc/my.cnf --basedir=/opt/mysql --datadir=/opt/mysql/data --user=mysql
#data 为数据文件夹
chown -R mysql:mysql data #授权my.cnf
chown 777 /etc/my.cnf #复制启动脚本到资源目录
cp -a /opt/mysql/support-files/mysql.server /etc/init.d/mysqld #增加mysqld服务控制脚本执行权限
chmod +x /etc/init.d/mysqld #将mysqld服务加入到系统服务
chkconfig --add /etc/init.d/mysqld
/opt/mysql/bin/mysqld_safe --user=mysql & #启动mysql服务
/etc/init.d/mysqld restart #显示默认密码
cat /root/.mysql_secret
#登录并修改密码,省略 #mysql 安装参考
https://blog.csdn.net/ahangliu/article/details/106476385 #linux系统下将php和mysql命令加入到环境变量中的方法 PATH=$PATH:/opt/php/bin:/opt/mysql/bin
export PATH #加入开机启动php [Unit]
Description=The PHP FastCGI Process Manager
After=syslog.target network.target [Service]
Type=simple
PIDFile=/run/php-fpm.pid
ExecStart=/opt/php/sbin/php-fpm --nodaemonize --fpm-config /opt/php/etc/php-fpm.conf
ExecReload=/bin/kill -USR2 $MAINPID
ExecStop=/bin/kill -SIGINT $MAINPID [Install]
WantedBy=multi-user.target #加入开机启动nginx [Unit]
Description=nginx - high performance web server
After=network.target remote-fs.target nss-lookup.target [Service]
Type=forking
ExecStart=/opt/nginx/sbin/nginx
ExecReload=/opt/nginx/sbin/nginx -s reload
ExecStop=/opt/nginx/sbin/nginx -s stop [Install]
WantedBy=multi-user.target #加入开机启动mysql,我没有使用 [Unit]
Description=MySQL Server
Documentation=man:mysqld(8)
After=network.target
After=syslog.target [Install]
WantedBy=multi-user.target [Service]
User=mysql
Group=mysql
ExecStart=/opt/mysql/bin/mysqld --defaults-file=/etc/my.cnf
LimitNOFILE = 5000
#Restart=on-failure
#RestartPreventExitStatus=1
#PrivateTmp=false #开机启动参考
https://www.cnblogs.com/yingsi/p/8482639.html
https://www.cnblogs.com/onephp/p/6093707.html
https://www.cnblogs.com/shiqiangqiang/p/8398931.html #mysql 配置参考
https://www.cnblogs.com/kanyun/p/8075414.html #Mysql5.5&Mysql5.6&Mysql5.7特性
https://blog.csdn.net/zxz547388910/article/details/78671911 #vim 中批量添加注释
https://blog.csdn.net/yzs_110/article/details/90643327
############centos 7 php5.6 编译安装################
#下载
地址:
https://www.php.net/releases/index.php
搜索 5.6
tar -zxvf php-5.6.40.tar.gz
cd php-5.6.40 #执行前置安装
yum install -y libxml2 libxml2-devel libicu libicu-devel openldap openldap-devel libxslt-devel freetype* libjpeg* libpng* #编译
./configure --prefix=/opt/php56 --with-config-file-path=/etc --with-fpm-user=www --with-fpm-group=www --with-curl --with-gd --with-gettext --with-iconv-dir --with-kerberos --with-libdir=lib64 --with-mysql --with-mysqli --with-openssl --with-pdo-mysql --with-pdo-sqlite --with-pear --with-freetype-dir=/usr/include/freetype2 --enable-gd-native-ttf --with-jpeg-dir=/usr/include --with-png-dir=/usr/include --enable-zip --with-xmlrpc --with-xsl --with-zlib --with-bz2 --with-mhash --enable-fpm --enable-bcmath --enable-inline-optimization --enable-mbregex --enable-mbstring --enable-opcache --enable-pcntl --enable-shmop --enable-soap --enable-sockets --enable-sysvsem --enable-sysvshm --enable-xml --enable-fpm # freetype yum 安装在了 /usr/include/freetype2 可通过 find / -name freetype 查看,其他类同 #安装
make && make install #如果出现这个错误 先清除下再重新编译 和安装
libtool: link: `ext/opcache/ZendAccelerator.lo' is not a valid libtool object
#解决办法:
make distclean #配置
cp -a php.ini-production /opt/php56/etc/php.ini
rm /etc/php.ini -rf
ln -s /opt/php56/etc/php.ini /etc/php.ini cp sapi/fpm/php-fpm.conf /opt/php56/etc/
cp -a sapi/fpm/init.d.php-fpm /etc/init.d/php-fpm
#改执行权限
chmod +x /etc/init.d/php-fpm #启动
/etc/init.d/php-fpm start
或
service php-fpm start
参考 :感谢
https://blog.csdn.net/stacy06/article/details/84032985
https://www.cnblogs.com/bigcatking/p/5340609.html
https://blog.csdn.net/chen55bo/article/details/71172463
500 无输出 不报错 请问如何快速定位错误代码
万能代码
register_shutdown_function(function(){ var_dump(error_get_last()); });
centos7.6,nginx1.18,php-7.4.6,mysql-5.7.30 安装的更多相关文章
- 手动编译部署LNMP环境(CentOS7.5+Nginx-1.18.0+MySQL-5.7.30+PHP-7.4.14)
在平时运维工作中,经常需要用到LNMP应用框架.LNMP环境是指在Linux系统下,由Nginx + MySQL + PHP组成的网站服务器架构. 可参考前面的文章: 如何在CentOS 7上搭建LA ...
- CentOS7下Mysql 5.6.30安装与配置
环境:centos 7 x64 先下载mysql安装包 打开 http://dev.mysql.com/downloads/mysql/ 选择 linux - Generic 再选择 下载完毕后,得 ...
- centos7 安装 nginx-1.18.0 并设置开机自启动
一.到官网下载nginx Mainline version: nginx主力版本,为开发版 Stable version: 稳定版,在生产环境中选择此版本进行安装 Legacy versions: ...
- ansible:安装nginx1.18.0(使用role功能)
一,ansible使用role的用途? roles分别将变量/文件/任务/模板/handler等放置于单独的目录中, 并可以方便的include各目录下的功能 roles使playbook能实现代码被 ...
- nginx集群:nginx配置负载均衡集群(nginx1.18.0)
一,nginx的负载均衡集群的特点: 1,nginx集群和lvs的不同? lvs集群:工作在第4层(传输层) nginx集群:工作在第7层(应用层) lvs集群:性能更强 nginx集群:功能更强:可 ...
- nginx优化:配置gzip压缩页面提高访问速度(nginx1.18.0)
一,为什么nginx要使用gzip 1,压缩的作用: 页面使用gzip压缩之后, 页面大小可以压缩到原来的1/7左右, 传输速度和页面打开时间都可以大幅度提高, 有利于用户访问页面体验的提升 2,Ng ...
- nginx安全:修改对外的服务软件名称并隐藏版本号(nginx1.18.0)
一,为什么要隐藏nginx真实的软件名称? 1,nginx响应的Server头部都会携带上服务软件的名字和版本信息, 服务器软件的版本信息暴光在外部,很容易被黑客了解到,就通过相应版本的漏洞来攻击服务 ...
- centos8平台编译安装nginx1.18.0
一,nginx的官网: http://nginx.org/ 说明:刘宏缔的架构森林是一个专注架构的博客,地址:https://www.cnblogs.com/architectforest 对应的源码 ...
- MySQL基础环境_安装配置教程(Windows7 64或Centos7.2 64、MySQL5.7)
MySQL基础环境_安装配置教程(Windows7 64或Centos7.2 64.MySQL5.7) 安装包版本 1) VMawre-workstation版本包 地址: https://m ...
随机推荐
- 消息协议AMQP 与 JMS对比
https://blog.csdn.net/hpttlook/article/details/23391967 https://www.jianshu.com/p/6e6821604efc https ...
- DVWA靶场之File Upload(文件上传)通关
Low: <?php if( isset( $_POST[ 'Upload' ] ) ) { // Where are we going to be writing to? $target_pa ...
- NOIP 模拟 $20\; \rm 玩具$
题解 \(by\;zj\varphi\) 一道概率与期望好题 对于一棵树,去掉根后所有子树就是一个森林,同理,一个森林加一个根就是一棵树 设 \(f_{i,j}\) 为有 \(i\) 个点的树,高度为 ...
- Mybatis-Plus入门学习笔记(一)
本文内容 了解Mybatis-Plus 整合Mybatis-Plus 1.了解Mybatis-plus 1.1.Mybatis-Plus介绍 MyBatis-Plus(简称 MP)是一个 MyBati ...
- [1.1W字] 复习: CSS 9个背景属性&6种渐变函数, 学会可以手写实现AI中强大的"任意渐变"! #Archives009
Title/ CSS Background&Gradient完全指南 #Archives009 序: 关于 background 属性, 了解点CSS的人总会知道个大概. 但是你肯定多半还有点 ...
- Nginx-出现-403-Forbidden
步骤一: 检查目录权限.权限不足的就加个权限吧. 例子:chmod -R 755 / var/www 步骤二: 打开nginx.conf 例子:vim /etc/nginx/nginx.conf 把 ...
- CentOS7 安装Oracle19c数据库RPM包安装
我前两天发了安装oracle12c的方法,但是我虽然在虚拟机试验成功了,正式服务器安装的时候发现还是不行,安装页面卡空白,也没有解决办法,所以我就放弃了界面安装找命令行安装的办法,找了一些之后发现都比 ...
- SpringCloud bootstrap.yml 和application.yml 加载原理
Spring Cloud 官方文档:https://cloud.spring.io/spring-cloud-static/spring-cloud.html 一个Spring Cloud的操作是通过 ...
- 通过location响应头实现重定向
package day08; import java.io.IOException; import javax.servlet.ServletException; import javax.servl ...
- 一个简单的 aiax请求例子
<!DOCTYPE html> <html> <head> <meta http-equiv="content-type" content ...