lnmp安装

可选:查找已安装的安装包
rpm -qa 或者 rpm -qa |grep 包名
yum list installed 或者 yum list installed | grep ruby
查找yum和rpm的安装目录:yum安装,实质上是用RPM安装
rpm -qc 包名
-l 显示软件包中的文件列表
-c 显示配置文件列表
RPM默认安装路径如下:
/etc 一些配置文件的目录,例如/etc/init.d/mysql
/usr/bin 一些可执行文件
/usr/lib 一些程序使用的动态函数库
/usr/share/doc 一些基本的软件使用手册与帮助文档
/usr/share/man 一些man page文件

apache:
如果采用RPM包安装,安装路径应在 /etc/httpd目录下
apache配置文件:/etc/httpd/conf/httpd.conf
Apache模块路径:/usr/sbin/apachectl
web目录:/var/www/html
如果采用源代码安装,一般默认安装在/usr/local/apache2目录下

PHP:
如果采用RPM包安装,安装路径应在 /etc/目录下
php的配置文件:/etc/php.ini
如果采用源代码安装,一般默认安装在/usr/local/lib目录下
php配置文件: /usr/local/lib/php.ini
或/usr/local/php/etc/php.ini

MySQL:
如果采用RPM包安装,安装路径应在/usr/share/mysql目录下
mysqldump(备份)文件位置:/usr/bin/mysqldump
mysqli配置文件:
/etc/my.cnf或/usr/share/mysql/my.cnf
mysql数据目录在/var/lib/mysql目录下
如果采用源代码安装,一般默认安装在/usr/local/mysql目录下

 

1、安装工具(非必须(gcc除外)自行删减)

这里用yum安装一下在编译过程中所需要的编译工具和小程序,如:gcc、gd库、cmake等等。这么多小软件,我们不需要编译安装,因为这些软件安装后,以后并不会修改操作,只是一个工具而已。

yum install -y gcc gcc-c++ make sudo autoconf libtool-ltdl-devel gd-devel \
        freetype-devel libxml2-devel libjpeg-devel libpng-devel \
        openssl-devel curl-devel patch libmcrypt-devel \
        libmhash-devel ncurses-devel bzip2 \
        libcap-devel ntp sysklogd diffutils sendmail iptables unzip cmake

 

nginx安装

nginx安装:
http://nginx.org/en/download.html 寻找nginx的版本

下载到任一目录
安装依赖包:(必须:openssl、pcre、zlib ,gcc是所有安装包都依赖的)

检查openssl是否安装:rpm -qa openssl openssl-devel

检查pcre是否安装:rpm -qa pcre-devel pcre

检查zlib是否安装:rpm -qa zlib-devel zlib

关于zlib与zlib-devel的区别:

以 zlib和 zlib-devel(有的是**-dev) 为例:

如果你安装基于 zlib 开发的程序,只需要安装 zlib 包就行了。

但是如果你要编译使用了 zlib 的源代码,则需要安装 zlib-devel。
yum install gcc gcc-c++ make automake autoconf libtool pcre* zlib openssl openssl-devel

wget http://nginx.org/download/nginx-1.17.1.tar.gz
解压并进入解压后的目录:tar -zxvf nginx-1.17.1.tar.gz


创建运行的用户和组:

groupadd nginx
useradd -M -s /sbin/nologin -g nginx nginx
或者useradd -M -s /sbin/nologin nginx (这样也没问题:useradd nginx -M -s /sbin/nologin)

查看创建的用户 cat /etc/passwd

nginx:x:1001:1001::/home/nginx:/sbin/nologin

格式: 用户名:密码:用户id:用户所在组的id:备注:家目录:执行shell类型可执行文件命令的目录

重新赋予权限:

mkdir /usr/local/nginx
chmod -R 755 /usr/local/nginx/
chown nginx:nginx /usr/local/nginx/

配置:

参数之间至少有一个空格隔开且不能有\r\n换行符

./configure --prefix=/usr/local/nginx --conf-path=/usr/local/nginx/config/nginx.conf --user=nginx --group=nginx --with-http_stub_status_module --with-http_ssl_module --with-email

./configure --prefix=/usr/loacl/nginx 
--sbin-path=/usr/local/nginx 
--conf-path=/usr/local/nginx/config/nginx.conf 
--pid-path=/usr/local/nginx/nginx.pid 
--with-http_ssl_module 

 --with-http_perl_module
--with-zlib=/tmp/zlib-1.2.11        非yum安装的需要指定安装目录
--with-pcre=/tmp/pcre-8.41                  同上
--with-openssl=/tmp/openssl-1.0.21    同上

############

--prefix=PATH      要安装到的目录

--sbin-path=PATH   指定nginx二进制文件的路径,没指定的话这个路径依赖 --prefix 选项

--conf-path=PATH   如果在命令行未指定配置文件,那么将会通过 --prefix 指定的路径去查找配置文件

--error-log-path=PATH  错误文件路径,nginx写入错误日志文件地址

--pid-path=<path>   nginx master进程pid写入的文件位置,通常在var/run下 

--user=<user>       worker进程运行的用户

--group=<group>     worker进程运行的组

--with-http_ssl_module 开启 ssl 模块

--with-zlib=DIR 设置 指向zlib 的源码目录

--with-openssl=DIR  设置 指向openssl 的源码目录

--with-pcre=DIR设置 指向pcre 的源码目录

 --with-http_stub_status_module

 

make && make install

 

安装完成可执行文件是/usr/local/nginx/sbin/nginx

校验配置文件:
/usr/local/nginx/sbin/nginx -t # 校验默认的配置文件
/usr/local/nginx/sbin/nginx -t -c /path/to/configfile # 校验指定配置文件

启动:
/usr/local/nginx/sbin/nginx #自动读取配置文件目录下的“nginx.conf”配置文件
/usr/local/nginx/sbin/nginx -c /path/to/configfile #指定配置文件启动

停止:
/usr/local/nginx/sbin/nginx -s stop # 快速关闭
/usr/local/nginx/sbin/nginx -s quit # 安全关闭

重载
/usr/local/nginx/sbin/nginx -s reload # 重载配置文件

查看版本
/usr/local/nginx/sbin/nginx -V

设置全局命令

 export PATH=$PATH:/usr/local/nginx/sbin/
#PATH变量后裔可定义多个以:分割。例:
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
exprot PATH

 

切割日志
nginx -s reload #重新打开一个log文件,用于日志切割

防火墙放行80端口

firewall-cmd --zone=public --add-port=80/tcp --permanent

重启防火墙:

systemctl restart firewalld.service(centos7之前使用service iptables restart)

 

浏览器访问ip地址成功!

 

 

