设为首页 收藏本站
查看: 1428|回复: 0

rhel6上搭建lnmp架构以及遇到的一些错误并排除方法

[复制链接]
累计签到:1 天
连续签到:1 天
发表于 2016-6-29 10:08:06 | 显示全部楼层 |阅读模式
先装好rhel6.5 配置好实验环境
关掉NetworkManager,并停止掉开机自启动
1
2
3
[iyunv@duwensql ~]# service NetworkManager stop
[iyunv@duwensql ~]# chkconfig -- list NetworkManager
[iyunv@duwensql ~]# chkconfig NetworkManager off



关掉iptables
1
2
3
4
[iyunv@duwensql ~]# iptables -F
[iyunv@duwensql ~]# service iptables save
iptables£o·àe1ò±£′μ /etc/sysconfig/iptables£o     [è·¨]
[iyunv@duwensql ~]# chkconfig iptables off



关掉selinux
1
2
3
4
5
6
7
[iyunv@duwensql ~]# getenforce
Enforcing
[iyunv@duwensql ~]# setenforce
usage:  setenforce [ Enforcing | Permissive | 1 | 0 ]
[iyunv@duwensql ~]# setenforce 0
[iyunv@duwensql ~]#
[iyunv@duwensql ~]# vim /etc/selinux/config



打开这个档案以后你可以看到如下的内容,把SELINUX的值改成disabled就好
1
2
3
4
5
6
7
8
9
10
# 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





