IT_man 發表於 2015-1-11 00:18:11

Nginx + PHP-Fpm

《1》安裝nginx
yum install nginx
..........
Running Transaction
Installing : GeoIP-1.5.1-5.el6.x86_64                                             1/3
Installing : nginx-filesystem-1.0.15-11.el6.noarch                                  2/3
Installing : nginx-1.0.15-11.el6.x86_64                                             3/3
Verifying: nginx-filesystem-1.0.15-11.el6.noarch                                  1/3
Verifying: nginx-1.0.15-11.el6.x86_64                                             2/3
Verifying: GeoIP-1.5.1-5.el6.x86_64                                             3/3

Installed:
nginx.x86_64 0:1.0.15-11.el6
Dependency Installed:
GeoIP.x86_64 0:1.5.1-5.el6            nginx-filesystem.noarch 0:1.0.15-11.el6
Complete!

設定/etc/nginx/nginx.conf

《2》安裝php-fpm: 參考http://www.av4u.info/thread-201-1-1.html
設定 /etc/php-fpm.d/www.confuser and group= nginx (defaultapache)==> still error

啟動php-fpm ⇨ service php-fpm start
啟動nginx       ⇨ service nginx start
〖結果〗:
出現error :nginx:/usr/sbin/nginx: error while loading shared libraries: libgd.so.2: cannot open shared object file: No such file or directory
〖解決〗:
先找libgd.so.2 在何處(locate libgd.so.2*),結果在/usr/lib64/libgd.backup,所以cp /usr/lib64/libgd.backup/libgd.so.2*/usr/lib64
再一次啟動nginx ⇨ service nginx start
〖結果〗:nginx: unknown directive "upload_progress" in /etc/nginx/nginx.conf:46
先查看nginx 的configure ⇨ /usr/sbin/nginx -V
nginx version: nginx/1.0.15
built by gcc 4.4.7 20120313 (Red Hat 4.4.7-11) (GCC)
TLS SNI support enabled
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


啟動nginx       ⇨ service nginx start   
error :
nginx: open() "/etc/nginx/conf.d/db52av.52av.tv.conf" failed (13: Permission denied) in /etc/nginx/nginx.conf:40
nginx: configuration file /etc/nginx/nginx.conf test failed
〖解決〗:將/etc/sysconfig/selinux 內的 enforced設成 disabled    then   reboot    就可以了
SELINUX =enforcing    改成   disabled




頁: [1]
查看完整版本: Nginx + PHP-Fpm