您好,登錄后才能下訂單哦!
先裝好rhel6.5 配置好實(shí)驗(yàn)環(huán)境
關(guān)掉NetworkManager,并停止掉開機(jī)自啟動(dòng)
[root@duwensql ~]# service NetworkManager stop [root@duwensql ~]# chkconfig -- list NetworkManager [root@duwensql ~]# chkconfig NetworkManager off
關(guān)掉iptables
[root@duwensql ~]# iptables -F [root@duwensql ~]# service iptables save iptables£o·àe1ò±£′μ /etc/sysconfig/iptables£o [è·¨] [root@duwensql ~]# chkconfig iptables off
關(guān)掉selinux
[root@duwensql ~]# getenforce Enforcing [root@duwensql ~]# setenforce usage: setenforce [ Enforcing | Permissive | 1 | 0 ] [root@duwensql ~]# setenforce 0 [root@duwensql ~]# [root@duwensql ~]# vim /etc/selinux/config
打開這個(gè)檔案以后你可以看到如下的內(nèi)容,把SELINUX的值改成disabled就好
# This file controls the state of SELinux on the system. # SELINUX= can take one of these three values: # enforcing - SELinux security policy is enforced. # permissive - SELinux prints warnings instead of enforcing. # disabled - No SELinux policy is loaded. SELINUX=disabled # SELINUXTYPE= can take one of these two values: # targeted - Targeted processes are protected, # mls - Multi Level Security protection. SELINUXTYPE=targeted
修改主機(jī)名映射,可以不改,但是為了方便還是改下吧
[root@duwensql ~]# cat /etc/hosts 127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 ::1 localhost localhost.localdomain localhost6 localhost6.localdomain6 [root@duwensql ~]# echo "192.168.20.253 duwensql.cn MySQL" >> /etc/hosts [root@duwensql ~]# cat /etc/hosts 127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 ::1 localhost localhost.localdomain localhost6 localhost6.localdomain6 192.168.20.253 duwensql.cn MySQL [root@duwensql ~]#
修改主機(jī)名,就是編輯下面的這個(gè)檔案,這里只貼上修改后的內(nèi)容
[root@duwensql ~]# cat /etc/sysconfig/network NETWORKING=yes HOSTNAME=duwensql.cn GATEWAY=192.168.20.2 NTPSERVERARGS=iburst [root@duwensql ~]#
配置本地yum源
[root@duwensql ~]# [root@duwensql ~]# mount /dev/sr0 /mnt/ mount: block device /dev/sr0 is write-protected, mounting read-only [root@duwensql ~]# df -h | tail -1 /dev/sr0 3.6G 3.6G 0 100% /mnt [root@duwensql ~]# echo "/dev/sr0 /mnt/ iso9660 defaults 0 0" >> /etc/fstab [root@duwensql ~]# rm -rf /etc/yum.repos.d/* [root@duwensql ~]# cat > /etc/yum.repos.d/rhel6.repo <<EOF > [rhel6-source] > name=rhel6-source > baseurl=file:///mnt > enabled=1 > gpgcheck=0 > EOF [root@duwensql ~]# yum clean all Loaded plugins: product-id, refresh-packagekit, security, subscription-manager This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register. Cleaning repos: rhel6-source Cleaning up Everything [root@duwensql ~]# yum list
檢測依賴環(huán)境,包括gcc,gcc-c++,autoconf,automake,zlib ,zlib-devel, openssl ,openssl-devel ,pcre-devel,
[root@duwensql ~]# [root@duwensql ~]# yum install -y gcc gcc-c++ autoconf automake [root@duwensql ~]# yum install -y zlib zlib-devel openssl openssl-devel pcre-devel
為了方便從xshell上傳軟件包,這里安裝一個(gè)工具
[root@duwensql ~]# rpm /mnt/Packages/lrzsz-0.12.20-27.1.el6.x86_64.rpm -ih warning: /mnt/Packages/lrzsz-0.12.20-27.1.el6.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID fd431d51: NOKEY ########################################### [100%] ########################################### [100%] [root@duwensql ~]#
//上傳軟件包:nginx-1.6.0.tar.gz mysql-5.5.30.tar.gz php-5.4.14.tar.bz2
[root@duwensql ~]# rz z waiting to receive.**B0100000023be50 [root@duwensql ~]# ls anaconda-ks.cfg install.log.syslog nginx-1.6.0.tar.gz 公共的 視頻 文檔 音樂 install.log mysql-5.5.30.tar.gz php-5.4.14.tar.bz2 模板 圖片 下載 桌面
正式開始安裝MySQL了
解壓到指定目錄/usr/local/src/
[root@duwensql ~]# [root@duwensql ~]# tar -zxf mysql-5.5.30.tar.gz -C /usr/local/src/
建一個(gè)mysql用戶,這里把這個(gè)用戶顯示出來
[root@duwensql ~]# tail -1 /etc/passwd mysql:x:500:500::/home/mysql:/sbin/nologin [root@duwensql ~]#
//安裝cmake
[root@duwensql ~]# yum install -y cmake
建立mysql的目錄
[root@duwensql /]# mkdir /server [root@duwensql ~]# cd /usr/local/src/mysql-5.5.30/ [root@duwensql mysql-5.5.30]# cmake -DCMAKE_INSTALL_PREFIX=/server/mysql-5.5 -DMYSQL_UNIX_ADDR=/tmp/mysql.sock -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci -DWITH_EXTRA_CHARSERS=all -DWITH_MYISAM_STORAGE_ENGINE=1 -DWITH_INNOBASE_STORAGE_ENGINE=1 -DWITH_MEMORY_STORAGE_ENGINE=1 -DWITH_READLINT=1 -DENABLED_LOCAL_INFILE=1 -DMYSQL_DATADIR=/server/mysql/data -DMYSQL_USER=mysql
//報(bào)錯(cuò)啦啦啦啦
CMake Error at cmake/readline.cmake:83 (MESSAGE): Curses library not found. Please install appropriate package, remove CMakeCache.txt and rerun cmake.On Debian/Ubuntu, package name is libncurses5-dev, on Redhat and derivates it is ncurses-devel. Call Stack (most recent call first): cmake/readline.cmake:127 (FIND_CURSES) cmake/readline.cmake:217 (MYSQL_USE_BUNDLED_LIBEDIT) CMakeLists.txt:269 (MYSQL_CHECK_READLINE) -- Configuring incomplete, errors occurred!
//這個(gè)錯(cuò)誤就是ncurses這個(gè)依賴沒有裝,yum安裝一下
[root@duwensql ncurses-5.9]# yum -y install ncurses-devel
//裝了那個(gè)ncurses依賴,還是報(bào)錯(cuò),就只好把這個(gè)CMakeCache.txt找出來干掉了
[root@duwensql mysql-5.5.30]# find / -name CMakeCache.txt /usr/local/src/mysql-5.5.30/CMakeCache.txt [root@duwensql mysql-5.5.30]# rm -rf /usr/local/src/mysql-5.5.30/CMakeCache.txt
//OK,現(xiàn)在重新cmake
//吶開心不,沒有報(bào)錯(cuò)了呢?。?!
現(xiàn)在make &&make install,過程就不寫了
配置運(yùn)行環(huán)境
[root@duwensql mysql-5.5.30]# cd /server/ [root@duwensql server]# ls mysql-5.5 [root@duwensql server]# chown -R mysql:mysql /server/mysql-5.5/
復(fù)制mysql配置文件
[root@duwensql server]# cd /etc/ [root@duwensql etc]# ll my.cnf -rw-r--r--. 1 root root 251 8月 9 2013 my.cnf [root@duwensql etc]# mv ./my.cnf ./my.cnf.back [root@duwensql etc]# cp /usr/local/src/mysql-5.5.30/support-files/my-large.cnf /etc/my.cnf [root@duwensql etc]#
這個(gè)步驟是加入開機(jī)啟動(dòng)項(xiàng)
[root@duwensql init.d]# cp /usr/local/src/mysql-5.5.30/support-files/mysql.server /etc/init.d/mysqld5.5 [root@duwensql init.d]# chmod +x ./mysqld5.5 [root@duwensql init.d]# pwd /etc/init.d [root@duwensql init.d]#
//這里要改下,大概在第70行
[root@duwensql init.d]# vim /etc/init.d/mysqld5.5 [root@duwensql init.d]# head -71 /etc/init.d/mysqld5.5 |tail -7 then basedir=/server/mysql-5.5 bindir=/server/mysql-5.5/bin if test -z "$datadir" then datadir=/server/mysql-5.5/data fi [root@duwensql init.d]#
//加入開機(jī)啟動(dòng)項(xiàng)
[root@duwensql init.d]# chkconfig mysqld5.5 on [root@duwensql init.d]# chkconfig --list mysqld5.5 mysqld5.5 0:關(guān)閉1:關(guān)閉2:啟用3:啟用4:啟用5:啟用6:關(guān)閉 [root@duwensql init.d]#
初始化mysql
[root@duwensql init.d]# cd /usr/local/src/mysql-5.5.30/scripts/ [root@duwensql scripts]# chmod +x mysql_install_db [root@duwensql scripts]# ./mysql_install_db --defaults-file=/etc/my.cnf --basedir=/server/mysql-5.5 --datadir=/server/mysql-5.5/data --user=mysql Installing MySQL system tables... OK Filling help tables... OK To start mysqld at boot time you have to copy support-files/mysql.server to the right place for your system PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER ! To do so, start the server, then issue the following commands: /server/mysql-5.5/bin/mysqladmin -u root password 'new-password' /server/mysql-5.5/bin/mysqladmin -u root -h duwensql password 'new-password' Alternatively you can run: /server/mysql-5.5/bin/mysql_secure_installation which will also give you the option of removing the test databases and anonymous user created by default. This is strongly recommended for production servers. See the manual for more instructions. You can start the MySQL daemon with: cd /server/mysql-5.5 ; /server/mysql-5.5/bin/mysqld_safe & You can test the MySQL daemon with mysql-test-run.pl cd /server/mysql-5.5/mysql-test ; perl mysql-test-run.pl Please report any problems with the /server/mysql-5.5/scripts/mysqlbug script! [root@duwensql scripts]#
開啟mysql
[root@duwensql scripts]# /etc/init.d/mysqld5.5 start Starting MySQL... [確定] [root@duwensql scripts]#
測試MySQL
//我這里最開始在家目錄輸入mysql顯示沒有命令,是因?yàn)闆]有加入環(huán)境變量的緣故啦,這里就不寫出來了,直接到絕對(duì)路徑去測試
root@duwensql mysql-test]# cd /server [root@duwensql server]# ls mysql-5.5 [root@duwensql server]# cd mysql-5.5/ [root@duwensql mysql-5.5]# ls bin COPYING data docs include INSTALL-BINARY lib man mysql-test README scripts share sql-bench support-files [root@duwensql mysql-5.5]# cd bin/ [root@duwensql bin]# ./mysql Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 1 Server version: 5.5.30-log Source distribution Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql> show databases; +--------------------+ | Database | +--------------------+ | information_schema | | mysql | | performance_schema | | test | +--------------------+ 4 rows in set (0.04 sec) mysql>
ctrl + c 退出
給他加個(gè)環(huán)境變量吧
[root@duwensql ~]# echo $PATH /usr/lib64/qt-3.3/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin [root@duwensql ~]# PATH="$PATH":/server/mysql-5.5/bin/
設(shè)置mysql的root賬戶密碼,并測試登陸
[root@duwensql ~]# mysqladmin -uroot password '123456' [root@duwensql ~]# mysql -u root -p123456 Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 4 Server version: 5.5.30-log Source distribution Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql>
ctrl + c 退出
MySQL安裝完了
來安裝nginx吧
解壓
[root@duwensql ~]# tar -zxf nginx-1.6.0.tar.gz
編譯
[root@duwensql nginx-1.6.0]# ./configure --prefix=server/nginx-1.6.0 --user=nginx --group=nginx --with-http_dav_module --with-http_stub_status_module --with-http_addition_module --with-http_sub_module --with-http_flv_module --with-http_mp4_module
結(jié)果太多就不寫了,放一個(gè)圖
make&&make install
[root@duwensql nginx-1.6.0]# make -j 4 && make install
開始配置
[root@duwensql nginx-1.2.8]# pwd /server/nginx-1.2.8 [root@duwensql nginx-1.2.8]# vim conf/nginx.conf
第二行加
user nginx nginx;
然后加下面的內(nèi)容,括號(hào){前面有空格
location ~ \.php$ { root html; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME /server/nginx-1.2.8/html$fastcgi_script_name; include fastcgi_params; }
大概的位置如下圖
啟動(dòng)服務(wù)
[root@duwensql nginx-1.2.8]# /server/nginx-1.2.8/sbin/nginx
把服務(wù)加入開機(jī)啟動(dòng)
[root@duwensql nginx-1.2.8]# echo '/server/nginx-1.2.8/sbin/nginx & ' >> /etc/rc.local [root@duwensql nginx-1.2.8]#
測試下
測試配置文件和重新加載配置文件
[root@duwensql nginx-1.2.8]# /server/nginx-1.2.8/sbin/nginx -t nginx: the configuration file /server/nginx-1.2.8/conf/nginx.conf syntax is ok nginx: configuration file /server/nginx-1.2.8/conf/nginx.conf test is successful [root@duwensql nginx-1.2.8]# /server/nginx-1.2.8/sbin/nginx -s reload
來安裝PHP
給PHP添加擴(kuò)展模塊:libmcrypt-2.5.8.tar.gz
1、 讓 PHP 編譯支持這個(gè)功能
2、 生成擴(kuò)展模塊
3、 --with-mcrypt=/usr/local/
安裝libmcrypt庫
[root@duwensql ~]# tar -zxf libmcrypt-2.5.8.tar.gz [root@duwensql ~]# cd libmcrypt-2.5.8 [root@duwensql libmcrypt-2.5.8]# ./configure --prefix=/usr/local/ [root@duwensql libmcrypt-2.5.8]# echo $? 0 [root@duwensql libmcrypt-2.5.8]# make -j 4 && make install
加個(gè)環(huán)境
[root@duwensql libmcrypt-2.5.8]# yum -y install php-pear
解壓以及編譯
//在這一步出了好多好多錯(cuò)誤,始料不及啊,本文把錯(cuò)誤和解決貼上,如果還是不明白的話可以直接搜索錯(cuò)誤,這里就不寫了
[root@duwensql ~]# tar jxf php-5.4.14.tar.bz2 -C /usr/local/src/ [root@duwensql ~]# cd /usr/local/src/php-5.4.14/ [root@duwensql php-5.4.14]# ./configure --prefix=/server/php-5.4-nginx --with-config-file-path=/server/php-5.4-nginx --with-mysql=/server-5.5/ --with-mysqli=/server/mysql-5.5/bin/mysql_config --with-iconv-dir --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir=/usr --enable-xml --disable-rpath --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --with-curl --with-curlwrappers --enable-mbregex --enable-fpm --enable-mbstring --with-gd --enable-gd-native-ttf --with-openssl --with-mhash --enable-pcntl --enable-sockets --with-xmlrpc --enable-zip --enable-soap --with-mcrypt=/usr/local/
報(bào)錯(cuò)1
####### configure: error: xml2-config not found. Please check your libxml2 installation. [root@duwensql php-5.4.14]#
解決1
[root@duwensql php-5.4.14]# yum -y install libxml2*
重新編譯
[root@duwensql php-5.4.14]# ./configure --prefix=/server/php-5.4-nginx --with-config-file-path=/server/php-5.4-nginx --with-mysql=/server/mysql-5.5/ --with-mysqli=/server/mysql-5.5/bin/mysql_config --with-iconv-dir --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir=/usr --enable-xml --disable-rpath --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --with-curl --with-curlwrappers --enable-mbregex --enable-fpm --enable-mbstring --with-gd --enable-gd-native-ttf --with-openssl --with-mhash --enable-pcntl --enable-sockets --with-xmlrpc --enable-zip --enable-soap --with-mcrypt=/usr/local/
報(bào)錯(cuò)2
checking if we should use cURL for url streams... yes checking for cURL in default path... not found configure: error: Please reinstall the libcurl distribution - easy.h should be in <curl-dir>/include/curl/ [root@duwensql php-5.4.14]#
解決2:
[root@duwensql php-5.4.14]# yum -y install curl-devel
重新編譯
[root@duwensql php-5.4.14]#./configure --prefix=/server/php-5.4-nginx --with-config-file-path=/server/php-5.4-nginx --with-mysql=/server/mysql-5.5/ --with-mysqli=/server/mysql-5.5/bin/mysql_config --with-iconv-dir --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir=/usr --enable-xml --disable-rpath --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --with-curl --with-curlwrappers --enable-mbregex --enable-fpm --enable-mbstring --with-gd --enable-gd-native-ttf --with-openssl --with-mhash --enable-pcntl --enable-sockets --with-xmlrpc --enable-zip --enable-soap --with-mcrypt=/usr/local/
報(bào)錯(cuò)3
checking whether to enable JIS-mapped Japanese font support in GD... no checking for fabsf... yes checking for floorf... yes configure: error: jpeglib.h not found
解決3:*不要丟了
[root@duwensql php-5.4.14]# yum -y install libjpeg*
再次編譯
[root@duwensql php-5.4.14]./configure --prefix=/server/php-5.4-nginx --with-config-file-path=/server/php-5.4-nginx --with-mysql=/server/mysql-5.5/ --with-mysqli=/server/mysql-5.5/bin/mysql_config --with-iconv-dir --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir=/usr --enable-xml --disable-rpath --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --with-curl --with-curlwrappers --enable-mbregex --enable-fpm --enable-mbstring --with-gd --enable-gd-native-ttf --with-openssl --with-mhash --enable-pcntl --enable-sockets --with-xmlrpc --enable-zip --enable-soap --with-mcrypt=/usr/local/
報(bào)錯(cuò)4:
checking for jpeg_read_header in -ljpeg... yes If configure fails try --with-vpx-dir=<DIR> configure: error: png.h not found. [root@duwensql php-5.4.14]#
解決4:*不要丟了
[root@duwensql php-5.4.14]# yum -y install libpng*
再次編譯
[root@duwensql php-5.4.14]#./configure --prefix=/server/php-5.4-nginx --with-config-file-path=/server/php-5.4-nginx --with-mysql=/server/mysql-5.5/ --with-mysqli=/server/mysql-5.5/bin/mysql_config --with-iconv-dir --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir=/usr --enable-xml --disable-rpath --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --with-curl --with-curlwrappers --enable-mbregex --enable-fpm --enable-mbstring --with-gd --enable-gd-native-ttf --with-openssl --with-mhash --enable-pcntl --enable-sockets --with-xmlrpc --enable-zip --enable-soap --with-mcrypt=/usr/local/
報(bào)錯(cuò)5:
configure: error: freetype.h not found.
解決5:*不要丟掉了
[root@duwensql php-5.4.14]# yum -y install freetype*
再次編譯
[root@duwensql php-5.4.14]#./configure --prefix=/server/php-5.4-nginx --with-config-file-path=/server/php-5.4-nginx --with-mysql=/server/mysql-5.5/ --with-mysqli=/server/mysql-5.5/bin/mysql_config --with-iconv-dir --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir=/usr --enable-xml --disable-rpath --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --with-curl --with-curlwrappers --enable-mbregex --enable-fpm --enable-mbstring --with-gd --enable-gd-native-ttf --with-openssl --with-mhash --enable-pcntl --enable-sockets --with-xmlrpc --enable-zip --enable-soap --with-mcrypt=/usr/local/
報(bào)錯(cuò)6:
checking for specified location of the MySQL UNIX socket... no configure: error: Cannot find MySQL header files under /server-5.5/. Note that the MySQL client library is not bundled anymore!
這個(gè)應(yīng)該是指定路徑錯(cuò)誤,改下
再次編譯
[root@duwensql php-5.4.14]#./configure --prefix=/server/php-5.4-nginx --with-config-file-path=/server/php-5.4-nginx --with-mysql=/server/mysql-5.5/ --with-mysqli=/server/mysql-5.5/bin/mysql_config --with-iconv-dir --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir=/usr --enable-xml --disable-rpath --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --with-curl --with-curlwrappers --enable-mbregex --enable-fpm --enable-mbstring --with-gd --enable-gd-native-ttf --with-openssl --with-mhash --enable-pcntl --enable-sockets --with-xmlrpc --enable-zip --enable-soap --with-mcrypt=/usr/local/
報(bào)錯(cuò)7:
configure: error: wrong mysql library version or lib not found. Check config.log for more information.
解決7:
“=/server/mysql-5.5/bin/mysql_config”刪掉試試
改好以后的執(zhí)行:
[root@duwensql php-5.4.14]# ./configure --prefix=/server/php-5.4-nginx --with-config-file-path=/server/php-5.4-nginx --with-mysql=/server/mysql-5.5/ --with-mysqli --with-iconv-dir --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir=/usr --enable-xml --disable-rpath --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --with-curl --with-curlwrappers --enable-mbregex --enable-fpm --enable-mbstring --with-gd --enable-gd-native-ttf --with-openssl --with-mhash --enable-pcntl --enable-sockets --with-xmlrpc --enable-zip --enable-soap --with-mcrypt=/usr/local/
歷經(jīng)千辛萬苦啊
這里貼上一些參數(shù)的意思
--with-iconv-dir #字符集轉(zhuǎn)換 需要的擴(kuò)展模塊
–without-iconv 關(guān)閉 iconv 函數(shù),種字符集間的轉(zhuǎn)換
–with-freetype-dir 打開對(duì) freetype 字體庫的支持
–with-jpeg-dir 打開對(duì) jpeg 圖片的支持
–with-png-dir 打開對(duì) png 圖片的支持
–with-libxml-dir 打開 libxml2 庫的支持
–disable-rpath 關(guān)閉額外的運(yùn)行庫文件
–enable-bcmath 打開圖片大小調(diào)整,用到 zabbix 監(jiān)控的時(shí)候用到了這個(gè)模塊
下面 是make && make install
[root@duwensql php-5.4.14]# make -j 4 && make install
生成配置文件
[root@duwensql ~]# cp /usr/local/src/php-5.4.14/php.ini-production /server/php-5.4-nginx/php.ini
生成php-fpm配置文件
[root@duwensql ~]# cp /server/php-5.4-nginx/etc/php-fpm.conf.default /server/php-5.4-nginx/etc/php-fpm.conf
生成php-fpm啟動(dòng)腳本
[root@duwensql ~]# cp /usr/local/src/php-5.4.14/sapi/fpm/init.d.php-fpm /etc/init.d/php-fpm [root@duwensql ~]# chmod +x /etc/init.d/php-fpm [root@duwensql ~]# /etc/init.d/php-fpm start Starting php-fpm done [root@duwensql ~]# netstat -anptu | grep 9000 tcp 0 0 127.0.0.1:9000 0.0.0.0:* LISTEN 76616/php-fpm [root@duwensql ~]#
測試php
[root@duwensql ~]# vim /server/nginx-1.2.8/html/a.php [root@duwensql ~]# cat /server/nginx-1.2.8/html/a.php <?php phpinfo(); ?> [root@duwensql ~]#
效果圖如下
The End!
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場,如果涉及侵權(quán)請(qǐng)聯(lián)系站長郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。