修改主机名映射,可以不改,但是为了方便还是改下吧
1
2
3
4
5
6
7
8
9
[iyunv@duwensql ~]# cat /etc/hosts
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
[iyunv@duwensql ~]# echo "192.168.20.253 duwensql.cn MySQL" >> /etc/hosts
[iyunv@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
[iyunv@duwensql ~]#



修改主机名,就是编辑下面的这个档案,这里只贴上修改后的内容
1
2
3
4
5
6
[iyunv@duwensql ~]# cat /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=duwensql.cn
GATEWAY=192.168.20.2
NTPSERVERARGS=iburst
[iyunv@duwensql ~]#



配置本地yum源

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
[iyunv@duwensql ~]#
[iyunv@duwensql ~]# mount /dev/sr0 /mnt/
mount: block device /dev/sr0 is write-protected, mounting read-only
[iyunv@duwensql ~]# df -h | tail -1
/dev/sr0        3.6G  3.6G     0 100% /mnt
[iyunv@duwensql ~]# echo "/dev/sr0 /mnt/ iso9660 defaults 0 0" >> /etc/fstab
[iyunv@duwensql ~]# rm -rf /etc/yum.repos.d/*
[iyunv@duwensql ~]# cat > /etc/yum.repos.d/rhel6.repo <<EOF
> [rhel6-source]
> name=rhel6-source
> baseurl=file:///mnt
> enabled=1
> gpgcheck=0
> EOF
[iyunv@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
[iyunv@duwensql ~]# yum list



检测依赖环境,包括gcc,gcc-c++,autoconf,automake,zlib ,zlib-devel, openssl ,openssl-devel ,pcre-devel,
1
2
3
[iyunv@duwensql ~]#
[iyunv@duwensql ~]# yum install -y gcc gcc-c++ autoconf automake
[iyunv@duwensql ~]# yum install -y zlib zlib-devel openssl openssl-devel pcre-devel





为了方便从xshell上传软件包,这里安装一个工具
1
2
3
4
5
[iyunv@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%]
[iyunv@duwensql ~]#



//上传软件包:nginx-1.6.0.tar.gz  mysql-5.5.30.tar.gz  php-5.4.14.tar.bz2

1
2
3
4
5
[iyunv@duwensql ~]# rz
z waiting to receive.**B0100000023be50
[iyunv@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/
1
2
[iyunv@duwensql ~]#
[iyunv@duwensql ~]# tar -zxf mysql-5.5.30.tar.gz -C /usr/local/src/




建一个mysql用户,这里把这个用户显示出来
1
2
3
[iyunv@duwensql ~]# tail -1 /etc/passwd
mysql:x:500:500::/home/mysql:/sbin/nologin
[iyunv@duwensql ~]#




//安装cmake
1
[iyunv@duwensql ~]# yum install -y cmake




建立mysql的目录
1
2
3
[iyunv@duwensql /]# mkdir /server
[iyunv@duwensql ~]#  cd /usr/local/src/mysql-5.5.30/
[iyunv@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




//报错啦啦啦啦
1
2
3
4
5
6
7
8
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!



//这个错误就是ncurses这个依赖没有装,yum安装一下
1
[iyunv@duwensql ncurses-5.9]# yum -y install ncurses-devel



//装了那个ncurses依赖,还是报错,就只好把这个CMakeCache.txt找出来干掉了
1
2
3
[iyunv@duwensql mysql-5.5.30]# find / -name CMakeCache.txt
/usr/local/src/mysql-5.5.30/CMakeCache.txt
[iyunv@duwensql mysql-5.5.30]# rm -rf /usr/local/src/mysql-5.5.30/CMakeCache.txt



//OK,现在重新cmake
QQ截图20160629100641.png
//呐开心不,没有报错了呢!!!
现在make &&make install,过程就不写了
配置运行环境
1
2
3
4
[iyunv@duwensql mysql-5.5.30]# cd /server/
[iyunv@duwensql server]# ls
mysql-5.5
[iyunv@duwensql server]# chown -R mysql:mysql /server/mysql-5.5/




复制mysql配置文件
1
2
3
4
5
6
[iyunv@duwensql server]# cd /etc/
[iyunv@duwensql etc]# ll my.cnf
-rw-r--r--. 1 root root 251 8月   9 2013 my.cnf
[iyunv@duwensql etc]# mv ./my.cnf ./my.cnf.back
[iyunv@duwensql etc]# cp /usr/local/src/mysql-5.5.30/support-files/my-large.cnf /etc/my.cnf
[iyunv@duwensql etc]#



这个步骤是加入开机启动项
1
2
3
4
5
[iyunv@duwensql init.d]# cp /usr/local/src/mysql-5.5.30/support-files/mysql.server /etc/init.d/mysqld5.5
[iyunv@duwensql init.d]# chmod +x ./mysqld5.5
[iyunv@duwensql init.d]# pwd
/etc/init.d
[iyunv@duwensql init.d]#



//这里要改下,大概在第70行
1
2
3
4
5
6
7
8
9
10
[iyunv@duwensql init.d]# vim /etc/init.d/mysqld5.5
[iyunv@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
[iyunv@duwensql init.d]#



//加入开机启动项
1
2
3
4
[iyunv@duwensql init.d]# chkconfig mysqld5.5 on
[iyunv@duwensql init.d]# chkconfig --list mysqld5.5
mysqld5.5      0:关闭1:关闭2:启用3:启用4:启用5:启用6:关闭
[iyunv@duwensql init.d]#



初始化mysql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
[iyunv@duwensql init.d]#  cd /usr/local/src/mysql-5.5.30/scripts/
[iyunv@duwensql scripts]# chmod +x mysql_install_db
[iyunv@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!
[iyunv@duwensql scripts]#



开启mysql
1
2
3
[iyunv@duwensql scripts]# /etc/init.d/mysqld5.5 start
Starting MySQL...                                          [确定]
[iyunv@duwensql scripts]#



测试MySQL

//我这里最开始在家目录输入mysql显示没有命令,是因为没有加入环境变量的缘故啦,这里就不写出来了,直接到绝对路径去测试
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
root@duwensql mysql-test]# cd /server
[iyunv@duwensql server]# ls
mysql-5.5
[iyunv@duwensql server]# cd mysql-5.5/
[iyunv@duwensql mysql-5.5]# ls
bin  COPYING  data  docs  include  INSTALL-BINARY  lib  man  mysql-test  README  scripts  share  sql-bench  support-files
[iyunv@duwensql mysql-5.5]# cd bin/
[iyunv@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 退出

给他加个环境变量吧
1
2
3
[iyunv@duwensql ~]# echo $PATH
/usr/lib64/qt-3.3/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin
[iyunv@duwensql ~]# PATH="$PATH":/server/mysql-5.5/bin/



设置mysql的root账户密码,并测试登陆
1
2
3
4
5
6
7
8
9
10
11
[iyunv@duwensql ~]# mysqladmin -uroot password '123456'
[iyunv@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吧
解压
1
[iyunv@duwensql ~]# tar -zxf nginx-1.6.0.tar.gz



编译
1
[iyunv@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



结果太多就不写了,放一个图
QQ截图20160629100648.png
make&&make install
1
[iyunv@duwensql nginx-1.6.0]# make -j 4 && make install



开始配置
1
2
3
[iyunv@duwensql nginx-1.2.8]# pwd
/server/nginx-1.2.8
[iyunv@duwensql nginx-1.2.8]# vim conf/nginx.conf



第二行加
1
user nginx nginx;



然后加下面的内容,括号{前面有空格
1
2
3
4
5
6
7
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;
}



大概的位置如下图
QQ截图20160629100654.png

启动服务
1
[iyunv@duwensql nginx-1.2.8]# /server/nginx-1.2.8/sbin/nginx



把服务加入开机启动
1
2
[iyunv@duwensql nginx-1.2.8]# echo '/server/nginx-1.2.8/sbin/nginx & ' >> /etc/rc.local
[iyunv@duwensql nginx-1.2.8]#



测试下
QQ截图20160629100700.png

测试配置文件和重新加载配置文件
1
2
3
4
[iyunv@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
[iyunv@duwensql nginx-1.2.8]# /server/nginx-1.2.8/sbin/nginx -s reload



来安装PHP
给PHP添加扩展模块:libmcrypt-2.5.8.tar.gz
1、 让 PHP 编译支持这个功能
2、 生成扩展模块
3、 --with-mcrypt=/usr/local/
安装libmcrypt库
1
2
3
4
5
6
[iyunv@duwensql ~]# tar -zxf libmcrypt-2.5.8.tar.gz
[iyunv@duwensql ~]# cd libmcrypt-2.5.8
[iyunv@duwensql libmcrypt-2.5.8]# ./configure --prefix=/usr/local/
[iyunv@duwensql libmcrypt-2.5.8]# echo $?
0
[iyunv@duwensql libmcrypt-2.5.8]# make -j 4 && make install



加个环境
1
[iyunv@duwensql libmcrypt-2.5.8]# yum -y install php-pear



解压以及编译
//在这一步出了好多好多错误,始料不及啊,本文把错误和解决贴上,如果还是不明白的话可以直接搜索错误,这里就不写了
1
2
3
[iyunv@duwensql ~]# tar jxf php-5.4.14.tar.bz2 -C /usr/local/src/
[iyunv@duwensql ~]# cd /usr/local/src/php-5.4.14/
[iyunv@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/



报错1
1
2
3
#######
configure: error: xml2-config not found. Please check your libxml2 installation.
[iyunv@duwensql php-5.4.14]#



解决1
1
[iyunv@duwensql php-5.4.14]# yum -y install libxml2*



重新编译
1
[iyunv@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/



报错2
1
2
3
4
5
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/
[iyunv@duwensql php-5.4.14]#



解决2:
1
[iyunv@duwensql php-5.4.14]#  yum -y install curl-devel



重新编译
1
[iyunv@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/



报错3
1
2
3
4
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:*不要丢了
1
[iyunv@duwensql php-5.4.14]# yum -y install libjpeg*




再次编译
1
[iyunv@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/



报错4:
1
2
3
4
checking for jpeg_read_header in -ljpeg... yes
If configure fails try --with-vpx-dir=<DIR>
configure: error: png.h not found.
[iyunv@duwensql php-5.4.14]#



解决4:*不要丢了
1
[iyunv@duwensql php-5.4.14]# yum -y install libpng*




再次编译
1
[iyunv@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/



报错5:
1
configure: error: freetype.h not found.



解决5:*不要丢掉了
1
[iyunv@duwensql php-5.4.14]# yum -y install freetype*



再次编译
1
[iyunv@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/



报错6:
1
2
3
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!




这个应该是指定路径错误,改下
再次编译
1
[iyunv@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/



报错7:
1
configure: error: wrong mysql library version or lib not found. Check config.log for more information.



解决7:
“=/server/mysql-5.5/bin/mysql_config”删掉试试
改好以后的执行:
1
[iyunv@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/



历经千辛万苦啊
QQ截图20160629100708.png

这里贴上一些参数的意思

--with-iconv-dir   #字符集转换 需要的扩展模块
–without-iconv               关闭 iconv 函数,种字符集间的转换
–with-freetype-dir             打开对 freetype 字体库的支持
–with-jpeg-dir                                打开对 jpeg 图片的支持
–with-png-dir                                打开对 png 图片的支持
–with-libxml-dir                打开 libxml2 库的支持
–disable-rpath                    关闭额外的运行库文件
–enable-bcmath                 打开图片大小调整,用到 zabbix 监控的时候用到了这个模块
下面 是make  && make install
1
[iyunv@duwensql php-5.4.14]# make -j 4 && make install



生成配置文件
1
[iyunv@duwensql ~]# cp /usr/local/src/php-5.4.14/php.ini-production /server/php-5.4-nginx/php.ini



生成php-fpm配置文件
1
[iyunv@duwensql ~]# cp /server/php-5.4-nginx/etc/php-fpm.conf.default /server/php-5.4-nginx/etc/php-fpm.conf



生成php-fpm启动脚本
1
2
3
4
5
6
7
[iyunv@duwensql ~]# cp /usr/local/src/php-5.4.14/sapi/fpm/init.d.php-fpm /etc/init.d/php-fpm
[iyunv@duwensql ~]# chmod +x /etc/init.d/php-fpm
[iyunv@duwensql ~]# /etc/init.d/php-fpm start
Starting php-fpm  done
[iyunv@duwensql ~]# netstat -anptu | grep 9000
tcp        0      0 127.0.0.1:9000              0.0.0.0:*                   LISTEN      76616/php-fpm      
[iyunv@duwensql ~]#



测试php
1
2
3
4
5
6
[iyunv@duwensql ~]# vim /server/nginx-1.2.8/html/a.php
[iyunv@duwensql ~]# cat /server/nginx-1.2.8/html/a.php
<?php
phpinfo();
?>
[iyunv@duwensql ~]#



效果图如下
QQ截图20160629100714.png

The End!



运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-236839-1-1.html 上篇帖子: Centos 6 编译安装LNMP 下篇帖子: CentOS 6.5安装LAMP+Redis+Security.so的整合
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表