可选配置参数官方参考

中文翻译nginx编译安装之-./configure 参数详解

在你当前版本的解压后nginx目录下执行 ./configure --help 命令时户出现下面好多选项注意with与without:

 --with开头的,默认是禁用的(没启动的,想使用的话需要在编译的时候加上)

 --without开头的,默认是启用的(不想启用此模块时,可以在编译的时候加上这个参数)

  --prefix=PATH                      配置软件的安装目录
  --sbin-path=PATH                   设置可执行文件目录
  --modules-path=PATH                set modules path
  --conf-path=PATH                   设置nginx.conf配件文件的路径--error-log-path=PATH              设置主请求的错误、警告、诊断的access.log日志文件的名称--pid-path=PATH                    设置存储主进程id的文件名称--lock-path=PATH                   设定lock文件(nginx.lock)目录--user=USER                        设置工作进程使用的非特权用户的用户名,默认为nobody--group=GROUP                      设置工作进程使用的非特权用户组的名称--build=NAME                       设定程序编译目录
  --builddir=DIR                     set build directory

  --with-select_module               允许select模块(一种轮询模式,不推荐用在高载环境)
  --without-select_module            不使用select模块
  --with-poll_module                 允许poll模块(一种轮询模式,不推荐用在高载环境)现在已经被更好的epoll(事件通知)代替了
  --without-poll_module              禁用poll模块

  --with-threads                     enable thread pool support

  --with-file-aio                    enable file AIO support

  --with-http_ssl_module             启用添加HTTPS协议支持到HTTP服务器的模块,该模块默认不启用。构建和运行该模块需要OpenSSL库(Apache对应:mod_ssl)--with-http_v2_module              enable ngx_http_v2_module
  --with-http_realip_module          enable ngx_http_realip_module
  --with-http_addition_module        enable ngx_http_addition_module
  --with-http_xslt_module            enable ngx_http_xslt_module
  --with-http_xslt_module=dynamic    enable dynamic ngx_http_xslt_module
  --with-http_image_filter_module    enable ngx_http_image_filter_module
  --with-http_image_filter_module=dynamic    enable dynamic ngx_http_image_filter_module
  --with-http_geoip_module           enable ngx_http_geoip_module
  --with-http_geoip_module=dynamic   enable dynamic ngx_http_geoip_module
  --with-http_sub_module             enable ngx_http_sub_module
  --with-http_dav_module             enable ngx_http_dav_module
  --with-http_flv_module             enable ngx_http_flv_module
  --with-http_mp4_module             enable ngx_http_mp4_module
  --with-http_gunzip_module          enable ngx_http_gunzip_module
  --with-http_gzip_static_module     enable ngx_http_gzip_static_module
  --with-http_auth_request_module    enable ngx_http_auth_request_module
  --with-http_random_index_module    enable ngx_http_random_index_module
  --with-http_secure_link_module     enable ngx_http_secure_link_module
  --with-http_degradation_module     enable ngx_http_degradation_module
  --with-http_slice_module           enable ngx_http_slice_module
  --with-http_stub_status_module     enable ngx_http_stub_status_module    记录nginx基本访问状态信息等模块

  --without-http_charset_module      disable ngx_http_charset_module
  --without-http_gzip_module         禁用构建gzip压缩模块。构建和运行该模块需要zlib库
  --without-http_ssi_module          disable ngx_http_ssi_module
  --without-http_userid_module       disable ngx_http_userid_module
  --without-http_access_module       禁用 ngx_http_access_module(控制用户对nginx的访问)
  --without-http_auth_basic_module   disable ngx_http_auth_basic_module
  --without-http_mirror_module       disable ngx_http_mirror_module
  --without-http_autoindex_module    disable ngx_http_autoindex_module
  --without-http_geo_module          disable ngx_http_geo_module
  --without-http_map_module          disable ngx_http_map_module
  --without-http_split_clients_module disable ngx_http_split_clients_module
  --without-http_referer_module      disable ngx_http_referer_module
  --without-http_rewrite_module      禁止构建允许HTTP服务器重定向和变更请求URI的模块。构建和运行该模块需要PCRE库
  --without-http_proxy_module        禁用HTTP服务器代理模块
  --without-http_fastcgi_module      禁用 ngx_http_fastcgi_module 
  --without-http_uwsgi_module        disable ngx_http_uwsgi_module
  --without-http_scgi_module         disable ngx_http_scgi_module
  --without-http_grpc_module         disable ngx_http_grpc_module
  --without-http_memcached_module    disable ngx_http_memcached_module
  --without-http_limit_conn_module   禁用 ngx_http_limit_conn_module     限制用户并发连接数
  --without-http_limit_req_module    禁用 ngx_http_limit_req_module      限制用户并发请求数
  --without-http_empty_gif_module    disable ngx_http_empty_gif_module
  --without-http_browser_module      disable ngx_http_browser_module
  --without-http_upstream_hash_module        disable ngx_http_upstream_hash_module   负载均衡相关模块
  --without-http_upstream_ip_hash_module     disable ngx_http_upstream_ip_hash_module
  --without-http_upstream_least_conn_module  disable ngx_http_upstream_least_conn_module
  --without-http_upstream_random_modul       disable ngx_http_upstream_random_module
  --without-http_upstream_keepalive_module   disable ngx_http_upstream_keepalive_module
  --without-http_upstream_zone_module        disable ngx_http_upstream_zone_module

  --with-http_perl_module            启用ngx_http_perl_module  在ngnx启用perl语言
  --with-http_perl_module=dynamic    enable dynamic ngx_http_perl_module
  --with-perl_modules_path=PATH      设置perl模块路径
  --with-perl=PATH                   设置perl库文件路径

  --http-log-path=PATH               设置HTTP服务器的主请求的日志文件的名称--http-client-body-temp-path=PATH  设置客户端请求临时文件路径
  --http-proxy-temp-path=PATH        设置http proxy临时文件路径
  --http-fastcgi-temp-path=PATH      设置http fastcgi临时文件路径
  --http-uwsgi-temp-path=PATH        set path to store http uwsgi temporary files
  --http-scgi-temp-path=PATH         set path to store http scgi temporary files
  --without-http                     不使用HTTP server功能
  --without-http-cache               disable HTTP cache

  --with-mail                        允许POP3/IMAP4/SMTP代理模块--with-mail=dynamic                enable dynamic POP3/IMAP4/SMTP proxy module
  --with-mail_ssl_module             enable ngx_mail_ssl_module
  --without-mail_pop3_module         disable ngx_mail_pop3_module
  --without-mail_imap_module         disable ngx_mail_imap_module
  --without-mail_smtp_module         disable ngx_mail_smtp_module

  --with-stream                      enable TCP/UDP proxy module
  --with-stream=dynamic              enable dynamic TCP/UDP proxy module
  --with-stream_ssl_module           enable ngx_stream_ssl_module
  --with-stream_realip_module        enable ngx_stream_realip_module
  --with-stream_geoip_module         enable ngx_stream_geoip_module
  --with-stream_geoip_module=dynamic enable dynamic ngx_stream_geoip_module
  --with-stream_ssl_preread_module   enable ngx_stream_ssl_preread_module
  --without-stream_limit_conn_module disable ngx_stream_limit_conn_module
  --without-stream_access_module     disable ngx_stream_access_module
  --without-stream_geo_module        disable ngx_stream_geo_module
  --without-stream_map_module        disable ngx_stream_map_module
  --without-stream_split_clients_module          disable ngx_stream_split_clients_module
  --without-stream_return_module                 disable ngx_stream_return_module
  --without-stream_upstream_hash_module          disable ngx_stream_upstream_hash_module
  --without-stream_upstream_least_conn_module    disable ngx_stream_upstream_least_conn_module
  --without-stream_upstream_random_module        disable ngx_stream_upstream_random_module
  --without-stream_upstream_zone_module          disable ngx_stream_upstream_zone_module

  --with-google_perftools_module     允许ngx_google_perftools_module模块(调试用)
  --with-cpp_test_module             enable ngx_cpp_test_module

  --add-module=PATH                  enable external module
  --add-dynamic-module=PATH          enable dynamic external module

  --with-compat                      dynamic modules compatibility

  --with-cc=PATH                     设置C编译器路径
  --with-cpp=PATH                    设置C预处理路径
  --with-cc-opt=OPTIONS              设置C编译器参数
  --with-ld-opt=OPTIONS              设置连接文件参数
  --with-cpu-opt=CPU                 为指定CPU优化,可选参数有:
                                     pentium, pentiumpro, pentium3, pentium4,
                                     athlon, opteron, sparc32, sparc64, ppc64

  --without-pcre                     不使用pcre库文件
  --with-pcre                        设置PCRE库的路径,该库需要从PCRE网站下载。location指令的正则表达支持需要该库
  --with-pcre=DIR                    set path to PCRE library sources
  --with-pcre-opt=OPTIONS            设置PCRE运行参数--with-pcre-jit                    build PCRE with JIT compilation support

  --with-zlib=DIR                    设置zlib库的路径,ngx_http_gzip_module模块需要该库
  --with-zlib-opt=OPTIONS            设置zlib运行参数--with-zlib-asm=CPU                使zlib对特定的CPU进行优化,可选参数:
                                     pentium, pentiumpro

  --with-libatomic                   force libatomic_ops library usage
  --with-libatomic=DIR               set path to libatomic_ops library sources

  --with-openssl=DIR                 设定OpenSSL库文件路径
  --with-openssl-opt=OPTIONS         设置OpenSSL运行参数--with-debug                       允许调试日志

 

