PHP5.3.8+Mysql5.5.18+Nginx1.1.8安裝使用感受

科技探索者發表於2017-11-26

整個安裝過程參照張宴老師的文件,只不過把軟體升級了,張宴老師啥時候才更新一個第七版出來看看呢。。哈哈。。

1、Mysql,5.5的mysql沒有了configure檔案,而採用cmake來編譯,所以在安裝mysql之前需要安裝cmake,我編譯mysql的時候採用了以下配置:

cmake -DCMAKE_INSTALL_PREFIX=/usr/local/mysql

 -DMYSQL_DATADIR=/usr/local/mysql/data

 -DWITH_MYISAM_STORAGE_ENGINE=1

 -DWITH_INNOBASE_STORAGE_ENGINE=1

 -DWITH_ARCHIVE_STORAGE_ENGINE=1

 -DWITH_BLACKHOLE_STORAGE_ENGINE=1

 -DENABLED_LOCAL_INFILE=1

 -DDEFAULT_CHARSET=utf8

 -DDEFAULT_COLLATION=utf8_general_ci

 -DEXTRA_CHARSETS=all

 -DMYSQL_TCP_PORT=3306

 -DWITH_DEBUG=OFF

 -DWITH_READLINE=1

 -DMYSQL_UNIX_ADDR=/tmp/mysql.sock 

具體cmake和configure的對應關係參考:MySQL5.5編譯工具configure向cmake過渡指南

2、php5.3.8將fastcgi整合在一起,編譯時需加上–enable-fpm,新版是方便了一些,但配置不習慣,還有待研究,我的編譯引數如下:

./configure  –prefix=/usr/local/php

–with-config-file-path=/usr/local/php/etc

–with-mysql=/usr/local/mysql

–with-mysqli=/usr/local/mysql/bin/mysql_config

–with-iconv-dir=/usr/local

–with-freetype-dir

–with-jpeg-dir

–with-png-dir

–with-zlib

–with-libxml-dir=/usr

–enable-xml

–disable-rpath

–enable-safe-mode

–enable-bcmath

–enable-shmop

–enable-sysvsem

–enable-inline-optimization

–with-curl –with-curlwrappers

–enable-mbregex

–enable-fpm

–enable-mbstring

–with-mcrypt

–with-gd

–enable-gd-native-ttf

–with-openssl

–with-mhash

–enable-pcntl

–enable-sockets

–with-ldap

–with-ldap-sasl

–with-xmlrpc

–enable-zip

–enable-soap

新版PHP還有語法檢查功能,跟Nginx一樣/usr/local/php/sbin/php-fpm -t

啟動方法:/usr/local/php/sbin/php-fpm

php-fpm.conf配置詳解:http://blog.hexu.org/archives/1078.shtml

php還有一個狀態頁,在php-fpm.conf配置中開啟檢視狀態頁功能後,可檢視PHP狀態:

http://192.168.52.132/status
pool:                 www

process manager:      dynamic

start time:           19/Nov/2011:01:52:18 +0800

start since:          453

accepted conn:        5

listen queue:         0

max listen queue:     0

listen queue len:     0

idle processes:       8

active processes:     1

total processes:      9

max active processes: 1

max children reached: 0
 

3、Nginx安裝和配置沒啥大的改動

效能和穩定測試有待考驗~~~~~

本文轉自運維筆記部落格51CTO部落格,原文連結http://blog.51cto.com/lihuipeng/725084如需轉載請自行聯絡原作者

lihuipeng