52AV手機A片王|52AV.ONE
標題:
Nginx + PHP-Fpm
[打印本頁]
作者:
IT_man
時間:
2015-1-11 00:18
標題:
Nginx + PHP-Fpm
《1》安裝nginx
! s4 t5 N2 w( Y" C# E
yum install nginx
) S1 w# A+ C- T( ~! f
..........
s. P# g* P( [0 _7 G
Running Transaction
' P% U0 p% \: e: [+ a* A! e
Installing : GeoIP-1.5.1-5.el6.x86_64 1/3
0 P0 N; R8 @0 V3 M
Installing : nginx-filesystem-1.0.15-11.el6.noarch 2/3
, h0 G0 }$ m3 o+ w( }: z; T
Installing : nginx-1.0.15-11.el6.x86_64 3/3
1 ~; s9 O+ S$ _6 }4 i! y
Verifying : nginx-filesystem-1.0.15-11.el6.noarch 1/3
- L7 i2 x# W: _2 A( W7 A7 \
Verifying : nginx-1.0.15-11.el6.x86_64 2/3
: h$ ~: r! {9 Q* x
Verifying : GeoIP-1.5.1-5.el6.x86_64 3/3
2 `7 H$ V+ J0 J3 P/ h2 @4 F( q y' D
# j ^& x9 ?! H) u5 l, [, ^' g
Installed:
% Z- V2 s; T* Q$ G$ y1 ^! N
nginx.x86_64 0:1.0.15-11.el6
0 `& G8 J J: ~# a5 s* p" F
Dependency Installed:
* e8 y9 F$ E$ z$ w: n6 V( I
GeoIP.x86_64 0:1.5.1-5.el6 nginx-filesystem.noarch 0:1.0.15-11.el6
& l/ p. v" @; ~) B0 x
Complete!
s W6 k1 P9 Y+ z* V+ |5 g# s* x
# ?* v3 W. k1 l/ d( R
設定/etc/nginx/nginx.conf
& T0 r) n$ N- G2 N$ U. s9 B* P
5 ~) p3 `3 s5 v6 `3 w
《2》安裝php-fpm
: 參考
http://www.av4u.info/thread-201-1-1.html
5 |6 F% k% D+ m6 x
設定 /etc/php-fpm.d/www.conf user and group = nginx (default apache) ==> still error
( u9 D- q, t S6 |7 o4 t
l- }/ I0 w+ ]5 r& `
啟動php-fpm
⇨
service php-fpm start
: Z: [, U& X2 X$ n, K# u, K- A
啟動nginx
⇨
service nginx start
5 o0 g/ j; P* Z. v% @
〖
結果
〗
:
+ @: _8 e3 `+ W Q
出現error :nginx:/usr/sbin/nginx: error while loading shared libraries: libgd.so.2: cannot open shared object file: No such file or directory
- ?: `5 Y6 e6 w% H8 U
〖
解決
〗
:
. f" x( F8 s3 }) e% j
先找libgd.so.2 在何處(locate libgd.so.2*)
,
結果在/usr/lib64/libgd.backup
,
所以cp
/usr/lib64/libgd.backup/
libgd.so.2* /usr/lib64
6 p: H" x2 R; ]5 v- o6 O
再一次啟動nginx
⇨
service nginx start
7 H6 I1 r4 @; L
〖
結果
〗
:
nginx: [emerg] unknown directive "upload_progress" in /etc/nginx/nginx.conf:46
4 P! i4 Z) e2 O
先查看nginx 的configure
⇨
/usr/sbin/nginx -V
. ?7 \6 H2 m% H: e8 X: g \
nginx version: nginx/1.0.15
( L/ D$ E4 Q1 a$ Z5 G5 e
built by gcc 4.4.7 20120313 (Red Hat 4.4.7-11) (GCC)
( s6 x8 F/ r* }2 n0 P
TLS SNI support enabled
) |5 H1 \ ~1 s% j; a) o% g
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
) [: Y6 J* l5 D6 [7 r: d
8 q3 `- f6 K1 l4 p" D
: e! z. p7 l: k: C$ g3 w5 a
啟動nginx
⇨
service nginx start
5 S0 l4 n2 G( }2 D; R+ ^& V6 x
error :
1 U' ^ @/ z5 o
nginx: [emerg] open() "/etc/nginx/conf.d/db52av.52av.tv.conf" failed (13: Permission denied) in /etc/nginx/nginx.conf:40
$ [8 m: F4 Q7 N$ J, R
nginx: configuration file /etc/nginx/nginx.conf test failed
' Y( d; a, e, d" q' b
〖
解決
〗
:
將/etc/sysconfig/selinux 內的 enforced 設成 disabled then reboot 就可以了
6 {. A& w6 E: A3 \ l
SELINUX = enforcing 改成
disabled
0 ~, Y* F& i1 l! J( g) r% a) K* o
1 M, l; B0 \1 p! G' i/ X- U
; ?. H0 Y2 A _4 v5 _
& |+ [1 H5 S2 ], a3 R
* n* U# L, f; a" v$ n
歡迎光臨 52AV手機A片王|52AV.ONE (https://www.52av23.xyz/)
Powered by Discuz! X3.2