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

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

作者: IT_man    時間: 2015-1-11 00:18
標題: Nginx + PHP-Fpm
《1》安裝nginx/ y% I3 i- _* c2 z
yum install nginx& P. y; f- [6 [6 C; n& I
..........0 r2 A1 t, F3 ~; C4 E+ O7 _+ `0 @
Running Transaction3 w, @& E/ ~' O2 Z5 a$ T7 M, `; T
  Installing : GeoIP-1.5.1-5.el6.x86_64                                               1/3
* X2 Y( R$ }  Q8 [7 g  Installing : nginx-filesystem-1.0.15-11.el6.noarch                                  2/38 Y; D( J1 R. g) r; u
  Installing : nginx-1.0.15-11.el6.x86_64                                             3/3, z" B# v1 u) U/ s! R9 i( q
  Verifying  : nginx-filesystem-1.0.15-11.el6.noarch                                  1/3
  ^2 B4 x! i' ^# e2 R5 Q  Verifying  : nginx-1.0.15-11.el6.x86_64                                             2/3# J' ^9 q& A) ?% M3 `- f
  Verifying  : GeoIP-1.5.1-5.el6.x86_64                                               3/3  H. i% @. D5 [" F' h6 `

4 w, o1 Z, E1 f; J$ k: L" [2 ?Installed:  g; [  o# Y4 g! d# U' r, _! o9 r
  nginx.x86_64 0:1.0.15-11.el6
6 \5 Z2 ^8 _- b7 s0 s6 s/ |9 pDependency Installed:
0 K9 b  }* f3 g/ Q3 r8 b  d  GeoIP.x86_64 0:1.5.1-5.el6            nginx-filesystem.noarch 0:1.0.15-11.el69 C( O# B' m- Z  k6 j
Complete!+ o5 y1 z6 w3 \8 b3 e" C

+ @% |7 \3 B( n2 v2 D設定/etc/nginx/nginx.conf

, M7 w( I5 {- x# Z9 q
& e1 T( W# r( S# t
《2》安裝php-fpm: 參考http://www.av4u.info/thread-201-1-1.html" c) b0 {0 N  A6 h# D' Z0 h
設定 /etc/php-fpm.d/www.conf  user and group  = nginx (default  apache)  ==> still error
) O' j( i0 x. R- u4 o2 s2 E8 H, ]# A6 T
啟動php-fpm service php-fpm start( c8 k4 B: F! @: p
啟動nginx      
service nginx start4 h6 R5 w1 L  `$ Q+ H$ k& e8 s8 I
結果8 ^2 M' l( F9 ]/ C
出現error :nginx:/usr/sbin/nginx: error while loading shared libraries: libgd.so.2: cannot open shared object file: No such file or directory

/ s$ t- ~! R. z  w; n解決1 X, n; a5 ~5 v
先找libgd.so.2 在何處(locate libgd.so.2*)
結果在/usr/lib64/libgd.backup所以cp /usr/lib64/libgd.backup/libgd.so.2*  /usr/lib64
3 g) |0 `$ F1 T% v; A再一次啟動nginx
service nginx start3 P  P8 C% ~; {
結果nginx: [emerg] unknown directive "upload_progress" in /etc/nginx/nginx.conf:46
" ?& s  P7 E! c$ y+ r" y" e/ O2 W先查看nginx 的configure /usr/sbin/nginx -V! E; K+ f" z% b# ]
nginx version: nginx/1.0.15( p) z' G5 _  M8 ~  m
built by gcc 4.4.7 20120313 (Red Hat 4.4.7-11) (GCC)
: Y' m# [9 V; S7 a) Y8 ]5 E  fTLS SNI support enabled
& l: z/ d- T) g2 s# z6 ^; _
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,-E8 Y  g' M: ]& ]6 b5 W: k2 H

5 k% c* _5 S6 m# s( g

) F, x* L6 E: Z" T' m啟動nginx       service nginx start   ) ?* Q0 ]& C. ^- H: }
error : * t3 X# x4 b  a! {3 `) O' ?
nginx: [emerg] open() "/etc/nginx/conf.d/db52av.52av.tv.conf" failed (13: Permission denied) in /etc/nginx/nginx.conf:40+ s" p3 G" |: U8 O
nginx: configuration file /etc/nginx/nginx.conf test failed  q9 z! @! B+ l6 B3 M- k
解決
將/etc/sysconfig/selinux 內的 enforced  設成 disabled    then   reboot    就可以了
8 b6 F0 [+ ]' ^1 q' U* ~1 XSELINUX =  enforcing    改成   disabled
4 N" i  X( a+ u, L/ Z3 l

8 |! @* |6 H7 E9 Y! P1 O/ B

% ~( w  k* C8 ~2 k1 N% X! S  s# @7 s

. g( |; _, z3 ?




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