52AV手機A片王|52AV.ONE

標題: Nginx + PHP-Fpm [打印本頁]

作者: IT_man    時間: 2015-1-11 00:18
標題: Nginx + PHP-Fpm
《1》安裝nginx) K( Y/ t* H- V% H& {" |! e# z; V
yum install nginx# R3 }* q8 X% u! W) }  F
..........' v/ L( s! i8 g, z' t1 M
Running Transaction; P- s$ [' O3 S/ x
  Installing : GeoIP-1.5.1-5.el6.x86_64                                               1/3& ^, k- |! C" v/ [
  Installing : nginx-filesystem-1.0.15-11.el6.noarch                                  2/3
  Z9 t9 S* S3 ]/ O* \  Installing : nginx-1.0.15-11.el6.x86_64                                             3/3
  l/ h, Q# I) o, [  e6 i* p3 ^- k  Verifying  : nginx-filesystem-1.0.15-11.el6.noarch                                  1/3/ Y9 ?% f/ X1 e/ e5 A, q9 ^
  Verifying  : nginx-1.0.15-11.el6.x86_64                                             2/3
/ d! A/ d. k- n  Verifying  : GeoIP-1.5.1-5.el6.x86_64                                               3/3, t( _: x# p0 K! E
+ F. G. l: A. W
Installed:
& D2 U' c2 J0 @  nginx.x86_64 0:1.0.15-11.el6
0 J5 s7 ^' |' s' a9 R% S! s) q# QDependency Installed:
, e  c- |$ n, x; o( h  GeoIP.x86_64 0:1.5.1-5.el6            nginx-filesystem.noarch 0:1.0.15-11.el6! C7 X# c  B( l7 ]# O
Complete!
1 ^  C+ ]4 u% a) D( Q' [% K3 _/ o& V
) k3 E6 c: L: Z設定/etc/nginx/nginx.conf

) z) ], u  Q5 o- C
4 V" @- n  E# d- C- n* G3 t8 D
《2》安裝php-fpm: 參考http://www.av4u.info/thread-201-1-1.html
( a7 i" z4 W3 Z- ]( |設定 /etc/php-fpm.d/www.conf  user and group  = nginx (default  apache)  ==> still error
( q, ^7 H7 w7 j. w& Y9 z
5 {+ L7 i0 l! Y% z* [2 b0 N
啟動php-fpm service php-fpm start4 N2 s/ K' a9 |( \$ r5 s
啟動nginx      
service nginx start  C" O4 K( @$ S: {0 ]$ g
結果
6 Y( V6 N; \. U4 j1 ?; T出現error :nginx:/usr/sbin/nginx: error while loading shared libraries: libgd.so.2: cannot open shared object file: No such file or directory
! ?2 C! M( |2 ^% c( A( Z
解決% ~5 ]0 s6 w% Y8 ~5 }) `' f" {7 C
先找libgd.so.2 在何處(locate libgd.so.2*)
結果在/usr/lib64/libgd.backup所以cp /usr/lib64/libgd.backup/libgd.so.2*  /usr/lib64- m5 ~" z% E5 E% {; N
再一次啟動nginx
service nginx start
  ]$ d8 H. E. x+ `. I/ D2 A; K
結果nginx: [emerg] unknown directive "upload_progress" in /etc/nginx/nginx.conf:46
# @5 l0 Q  y! B" [% D5 c: e4 Z先查看nginx 的configure /usr/sbin/nginx -V+ D8 N9 W' R7 s  m$ u9 A
nginx version: nginx/1.0.15* ~) Z" n+ w3 |; d3 V" p: F" S
built by gcc 4.4.7 20120313 (Red Hat 4.4.7-11) (GCC)
# b/ n1 d" Y. ?6 W+ ?8 gTLS SNI support enabled
  F  U  E( B1 @" s; d# Q
configure arguments: --prefix=/usr/share/nginx --sbin-path=/usr/sbin/nginx --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --http-client-body-temp-path=/var/lib/nginx/tmp/client_body --http-proxy-temp-path=/var/lib/nginx/tmp/proxy --http-fastcgi-temp-path=/var/lib/nginx/tmp/fastcgi --http-uwsgi-temp-path=/var/lib/nginx/tmp/uwsgi --http-scgi-temp-path=/var/lib/nginx/tmp/scgi --pid-path=/var/run/nginx.pid --lock-path=/var/lock/subsys/nginx --user=nginx --group=nginx --with-file-aio --with-ipv6 --with-http_ssl_module --with-http_realip_module --with-http_addition_module --with-http_xslt_module --with-http_image_filter_module --with-http_geoip_module --with-http_sub_module --with-http_dav_module --with-http_flv_module --with-http_mp4_module --with-http_gzip_static_module --with-http_random_index_module --with-http_secure_link_module --with-http_degradation_module --with-http_stub_status_module --with-http_perl_module --with-mail --with-mail_ssl_module --with-debug --with-cc-opt='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic' --with-ld-opt=-Wl,-E( z3 }, Q$ b+ W8 u

9 [( I( E8 H* S' [9 a0 T3 Q! R. r
8 E. Q' U2 {) y: y1 J& `) R; `4 E4 _
啟動nginx       service nginx start   % r5 g, M+ Q  u3 R1 U6 t; W5 H7 L
error :
2 G$ ]6 Y: L% d' ]0 K8 N! Lnginx: [emerg] open() "/etc/nginx/conf.d/db52av.52av.tv.conf" failed (13: Permission denied) in /etc/nginx/nginx.conf:40( _0 M% m6 c* J* ]% m$ s1 g& n( X
nginx: configuration file /etc/nginx/nginx.conf test failed4 i. u# s& r! b5 T" P
解決
將/etc/sysconfig/selinux 內的 enforced  設成 disabled    then   reboot    就可以了- h3 m& h1 i% ?9 Z
SELINUX =  enforcing    改成   disabled " X5 ~# S8 S  k+ ?  S. V6 A% Q- G

8 `% A6 l5 q: f' @

* U/ g0 r6 y4 c. v! T8 e! O' S
# ?$ k% J0 f0 ~+ j5 [' ^
2 r% M( b7 Z+ |, v( A




歡迎光臨 52AV手機A片王|52AV.ONE (https://www.52av.one/) Powered by Discuz! X3.2