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

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

作者: IT_man    時間: 2015-1-11 00:18
標題: Nginx + PHP-Fpm
《1》安裝nginx
. U5 B' _5 K4 { yum install nginx
% E$ Y' a9 o& K  [..........
, X2 ?. c. A: n& n& W7 WRunning Transaction# C% _4 Q* o! o& H' y$ _( p
  Installing : GeoIP-1.5.1-5.el6.x86_64                                               1/3
1 L* N/ ^0 y' C" H! ~% U9 e% n3 Z  Installing : nginx-filesystem-1.0.15-11.el6.noarch                                  2/3
4 z" G$ A9 }/ m5 k7 Z. ^4 n% \  Installing : nginx-1.0.15-11.el6.x86_64                                             3/3
, R/ d& |4 U- v' J  Verifying  : nginx-filesystem-1.0.15-11.el6.noarch                                  1/3
0 k) G6 E. e* L$ c, Y  Verifying  : nginx-1.0.15-11.el6.x86_64                                             2/35 |, V# |; z8 w& {8 r
  Verifying  : GeoIP-1.5.1-5.el6.x86_64                                               3/3: ]; c$ {7 U( L7 K4 G

2 S) @, ^' {% R4 [Installed:/ h  c+ y# ~- Q8 y: K
  nginx.x86_64 0:1.0.15-11.el6- }6 O5 e% V0 \; y
Dependency Installed:
* V- }2 i) P% i# w. \+ d0 J' Q  GeoIP.x86_64 0:1.5.1-5.el6            nginx-filesystem.noarch 0:1.0.15-11.el61 x! t& L+ ~, T; P
Complete!
! J4 |9 @% a. m% }' L+ P3 [: v
8 l9 L3 r0 d3 n: Y5 T2 B) N設定/etc/nginx/nginx.conf
0 y7 J+ ?$ `3 B, m5 D8 r2 Y
. w, U2 H, B$ F" f% O9 j
《2》安裝php-fpm: 參考http://www.av4u.info/thread-201-1-1.html
+ y$ x% e, ~  j: W( F4 t1 ]  X設定 /etc/php-fpm.d/www.conf  user and group  = nginx (default  apache)  ==> still error
0 `# w2 O! m+ b) X+ T& v; O% u. W' g; m; ~3 p, j  ]2 y. L
啟動php-fpm service php-fpm start
, `( M+ Q9 @6 X% u' O0 E啟動nginx      
service nginx start1 u5 t( V( |$ Q5 N/ m
結果
5 F* J* a; u1 e8 g0 y- v出現error :nginx:/usr/sbin/nginx: error while loading shared libraries: libgd.so.2: cannot open shared object file: No such file or directory
4 v7 h9 o* L8 g6 x5 ~& P, h! B# U6 Z: O
解決
! r" a8 l2 Y, p$ Z先找libgd.so.2 在何處(locate libgd.so.2*)
結果在/usr/lib64/libgd.backup所以cp /usr/lib64/libgd.backup/libgd.so.2*  /usr/lib64
$ ^  z1 i( R8 Z7 ~再一次啟動nginx
service nginx start) t. p$ u8 Z$ ?% Q1 P. T9 V2 _
結果nginx: [emerg] unknown directive "upload_progress" in /etc/nginx/nginx.conf:46
! i" f6 A; o( }  t1 U先查看nginx 的configure /usr/sbin/nginx -V
3 [- B; K0 h7 D% [& qnginx version: nginx/1.0.15& @) {6 l! ]& a  C. B7 \3 x
built by gcc 4.4.7 20120313 (Red Hat 4.4.7-11) (GCC)7 F$ n: b. _0 F6 \3 F# K3 y- A
TLS SNI support enabled

  S  K0 Q+ E7 A$ zconfigure 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- c! W- f+ f% f) u( o' g' G
. C, M2 P! M7 z0 ~. k/ h! }+ A8 c

* u- q0 A' m# w% C0 a8 Y啟動nginx       service nginx start   
) _9 E: z. N! `& S9 X1 N2 Merror :
% ^( Y5 r9 e7 l5 C3 mnginx: [emerg] open() "/etc/nginx/conf.d/db52av.52av.tv.conf" failed (13: Permission denied) in /etc/nginx/nginx.conf:40
/ M7 f0 k  I3 I+ [* q) m7 Enginx: configuration file /etc/nginx/nginx.conf test failed  f$ G. _/ S$ R( Z5 S6 z! b! M
解決
將/etc/sysconfig/selinux 內的 enforced  設成 disabled    then   reboot    就可以了; A; ?) a% ]3 M& P+ O
SELINUX =  enforcing    改成   disabled
' v- ]3 l" y5 I7 P( ~5 e& ~0 E

( M% L( }9 F$ h. v2 t
: d7 {, \1 }. n3 t5 I
! ]& S: F6 x  D  z8 [) b/ k' l
. {1 v3 v/ u( U" @9 o$ s5 c3 D





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