52AV手機A片王|52AV.ONE
標題:
Nginx + PHP-Fpm
[打印本頁]
作者:
IT_man
時間:
2015-1-11 00:18
標題:
Nginx + PHP-Fpm
《1》安裝nginx
" V0 X* d& z; b) ~" M' W
yum install nginx
( _& K* X; f: N+ K
..........
0 g @, v% E' |8 f7 z; J
Running Transaction
, M y) V. Z& g2 x
Installing : GeoIP-1.5.1-5.el6.x86_64 1/3
/ G! o! n2 c1 K; j+ {
Installing : nginx-filesystem-1.0.15-11.el6.noarch 2/3
8 T$ P3 q+ l5 k9 X/ @
Installing : nginx-1.0.15-11.el6.x86_64 3/3
) n3 a, D( K: k5 P
Verifying : nginx-filesystem-1.0.15-11.el6.noarch 1/3
2 J0 ?' f6 C8 f
Verifying : nginx-1.0.15-11.el6.x86_64 2/3
1 p$ z1 s5 S7 o) |7 E
Verifying : GeoIP-1.5.1-5.el6.x86_64 3/3
. [6 d8 L1 |/ @+ {6 T$ I; U
I) ^+ B9 o! n
Installed:
) F$ [9 ?9 s* x: B
nginx.x86_64 0:1.0.15-11.el6
9 q) u( Y6 W$ W" M, j& w! g1 ?- C
Dependency Installed:
9 m# {$ p+ G2 j0 {
GeoIP.x86_64 0:1.5.1-5.el6 nginx-filesystem.noarch 0:1.0.15-11.el6
/ y. q7 p4 h/ g' F& x# _
Complete!
2 b; V- X$ L" t% L
# L0 |* i+ _- q
設定/etc/nginx/nginx.conf
8 y) u+ f6 C# i/ l8 U" i( B
; H# b* H( s( p8 W m
《2》安裝php-fpm
: 參考
http://www.av4u.info/thread-201-1-1.html
7 ?. ^. u8 F4 d
設定 /etc/php-fpm.d/www.conf user and group = nginx (default apache) ==> still error
6 n+ c2 t7 R6 r( b2 b U& }: _6 i
' N& s) v8 B0 f) V% R5 i# k
啟動php-fpm
⇨
service php-fpm start
6 J' V, a0 ^5 w" t- Q
啟動nginx
⇨
service nginx start
5 E" d" j1 k6 H' l0 f
〖
結果
〗
:
3 K4 m" k1 x- @
出現error :nginx:/usr/sbin/nginx: error while loading shared libraries: libgd.so.2: cannot open shared object file: No such file or directory
% v" F7 c) ~; \/ ]1 c# X; Z
〖
解決
〗
:
' q# M8 s; L$ ]( {
先找libgd.so.2 在何處(locate libgd.so.2*)
,
結果在/usr/lib64/libgd.backup
,
所以cp
/usr/lib64/libgd.backup/
libgd.so.2* /usr/lib64
2 _9 d3 ~" @! O1 p0 N1 L* G8 P9 \8 [
再一次啟動nginx
⇨
service nginx start
$ v0 D# a0 K. Z: n3 n: v" S
〖
結果
〗
:
nginx: [emerg] unknown directive "upload_progress" in /etc/nginx/nginx.conf:46
# j5 B+ D/ N( F8 A
先查看nginx 的configure
⇨
/usr/sbin/nginx -V
p; |1 G% R7 w. X
nginx version: nginx/1.0.15
6 I; V, }! q5 g: F
built by gcc 4.4.7 20120313 (Red Hat 4.4.7-11) (GCC)
1 j. F$ X- Y. x6 Y% }3 y! f: n
TLS SNI support enabled
) a6 O3 A. k& }" a4 H
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
7 u1 ?) q/ H% W' W% Y$ ]
9 B+ a( M6 O8 D8 m1 T2 ~
! B: a! A3 C1 e* l4 A5 w$ j) f
啟動nginx
⇨
service nginx start
$ {0 L q! B5 v# H
error :
1 U. S9 W6 ^5 p& L
nginx: [emerg] open() "/etc/nginx/conf.d/db52av.52av.tv.conf" failed (13: Permission denied) in /etc/nginx/nginx.conf:40
/ L1 N. A( Z/ Y/ X- S; ^
nginx: configuration file /etc/nginx/nginx.conf test failed
9 Y# j5 u2 W4 f b
〖
解決
〗
:
將/etc/sysconfig/selinux 內的 enforced 設成 disabled then reboot 就可以了
3 l5 F0 S$ V& `1 B) v7 i
SELINUX = enforcing 改成
disabled
1 y8 `. x; r! O: w5 G9 {
3 `& }$ _: ?1 Q3 k( I* m6 s
# t" B# ^, I4 M
9 W2 d h- T9 ^/ L
l3 e& g3 f0 C
歡迎光臨 52AV手機A片王|52AV.ONE (https://www.itech.casa/)
Powered by Discuz! X3.2