52AV手機A片王|52AV.ONE
標題:
Nginx + PHP-Fpm
[打印本頁]
作者:
IT_man
時間:
2015-1-11 00:18
標題:
Nginx + PHP-Fpm
《1》安裝nginx
$ f8 j) T8 s9 t/ Z4 z, J
yum install nginx
$ E; `4 D% s7 Q
..........
{; n; }8 r- g1 d& ]5 s
Running Transaction
) b; e* d9 Y i' w
Installing : GeoIP-1.5.1-5.el6.x86_64 1/3
7 _% N5 `2 F& a
Installing : nginx-filesystem-1.0.15-11.el6.noarch 2/3
9 U1 }* k8 G6 ]0 d% {. f: \4 {: z$ o
Installing : nginx-1.0.15-11.el6.x86_64 3/3
+ s3 [8 U, i% f
Verifying : nginx-filesystem-1.0.15-11.el6.noarch 1/3
& @/ E% g8 H' w& X
Verifying : nginx-1.0.15-11.el6.x86_64 2/3
4 A. \) \$ u; W' r2 u
Verifying : GeoIP-1.5.1-5.el6.x86_64 3/3
, p4 s1 j, ?$ c( \2 k U+ H
! f: c' }8 D/ _+ S- H1 Q
Installed:
9 I) R7 r# D- o) [
nginx.x86_64 0:1.0.15-11.el6
# R( c# ]4 f' a. ?
Dependency Installed:
7 V2 N" I4 J6 O/ e
GeoIP.x86_64 0:1.5.1-5.el6 nginx-filesystem.noarch 0:1.0.15-11.el6
7 C1 ?& n% ]0 X3 q
Complete!
+ `! N/ _" B9 J8 y
8 ] c4 C/ n1 _7 D7 Q
設定/etc/nginx/nginx.conf
' c7 z" o8 n& O6 D
% W7 J1 Z, n" @, R
《2》安裝php-fpm
: 參考
http://www.av4u.info/thread-201-1-1.html
8 p& f) q. m+ F4 i* N4 W5 |
設定 /etc/php-fpm.d/www.conf user and group = nginx (default apache) ==> still error
1 ?. B, G8 y3 q0 t6 W! s3 O8 F+ I
+ P+ o! v/ G4 R: r( k& w* f
啟動php-fpm
⇨
service php-fpm start
4 P& y" u `& y0 V5 ?* p- W
啟動nginx
⇨
service nginx start
, [, J' d5 M" \ ]' d
〖
結果
〗
:
* I2 j& r' J1 l% [6 T! `
出現error :nginx:/usr/sbin/nginx: error while loading shared libraries: libgd.so.2: cannot open shared object file: No such file or directory
$ P' U; `6 W5 m; R' m: D- p
〖
解決
〗
:
3 U9 {6 R! u& O: c! `, J
先找libgd.so.2 在何處(locate libgd.so.2*)
,
結果在/usr/lib64/libgd.backup
,
所以cp
/usr/lib64/libgd.backup/
libgd.so.2* /usr/lib64
; t* U e1 p7 u. {1 Q
再一次啟動nginx
⇨
service nginx start
# j f, @& a$ Z4 }/ D2 t3 c- x$ {
〖
結果
〗
:
nginx: [emerg] unknown directive "upload_progress" in /etc/nginx/nginx.conf:46
2 |' ]7 I# j% S0 O; [: m+ @ i' I
先查看nginx 的configure
⇨
/usr/sbin/nginx -V
; _) w5 r8 i- i" s8 V, V4 z8 K8 W0 H# p* I
nginx version: nginx/1.0.15
" l* `* ]# \) E' U) I
built by gcc 4.4.7 20120313 (Red Hat 4.4.7-11) (GCC)
& z9 v9 ~9 K9 v4 }+ I
TLS SNI support enabled
$ N5 I, k" } G; e
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 t* ~- D r- F/ {8 y
, U2 C2 @2 X1 B( |- ?( k, o$ m
* t m1 `" z, d! q6 W
啟動nginx
⇨
service nginx start
- c: F" G) a( K' k6 I
error :
- l! A; }: d5 ]2 O$ c
nginx: [emerg] open() "/etc/nginx/conf.d/db52av.52av.tv.conf" failed (13: Permission denied) in /etc/nginx/nginx.conf:40
% _: i+ `6 c s8 m" U0 |
nginx: configuration file /etc/nginx/nginx.conf test failed
; s3 A8 i3 G9 j: {7 v/ [" Y
〖
解決
〗
:
將/etc/sysconfig/selinux 內的 enforced 設成 disabled then reboot 就可以了
6 h- I ~' C1 E
SELINUX = enforcing 改成
disabled
1 q N! e$ O* L1 d- ~6 X
$ J8 Q# f6 P1 X
T; Y" x0 w/ d- p% x* W
. l* V* M( G% `5 x& G# \
: Z9 U9 T; T0 d ^$ i* \
歡迎光臨 52AV手機A片王|52AV.ONE (https://www.52av.one/)
Powered by Discuz! X3.2