可選:查找已安裝的安裝包
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文件php
apache:
若是採用RPM包安裝,安裝路徑應在 /etc/httpd目錄下
apache配置文件:/etc/httpd/conf/httpd.conf
Apache模塊路徑:/usr/sbin/apachectl
web目錄:/var/www/html
若是採用源代碼安裝,通常默認安裝在/usr/local/apache2目錄下 html
PHP:
若是採用RPM包安裝,安裝路徑應在 /etc/目錄下
php的配置文件:/etc/php.ini
若是採用源代碼安裝,通常默認安裝在/usr/local/lib目錄下
php配置文件: /usr/local/lib/php.ini
或/usr/local/php/etc/php.ini node
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目錄下mysql
一、安裝工具(非必須(gcc除外)自行刪減)linux
這裏用yum安裝一下在編譯過程當中所須要的編譯工具和小程序,如:gcc、gd庫、cmake等等。這麼多小軟件,咱們不須要編譯安裝,由於這些軟件安裝後,之後並不會修改操做,只是一個工具而已。nginx
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安裝c++
nginx安裝:
http://nginx.org/en/download.html 尋找nginx的版本web
下載到任一目錄
安裝依賴包:(必須:openssl、pcre、zlib ,gcc是全部安裝包都依賴的)sql
檢查openssl是否安裝:rpm -qa openssl openssl-develthinkphp
檢查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
啓動:
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 |
其餘支持文件,包括示例配置文件 |
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
而在centos6中,使用service mysqld startsystemctl 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
六、啓動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