安装MSQL(先装mysql的原因是安装过成中生成了mysql.so在安装php时直接指定mysq这个扩展,先装php后装mysql的请戳这里mysql.so的安装

mysql安装

关掉防火墙:chkconfig iptables off

检测mysql是否默认安装了
rpm -qa | grep mysql
卸载
rpm -e mysql
yum源安装 :

https://dev.mysql.com/downloads/repo/yum/下载yum源文件
#下载后的文件名为:
mysql80-community-release-el7-1.noarch.rpm 
#执行如下命令:
rpm -ivh mysql80-community-release-el7-1.noarch.rpm 
#查看
yum repolist|grep mysql
#安装:
yum install mysql-community-server

上面默认安装的是最新的版本(8.0)
修改默认安装的版本:http://repo.mysql.com/yum里有5.5~8.0的所有源
修改下面文件的内容
vim /etc/yum.repos.d/mysql-community.repo

将[mysql80-community]下修改enabled=0
然后将你要默然安装的改为enabled=1
就ok

文件内容如下:
# Enable to use MySQL 5.5
[mysql55-community]
name=MySQL 5.5 Community Server
baseurl=http://repo.mysql.com/yum/mysql-5.5-community/el/7/$basearch/
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql

# Enable to use MySQL 5.6
[mysql56-community]
name=MySQL 5.6 Community Server
baseurl=http://repo.mysql.com/yum/mysql-5.6-community/el/7/$basearch/
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql

# Enable to use MySQL 5.7
[mysql57-community]
name=MySQL 5.7 Community Server
baseurl=http://repo.mysql.com/yum/mysql-5.7-community/el/7/$basearch/
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql

[mysql80-community]
name=MySQL 8.0 Community Server
baseurl=http://repo.mysql.com/yum/mysql-8.0-community/el/7/$basearch/
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql

[mysql-connectors-community]
name=MySQL Connectors Community
baseurl=http://repo.mysql.com/yum/mysql-connectors-community/el/7/$basearch/
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql

[mysql-tools-community]
name=MySQL Tools Community
baseurl=http://repo.mysql.com/yum/mysql-tools-community/el/7/$basearch/
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql

[mysql-tools-preview]
name=MySQL Tools Preview
baseurl=http://repo.mysql.com/yum/mysql-tools-preview/el/7/$basearch/
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql

[mysql-cluster-7.5-community]
name=MySQL Cluster 7.5 Community
baseurl=http://repo.mysql.com/yum/mysql-cluster-7.5-community/el/7/$basearch/
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql

[mysql-cluster-7.6-community]
name=MySQL Cluster 7.6 Community
baseurl=http://repo.mysql.com/yum/mysql-cluster-7.6-community/el/7/$basearch/
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql

[myql-scluster-8.0-community]
name=MySQL Cluster 8.0 Community
baseurl=http://repo.mysql.com/yum/mysql-cluster-8.0-community/el/7/$basearch/
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql
View Code

启动:
service mysqld start
systemctl start mysqld.service
查看状态
service mysqld status
systemctl status mysqld.service

 

源码安装MYSQL

MySQL依赖于libaio 库,   MySQL 5.7.19及更高版本依赖于 libnuma

shell> yum search libaio  # search for info
shell> yum install libaio # install library

 安装autoconf   否则会报原因:缺少perl模块中的Data::Dumper的错而autoconf  含有此模块

yum -y install autoconf

检查linux的版本:/etc/redhat-release  或者uname -r

检查linux时32还是64位操作系统:getconf LONG_BIT或者uname -m

官网选择下载版本

wget https://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.45-linux-glibc2.12-x86_64.tar.gz

wget https://downloads.mysql.com/archives/get/file/mysql-5.7.26-linux-glibc2.12-x86_64.tar.gz

前面的速度太慢了这个开发版的下载快点

wget http://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.45-linux-glibc2.12-x86_64.tar.gz

解压到/usr/local目录后

tar xvf mysql-5.6.45-linux-glibc2.12-x86_64.tar.gz -C /usr/local/

改名 

mv mysql-5.6.45-linux-glibc2.12-x86_64 ./mysql  
#也可以像官方教程那样创建一个连接连接到解压后的目录:ln -s mysql-5.6.45-linux-glibc2.12-x86_64 mysql

cd mysql   (目录结构)

目录5.6目录的内容
bin, scripts mysqld服务器,客户端和实用程序
data 日志文件,数据库
docs 信息格式的MySQL手册
include 包含(标题)文件
lib 核心文件
mysql-test 测试套件
man Unix手册页
share 用于数据库安装的错误消息,字典和SQL
sql-bench 基准
support-files 其他支持文件,包括示例配置文件

 

 

选择mysql配置文件参数详细说明

cp support-files/my-medium.cnf /etc/my.cnf
或:
cp support-files/my-default.cnf /etc/my.cnf
如果安装版本中是是my-default.cnf则配置以下参数

# For advice on how to change settings please see
# http://dev.mysql.com/doc/refman/5.6/en/server-configuration-defaults.html
# *** DO NOT EDIT THIS FILE. It's a template which will be copied to the
# *** default location during install, and will be replaced if you
# *** upgrade to a newer version of MySQL.

[mysqld]

# Remove leading # and set to the amount of RAM for the most important data
# cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%.
# innodb_buffer_pool_size = 128M

# Remove leading # to turn on a very important data integrity option: logging
# changes to the binary log between backups.
# log_bin

# These are commonly set, remove the # and set as required.
basedir = /usr/local/mysql
datadir = /usr/local/mysql/data
port = 3306
# server_id = .....
socket = /tmp/mysql.sock       #这个重启mysql时会自动生成,如果还是不行可以尝试注释这行复制到下一行重启试试
character-set-server = utf8
skip-name-resolve
log-error = /usr/local/mysql/data/error.log
pid-file = /usr/local/mysql/data/mysql.pid

explicit_defaults_for_timestamp=true

tmpdir = /tmp

 

# Remove leading # to set options mainly useful for reporting servers.

# The server defaults are faster for transactions and fast SELECTs.
# Adjust sizes as needed, experiment to find the optimal values.
# join_buffer_size = 128M
# sort_buffer_size = 2M
# read_rnd_buffer_size = 2M

sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES

 

 

mysql安装成功后更加早期的版本有几个默认的配置模板,列表如下:
my-huge.cnf : 用于高端产品服务器,包括1到2GB RAM,主要运行mysql
my-innodb-heavy-4G.ini : 用于只有innodb的安装,最多有4GB RAM,支持大的查询和低流量
my-large.cnf : 用于中等规模的产品服务器,包括大约512M RAM
my-medium.cnf : 用于低端产品服务器,包括很少内存(少于128M)
my-small.cnf : 用于最低设备的服务器,只有一点内存(少于512M)

注意:

linux安装后的mysql默认配置文件是在/etc/my.cnf

想要修改默认位置只需要修改/mysql/support-files/mysql.server里214行的conf=新位置就可以了

创建mysql用户组及用户

groupadd mysql
useradd -r -g mysql mysql

#也可以一步到位:
useradd -M -s /sbin/nologin

 

执行初始化数据库:

rm -f /etc/my.cnf # 删除系统自带的mysql配置文件
scripts/mysql_install_db --user=mysql    #需要安装autof
##全一点的##scripts/mysql_install_db --user=mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data --defaults-file=/etc/my.cnf --pid-file=/usr/local/mysql/mysql.pid --tmpdir=/tmp --random-passwords
#安全启动mysql,参数连接可选:
bin/mysqld_safe --user=mysql
--defaults-file=/etc/my.cnf --socket=/tmp/mysql.sock&
#启动脚本:
cp support-files/mysql.server /etc/init.d/mysql #我的测试是这个生效cp support-files/mysql.server /etc/init.d/mysql.server报找不到的错
#可选(不知道这个是干什么的)
#cp /usr/local/mysql/support-files/mysql.server /etc/rc.d/init.d/mysql

 

/usr/local/mysql/bin 执行文件目录添加到PATH变量中  这样可以直接访问

#不加这行执行musql -uroot -p 要尽到mysql的bin目录下哦
export PATH=$PATH:/usr/local/mysql/bin

 配置root的密码:

mysqladmin -u root password 'root'  // 通过该命令给root账号设置密码为 root

添加远程访问能力

GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'duan' with grant option;
Flush privileges;

over!!!

 

rpm包安装MYSQL:

下载:安装的rpm是小红帽公司发行的安装包所以选择如下图

https://dev.mysql.com/get/Downloads/MySQL-5.6/MySQL-5.6.45-1.el7.x86_64.rpm-bundle.tar

要查看RPM包中的所有文件

rpm -qpl mysql-community-server-version-distribution-arch.rpm

 

查看rpm安装的mysql(linux系统可能默认安装过)

rpm -qa | grep mysql

删除rpm安装的mysql(还要删除项my.cnf等残留文件)

rpm -e mysql  // 普通删除模式
rpm -e --nodeps mysql  // 强力删除模式,如果使用上面命令删除时,提示有依赖的其它文件,则用该命令可以对其进行强力删除

检测依赖包:

rpm -qa libnuma libaio autoconf

安装依赖包

yum install libaio libnuma* autoconf cmake -y 

 解压: 

5.7包名字摘要
mysql-community-server 数据库服务器和相关工具
mysql-community-client MySQL客户端应用程序和工具
mysql-community-common 服务器和客户端库的公共文件
mysql-community-devel 用于MySQL数据库客户端应用程序的开发头文件和库
mysql-community-libs MySQL数据库客户端应用程序的共享库
mysql-community-libs-compat 以前的MySQL安装的共享兼容库
mysql-community-embedded MySQL嵌入式库
mysql-community-embedded-devel MySQL的开发头文件和库作为可嵌入库
mysql-community-test MySQL服务器的测试套件
5.6包名字摘要
MySQL-server 数据库服务器和相关工具
MySQL-client MySQL客户端应用程序和工具
MySQL-devel 用于MySQL数据库客户端应用程序的开发头文件和库
MySQL-shared MySQL数据库客户端应用程序的共享库
MySQL-shared-compat 以前的MySQL安装的共享兼容库
MySQL-embedded MySQL嵌入式库
MySQL-test MySQL服务器的测试套件

创建mysql用户及组

useradd -M -s /sbin/nologin mysql

 

安装

   #5.7版本安装
rpm -ivh mysql-community-common-5.7.22-1.el7.x86_64.rpm     rpm -ivh mysql-community-libs-5.7.22-1.el7.x86_64.rpm     rpm -ivh mysql-community-client-5.7.22-1.el7.x86_64.rpm 
rpm -ivh mysql-community-server-5.7.22-1.el7.x86_64.rpm 
  #5.6版本安装    rpm -ivh MySQL-server-5.6.26-1.linux_glibc2.5.x86_64.rpm
 --force --nodeps
rpm -ivh MySQL-client-5.6.45-1.el7.x86_64.rpm

如果采用RPM包安装,安装路径应在/usr/share/mysql目录下
mysqldump(备份)文件位置:/usr/bin/mysqldump
mysqli配置文件:
/etc/my.cnf或/usr/share/mysql/my.cnf  或者/usr/my.cnf

mysql数据目录在/var/lib/mysql目录下

 

提示一:安装好mysql-server之后会随机生成一个root账户的密码,保存在: /root/.mysql_secret   这里

提示二:安装好mysql-server之后第一次连接mysql的时候需要去修改一下这个默认的密码

修改密码  

     mysql>set PASSWORD=PASSWORD('root');

增加远程登陆权限

mysql>GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'root' WITH GRANTOPTION;

mysql>FLUSH PRIVILEGES;

mysql配置

#配置文件几乎是空的 
#除了mysql的my.conf和安装文件在这不能修改 其他的文件位置都能修改如:
socket = /var/lib/mysql/mysql.sock
#加上这个是因为在安装的mysql的时候抛出警告
explicit_defaults_for_timestamp=true

 

在centos7中,没有了service命令,都是使用systemctl命令。注意启动的时候是start mysqld而不是mysql。

而在centos6中,使用service mysqld start
systemctl start mysqld
查看状态
systemctl status mysqld

7以前:
启动
service mysqld start
重启
service mysqld restart

-------------------------------------------------mysql安装完结撒花-----------------------------------------------

mysql全局可用
vi /root/.bash_prefile 
path后增加 /usr/local/mysql 
PATH=$PATH:$HOME/bin:/usr/local/mysql/bin:/usr/local/mysql/lib

重启
source /root/.bash_prefile

修改mysql密码
mysql -u root mysql
use mysql;
desc user;
#增加root远程能力
GRANT ALL PRIVILEGES ON *.* TO root@"%" IDENTIFIED BY "root";
#修改密码为123456
update user set Password = password('12346') where User='root';
select Host,User,Password from user where User='root';
flush privileges;
exit;


 

 

 

php安装

php 安装

下载:wget https://www.php.net/distributions/php-7.3.7.tar.gz
安装依赖包

yum -y install libxml2-devel openssl openssl-devel bzip2 bzip2-devel curl-devel readline-devel libxml28 

可选

yum -y install  libzip libzip-devel    #ZipArchive压缩类扩展库且php7.3 版本大于0.11

下载解压 新建www用户和组

useradd -M -s /sbin/nologin www

需要特别注意的配置:

./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/php/etc --with-mysqli=mysqlnd  --with-pdo-mysql=mysqlnd --enable-opcache --enable-fpm --with-fpm-user=www --with-fpm-group=www --enable-mbstring --with-iconv --with-openssl --with-curl --with-zlib --with-bz2 --with-libxml-dir

注意: WARNING: unrecognized options: --with-mysql, --enable-fastcgi, --with-mcrypt

--with-mysql=/usr/share/mysql 在7以后不支持了 

--enable-fastcgi在5.3以后默认开启没有这个配置参数了 

--with-mcrypt  7.2废除此扩展 由openssl全面代替

 

 

 

 


启用:PHP FastCGI 进程管理器
--enable-fastcgi --enable-fpm --with-fpm-user=www --with-fpm-group=www

--with-fpm-user - 设置 FPM 运行的用户身份(默认 - nobody)
--with-fpm-group - 设置 FPM 运行时的用户组(默认 - nobody)
--with-fpm-systemd - 启用 systemd 集成 (默认 - no)
--with-fpm-acl - 使用POSIX 访问控制列表 (默认 - no) 5.6.5版本起有效
--enable-maintainer-zts 开启 maintainer zts,以后安装多线程的话,这个必须开启
--with-openssl开启 openssl

--with-libxml-dir 开启 libxml
--with-zlib 开启 zlib
--enable-mbstring开启 mbstring
--with-mysqli=mysqlnd 开启 mysqli
--with-pdo-mysql 开启 pdo mysql
--with-gd 开启gd库
--enable-sockets 开启 sockets
--with-curl 开启 curl

--enable-zip 开启压缩扩展


编译安装

make && make install

查看php加载的配置文件位置:

php --ini
多版本用下面的
php -r "phpinfo();" | grep 'php.ini'

复制php.ini

 cp /customdata/php-7.3.7/php.ini-production /usr/local/php/etc/php.ini

#修改php.ini如下配置
vim /usr/local/php/etc/php.ini
cgi.fix_pathinfo=0

修改运行php-fpm用户和组

useradd -M -s /sbin/nologin www-data

修改php-fpm.conf添加以上创建的用户和组

复制默认的
cp /usr/local/php/etc/php-fpm.conf.default /usr/local/php/etc/php-fpm.conf
cp
/usr/local/php/etc/php-fpm.d/www.conf.default /usr/local/php/etc/php-fpm.d/www.conf
然后修改www.conf 不过直接建议复制www.conf 为php-fpm.conf cp
/usr/local/php/etc/php-fpm.d/www.conf.default /usr/local/php/etc/php-fpm.conf 然后去掉最后一行的include=/usr/local/php/etc/php-fpm.d/*.conf

 

修改nginx .conf:

修改默认的 location 块,使其支持 .php 文件:

location / {
    root   html;
    index index.php index.html index.htm;
}

下一步配置来保证对于 .php 文件的请求将被传送到后端的 PHP-FPM 模块, 取消默认的 PHP 配置块的注释,并修改为下面的内容:

location ~* \.php$ {
    fastcgi_index   index.php;
    fastcgi_pass    127.0.0.1:9000;
    include         fastcgi_params;
    fastcgi_param   SCRIPT_FILENAME    $document_root$fastcgi_script_name;
    fastcgi_param   SCRIPT_NAME        $fastcgi_script_name;
}

 

添加 PHP 命令到环境变量
vim /etc/profile

在末尾加入
PATH=$PATH:/usr/local/php/bin
export PATH

注意:

要使改动立即生效执行
. /etc/profile 或source /etc/profile

延伸:etc/profile /etc/bashrc ~/.bash_profile ~/.bashrc等配置文件区别

 

配置php-fpm
cd /usr/local/php/etc

cp php-fpm.conf.default php-fpm.conf

 

6、启动php-fpm
sudo /usr/local/php/sbin/php-fpm -c/etc/php.ini -y /usr/local/php/etc/php-fpm.conf

查看是否启动

ps aux|grep php

netstat -ant|grep 9000

如果php-fpm没有启动也会报39255#0: *1 connect() failed (111: Connection refused) while connecting to ...这个错的 

关于thinkphp入口文件报500错误的就解决办法

vi /usr/local/nginx/conf/fastcgi.conf

注释掉下面这句代码
#fastcgi_param PHP_ADMIN_VALUE "open_basedir=$document_root/:/tmp/:/proc/";

tp的 request()->file("file");返回null   :

在php.ini文件里面的open_basedir填上存放临时文件的目录

 

 

 

 

Configuration:
  -h, --help              显示此帮助并退出
      --help=short        display options specific to this package
      --help=recursive    display the short help of all the included packages
  -V, --version           display version information and exit
  -q, --quiet, --silent   do not print `checking ...' messages
      --cache-file=FILE   cache test results in FILE [disabled]
  -C, --config-cache      alias for `--cache-file=config.cache'
  -n, --no-create         do not create output files
      --srcdir=DIR        find the sources in DIR [configure dir or `..']

Installation directories:
  --prefix=PREFIX         设置php安装的位置默认:
                          [/usr/local]
  --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
                          [PREFIX]

By default, `make install' will install all the files in
`/usr/local/bin', `/usr/local/lib' etc.  You can specify
an installation prefix other than `/usr/local' using `--prefix',
for instance `--prefix=$HOME'.

For better control, use the options below.

Fine tuning of the installation directories:
  --bindir=DIR            配置用户可执行文件 [EPREFIX/bin]
  --sbindir=DIR           配置系统管理可执行文件 [EPREFIX/sbin]
  --libexecdir=DIR        配置程序可执行文件 [EPREFIX/libexec]
  --sysconfdir=DIR        只读单的机数据 [PREFIX/etc]
  --sharedstatedir=DIR    modifiable architecture-independent data [PREFIX/com]
  --localstatedir=DIR     modifiable single-machine data [PREFIX/var]
  --runstatedir=DIR       modifiable per-process data [LOCALSTATEDIR/run]
  --libdir=DIR            object code libraries [EPREFIX/lib]
  --includedir=DIR        C header files [PREFIX/include]
  --oldincludedir=DIR     C header files for non-gcc [/usr/include]
  --datarootdir=DIR       read-only arch.-independent data root [PREFIX/share]
  --datadir=DIR           read-only architecture-independent data [DATAROOTDIR]
  --infodir=DIR           info documentation [DATAROOTDIR/info]
  --localedir=DIR         locale-dependent data [DATAROOTDIR/locale]
  --mandir=DIR            man documentation [DATAROOTDIR/man]
  --docdir=DIR            documentation root [DATAROOTDIR/doc/PACKAGE]
  --htmldir=DIR           html documentation [DOCDIR]
  --dvidir=DIR            dvi documentation [DOCDIR]
  --pdfdir=DIR            pdf documentation [DOCDIR]
  --psdir=DIR             ps documentation [DOCDIR]

System types:
  --build=BUILD     configure for building on BUILD [guessed]
  --host=HOST       cross-compile to build programs to run on HOST [BUILD]
  --target=TARGET   configure for building compilers for TARGET [HOST]

Optional Features and Packages:
  --disable-option-checking  ignore unrecognized --enable/--with options
  --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
  --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
  --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
  --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
  --with-libdir=NAME      Look for libraries in .../NAME rather than .../lib
  --disable-rpath         关闭额外的运行库文件 
  --enable-re2c-cgoto     Enable -g flag to re2c to use computed goto gcc extension
  --disable-gcc-global-regs
                          whether to enable GCC global register variables

SAPI modules:

  --with-apxs2=FILE       整合apache。Build shared Apache 2.0 Handler module. FILE is the optional
                          pathname to the Apache apxs tool apxs
  --disable-cli           Disable building CLI version of PHP
                          (this forces --without-pear)
  --enable-embed=TYPE     EXPERIMENTAL: Enable building of embedded SAPI library
                          TYPE is either 'shared' or 'static'. TYPE=shared
  --enable-fpm            Enable building of the fpm SAPI executable
  --with-fpm-user=USER    Set the user for php-fpm to run as. (default: nobody)
  --with-fpm-group=GRP    Set the group for php-fpm to run as. For a system user, this
                          should usually be set to match the fpm username (default: nobody)
  --with-fpm-systemd      Activate systemd integration
  --with-fpm-acl          Use POSIX Access Control Lists
  --with-litespeed        Build PHP as litespeed module
  --enable-phpdbg         Build phpdbg
  --enable-phpdbg-webhelper
                          Build phpdbg web SAPI support
  --enable-phpdbg-debug   Build phpdbg in debug mode
  --enable-phpdbg-readline   Enable readline support in phpdbg (depends on static ext/readline)
  --disable-cgi           Disable building CGI version of PHP
  --with-valgrind=DIR     Enable valgrind support

General settings:

  --enable-gcov           Enable GCOV code coverage (requires LTP) - FOR DEVELOPERS ONLY!!
  --enable-debug          Compile with debugging symbols
  --with-layout=TYPE      Set how installed files will be laid out.  Type can
                          be either PHP or GNU [PHP]
  --with-config-file-path=PATH          指定php.ini位置
  --with-config-file-scan-dir=PATH      指定额外拓展配置归放处文件夹
  --enable-sigchild       Enable PHP's own SIGCHLD handler
  --enable-libgcc         Enable explicitly linking against libgcc
  --disable-short-tags    Disable the short-form <? start tag by default
  --enable-dmalloc        Enable dmalloc
  --disable-ipv6          Disable IPv6 support
  --enable-dtrace         Enable DTrace support
  --enable-fd-setsize     Set size of descriptor sets

Extensions:

  --with-EXTENSION=shared[,PATH]

    NOTE: Not all extensions can be build as 'shared'.

    Example: --with-foobar=shared,/usr/local/foobar/

      o Builds the foobar extension as shared extension.
      o foobar package install prefix is /usr/local/foobar/


  --disable-all           Disable all extensions which are enabled by default

  --disable-libxml        Disable LIBXML support
  --with-libxml-dir=DIR   LIBXML: libxml2 install prefix
  --with-openssl=DIR      Include OpenSSL support (requires OpenSSL >= 1.0.1)
  --with-kerberos=DIR     OPENSSL: Include Kerberos support
  --with-system-ciphers   OPENSSL: Use system default cipher list instead of hardcoded value
  --with-pcre-regex=DIR   Include Perl Compatible Regular Expressions support.
                          DIR is the PCRE install prefix BUNDLED
  --with-pcre-jit         Enable PCRE JIT functionality (BUNDLED only)
  --with-pcre-valgrind=DIR
                          Enable PCRE valgrind support. Developers only!
  --without-sqlite3=DIR   Do not include SQLite3 support. DIR is the prefix to
                          SQLite3 installation directory.
  --with-zlib=DIR         Include ZLIB support (requires zlib >= 1.2.0.4)
  --with-zlib-dir=<DIR>   Define the location of zlib install directory
  --enable-bcmath         Enable bc style precision math functions
  --with-bz2=DIR          打开对bz2文件的支持--enable-calendar       Enable support for calendar conversion
  --disable-ctype         Disable ctype functions
  --with-curl=DIR         Include cURL support
  --enable-dba            Build DBA with bundled modules. To build shared DBA
                          extension use --enable-dba=shared
  --with-qdbm=DIR         DBA: QDBM support
  --with-gdbm=DIR         DBA: GDBM support
  --with-ndbm=DIR         DBA: NDBM support
  --with-db4=DIR          DBA: Oracle Berkeley DB 4.x or 5.x support
  --with-db3=DIR          DBA: Oracle Berkeley DB 3.x support
  --with-db2=DIR          DBA: Oracle Berkeley DB 2.x support
  --with-db1=DIR          DBA: Oracle Berkeley DB 1.x support/emulation
  --with-dbm=DIR          DBA: DBM support
  --with-tcadb=DIR        DBA: Tokyo Cabinet abstract DB support
  --with-lmdb=DIR         DBA: Lightning memory-mapped database support
  --without-cdb=DIR       DBA: CDB support (bundled)
  --disable-inifile       DBA: INI support (bundled)
  --disable-flatfile      DBA: FlatFile support (bundled)
  --disable-dom           Disable DOM support
  --with-libxml-dir=DIR   DOM: libxml2 install prefix
  --with-enchant=DIR      Include enchant support.
                          GNU Aspell version 1.1.3 or higher required.
  --enable-exif           Enable EXIF (metadata from images) support
  --disable-fileinfo      Disable fileinfo support
  --disable-filter        Disable input filter support
  --with-pcre-dir         FILTER: pcre install prefix
  --enable-ftp            打开ftp的支持 
  --with-openssl-dir=DIR  FTP: openssl install prefix
  --with-gd=DIR           打开gd库的支持--with-webp-dir=DIR     GD: Set the path to libwebp install prefix
  --with-jpeg-dir=DIR     GD: 打开对jpeg图片的支持 
  --with-png-dir=DIR      GD: 打开对png图片的支持 
  --with-zlib-dir=DIR     GD: Set the path to libz install prefix
  --with-xpm-dir=DIR      GD: Set the path to libXpm install prefix
  --with-freetype-dir=DIR GD: 打开对freetype字体库的支持--enable-gd-jis-conv    GD: Enable JIS-mapped Japanese font support
  --with-gettext=DIR      Include GNU gettext support
  --with-gmp=DIR          Include GNU MP support
  --with-mhash=DIR        Include mhash support
  --disable-hash          Disable hash support
  --without-iconv=DIR     关闭iconv函数,各种字符集间的转换--with-imap=DIR         Include IMAP support. DIR is the c-client install prefix
  --with-kerberos=DIR     IMAP: Include Kerberos support. DIR is the Kerberos install prefix
  --with-imap-ssl=DIR     IMAP: Include SSL support. DIR is the OpenSSL install prefix
  --with-interbase=DIR    Include Firebird support.  DIR is the Firebird base
                          install directory /opt/firebird
  --enable-intl           Enable internationalization support
  --with-icu-dir=DIR      Specify where ICU libraries and headers can be found
  --disable-json          Disable JavaScript Object Serialization support
  --with-ldap=DIR         Include LDAP support
  --with-ldap-sasl=DIR    LDAP: Include Cyrus SASL support
  --enable-mbstring       Enable multibyte string support
  --disable-mbregex       MBSTRING: Disable multibyte regex support
  --disable-mbregex-backtrack
                          MBSTRING: Disable multibyte regex backtrack check
  --with-onig=DIR         MBSTRING: Use external oniguruma. DIR is the oniguruma install prefix.
                          If DIR is not set, the bundled oniguruma will be used
--with-mysql=File 需要指定mysql的安装路径如果没有安装mysql则指向mysqlnd(注意7以后不支持mysql扩展有pdo代替了没这个配置参数了)
--with-mysqli=FILE /apache/mysql/bin/mysql_config Include MySQLi support. FILE is the path to mysql_config. If no value or mysqlnd is passed as FILE, the MySQL native driver will be used --enable-embedded-mysqli MYSQLi: Enable embedded support Note: Does not work with MySQL native driver! --with-mysql-sock=SOCKPATH MySQLi/PDO_MYSQL: Location of the MySQL unix socket pointer. If unspecified, the default locations are searched --with-oci8=DIR Include Oracle Database OCI8 support. DIR defaults to $ORACLE_HOME. Use --with-oci8=instantclient,/path/to/instant/client/lib to use an Oracle Instant Client installation --with-odbcver=HEX Force support for the passed ODBC version. A hex number is expected, default 0x0350. Use the special value of 0 to prevent an explicit ODBCVER to be defined. --with-adabas=DIR Include Adabas D support /usr/local --with-sapdb=DIR Include SAP DB support /usr/local --with-solid=DIR Include Solid support /usr/local/solid --with-ibm-db2=DIR Include IBM DB2 support /home/db2inst1/sqllib --with-empress=DIR Include Empress support \$EMPRESSPATH (Empress Version >= 8.60 required) --with-empress-bcs=DIR Include Empress Local Access support \$EMPRESSPATH (Empress Version >= 8.60 required) --with-custom-odbc=DIR Include user defined ODBC support. DIR is ODBC install base directory /usr/local. Make sure to define CUSTOM_ODBC_LIBS and have some odbc.h in your include dirs. f.e. you should define following for Sybase SQL Anywhere 5.5.00 on QNX, prior to running this configure script: CPPFLAGS=\"-DODBC_QNX -DSQLANY_BUG\" LDFLAGS=-lunix CUSTOM_ODBC_LIBS=\"-ldblib -lodbc\" --with-iodbc=DIR Include iODBC support /usr/local --with-esoob=DIR Include Easysoft OOB support /usr/local/easysoft/oob/client --with-unixODBC=DIR Include unixODBC support /usr/local --with-dbmaker=DIR Include DBMaker support --disable-opcache Disable Zend OPcache support --disable-opcache-file Disable file based caching --disable-huge-code-pages Disable copying PHP CODE pages into HUGE PAGES --enable-pcntl Enable pcntl support (CLI/CGI only) --disable-pdo Disable PHP Data Objects support --with-pdo-dblib=DIR PDO: DBLIB-DB support. DIR is the FreeTDS home directory --with-pdo-firebird=DIR PDO: Firebird support. DIR is the Firebird base install directory /opt/firebird --with-pdo-mysql=DIR PDO: MySQL support. DIR is the MySQL base directory If no value or mysqlnd is passed as DIR, the MySQL native driver will be used --with-zlib-dir=DIR PDO_MySQL: Set the path to libz install prefix --with-pdo-oci=DIR 开启PDO对Oracle的支持. DIR defaults to $ORACLE_HOME. Use --with-pdo-oci=instantclient,/path/to/instant/client/lib for an Oracle Instant Client installation. --with-pdo-odbc=flavour,dir PDO: Support for 'flavour' ODBC driver. include and lib dirs are looked for under 'dir'. 'flavour' can be one of: ibm-db2, iODBC, unixODBC, generic If ',dir' part is omitted, default for the flavour you have selected will be used. e.g.: --with-pdo-odbc=unixODBC will check for unixODBC under /usr/local. You may attempt to use an otherwise unsupported driver using the 'generic' flavour. The syntax for generic ODBC support is: --with-pdo-odbc=generic,dir,libname,ldflags,cflags When built as 'shared' the extension filename is always pdo_odbc.so --with-pdo-pgsql=DIR PDO: PostgreSQL support. DIR is the PostgreSQL base install directory or the path to pg_config --without-pdo-sqlite=DIR PDO: sqlite 3 support. DIR is the sqlite base install directory BUNDLED --with-pgsql=DIR Include PostgreSQL support. DIR is the PostgreSQL base install directory or the path to pg_config --disable-phar Disable phar support --disable-posix Disable POSIX-like functions --with-pspell=DIR Include PSPELL support. GNU Aspell version 0.50.0 or higher required --with-libedit=DIR Include libedit readline replacement (CLI/CGI only) --with-readline=DIR Include readline support (CLI/CGI only) --with-recode=DIR Include recode support --disable-session Disable session support --with-mm=DIR SESSION: Include mm support for session storage --enable-shmop Enable shmop support --disable-simplexml Disable SimpleXML support --with-libxml-dir=DIR SimpleXML: 打开libxml2库的支持  --with-snmp=DIR Include SNMP support --with-openssl-dir=DIR SNMP: openssl install prefix --enable-soap Enable SOAP support --with-libxml-dir=DIR SOAP: libxml2 install prefix --enable-sockets Enable sockets support --with-sodium=DIR Include sodium support --with-password-argon2=DIR Include Argon2 support in password_*. DIR is the Argon2 shared library path --enable-sysvmsg Enable sysvmsg support --enable-sysvsem Enable System V semaphore support --enable-sysvshm Enable the System V shared memory support --with-tidy=DIR Include TIDY support --disable-tokenizer Disable tokenizer support --enable-wddx Enable WDDX support --with-libxml-dir=DIR WDDX: libxml2 install prefix --with-libexpat-dir=DIR WDDX: libexpat dir for XMLRPC-EPI (deprecated) --disable-xml Disable XML support --with-libxml-dir=DIR XML: libxml2 install prefix --with-libexpat-dir=DIR XML: libexpat install prefix (deprecated) --disable-xmlreader Disable XMLReader support --with-libxml-dir=DIR XMLReader: libxml2 install prefix --with-xmlrpc=DIR Include XMLRPC-EPI support --with-libxml-dir=DIR XMLRPC-EPI: libxml2 install prefix --with-libexpat-dir=DIR XMLRPC-EPI: libexpat dir for XMLRPC-EPI (deprecated) --with-iconv-dir=DIR libiconv,各种字符集间的转换 --disable-xmlwriter Disable XMLWriter support --with-libxml-dir=DIR XMLWriter: libxml2 install prefix --with-xsl=DIR Include XSL support. DIR is the libxslt base install directory (libxslt >= 1.1.0 required) --enable-zend-test Enable zend-test extension --enable-zip 打开对zip的支持  --with-zlib-dir=DIR ZIP: 指定安装zlib目录 --with-pcre-dir ZIP: pcre install prefix --with-libzip=DIR ZIP: use libzip --enable-mysqlnd Enable mysqlnd explicitly, will be done implicitly when required by other extensions --disable-mysqlnd-compression-support Disable support for the MySQL compressed protocol in mysqlnd --with-zlib-dir=DIR mysqlnd: Set the path to libz install prefix PEAR: --with-pear=DIR Install PEAR in DIR [PREFIX/lib/php] --without-pear Do not install PEAR Zend: --enable-maintainer-zts Enable thread safety - for code maintainers only!! --disable-inline-optimization If building zend_execute.lo fails, try this switch --disable-zend-signals whether to enable zend signal handling TSRM: --with-tsrm-pth=pth-config Use GNU Pth --with-tsrm-st Use SGI's State Threads --with-tsrm-pthreads Use POSIX threads (default) Libtool: --enable-shared=PKGS Build shared libraries default=yes --enable-static=PKGS Build static libraries default=yes --enable-fast-install=PKGS Optimize for fast installation default=yes --with-gnu-ld Assume the C compiler uses GNU ld default=no --disable-libtool-lock Avoid locking (might break parallel builds) --with-pic Try to use only PIC/non-PIC objects default=use both --with-tags=TAGS Include additional configurations automatic Some influential environment variables: CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a nonstandard directory <lib dir> LIBS libraries to pass to the linker, e.g. -l<library> CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if you have headers in a nonstandard directory <include dir> CPP C preprocessor YACC The `Yet Another Compiler Compiler' implementation to use. Defaults to the first program found out of: `bison -y', `byacc', `yacc'. YFLAGS The list of arguments that will be passed by default to $YACC. This script will default YFLAGS to the empty string to avoid a default value of `-d' given by some make applications. CXX C++ compiler command CXXFLAGS C++ compiler flags CXXCPP C++ preprocessor

 


posted @ 2019-07-24 01:54  虚无缥缈的云  阅读(612)  评论(0编辑  收藏  举报