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 ...
随机推荐
- 1056 Mice and Rice (25分)队列
1.27刷题2 Mice and Rice is the name of a programming contest in which each programmer must write a pie ...
- 刚学spark
https://blog.csdn.net/u013019431/article/details/80776662 在jupyter notebook import pysparkhttps:// ...
- Asp.Net Core Razor页面中使用echarts展示图形
Asp.Net Core Razor页面中使用echarts展示图形 要在Razor页面中使用echarts显示图形,主要问题点在于如何将数据传递给js文件. 1,下载安装echarts库文件 首先引 ...
- VsCode安装使用教程和插件安装方法
许多渗透方式都python写脚本,比较方便,写一下vscode和插件的安装办法,虽然不是很复杂,但是写一下做一下笔记: Visual Studio Code (简称 VS Code / VSC) 是一 ...
- HTTP状态码关于各个网站的实地调查
我使用的是新版Edge浏览器,右键,点击检查,点击网络,可以看到请求的各种文件.那么以此来看看状态码的使用吧. 101 与websocket相关,websocket在慕课网中的应用 - KeBoom ...
- 熟悉而陌生的新朋友——IAsyncDisposable
本文作者--句幽 在.NET Core 3.0的版本更新中,官方我们带来了一个新的接口 IAsyncDisposable. 小伙伴一看肯定就知道,它和.NET中原有的IDisposable接口肯定有着 ...
- javascript - 将字符串转换为模板字符串
参考: https://www.itranslater.com/qa/details/2325714161562551296 是否可以将模板字符串创建为常用字符串 let a="b:${b} ...
- 如何快速排查发现redis的bigkey?4种方案一次性给到你!
本篇文章将以redis的bigkey为主题进行技术展开,通过从认识redis的高性能,bigkey的危害.存在原因.4种解决方案,到模拟实战演练的介绍方式,来跟大家一起认识.探讨和学习redis. 先 ...
- wpf 获得exe的运行路径
System.Reflection.Assembly.GetEntryAssembly().Location
- 【转】Linux tar命令详解
参考:https://blog.csdn.net/kkw1992/article/details/80000653 linux下最常用的打包程序就是tar了,使用tar程序打出来的包我们常称为tar包 ...