1.安装nginx软件出现的错误
collect2: ld returned 1 exit status
make[1]: *** [objs/nginx] Error 1
make[1]: Leaving directory `/root/nginx-1.3.13'
make: *** [build] Error 2
[root@centos nginx-1.3.13]#
解决方法:
[root@centos nginx-1.3.13]# yum install pcre-*
[root@centos nginx-1.3.13]# ./configure --user=nginx --group=nginx \
--with-pcre --without-http_gzip_module \
--without-http_rewrite_module --without-http_proxy_module \
--without-http_upstream_ip_hash_module \
--without-http_upstream_least_conn_module \
--without-http_upstream_keepalive_module \
--with-http_stub_status_module --with-http_flv_module \
--with-http_mp4_module
测试:
[root@centos nginx-1.3.13]#
.....................................
-e "s|%%ERROR_LOG_PATH%%|/usr/local/nginx/logs/error.log|" \
< man/nginx.8 > objs/nginx.8
make[1]: Leaving directory `/root/nginx-1.3.13'
[root@centos nginx-1.3.13]# echo $? --没有错误
0
[root@centos nginx-1.3.13]#
2.安装php出现对mysql的错误
./configure --prefix=/usr/local/php5.2.17 --enable-fpm \
--enable-dba --enable-ftp --with-gd \
--with-jpeg-dir --with-png-dir --with-ldap \
--enable-mbstring --with-mysql=/usr/local/mysql5.0/ \
--with-mysqli=/usr/local/mysql5.0/bin/mysql_config \
--with-ncurses --with-pdo-mysql --with-snmp --enable-zip
........................................................................
checking whether to enable PDO support... yes
checking for PDO_DBLIB support via FreeTDS... no
checking for Firebird support for PDO... no
checking for MySQL support for PDO... yes
checking for mysql_config... not found
configure: error: Cannot find MySQL header files under --错误结果
解决方法(没有mysql头文件):
[root@centos bin]# yum install mysql-devel --安装这个软件就可以了
3.启动php-fpm服务失败
[root@centos php-5.2.17]# /usr/local/php5.2.17/sbin/php-fpm start
Starting php_fpm Error in argument 1, char 1: no argument for option -
Usage: php-cgi [-q] [-h] [-s] [-v] [-i] [-f <file>]
php-cgi <file> [args...]
-a Run interactively
-C Do not chdir to the script's directory
-c <path>|<file> Look for php.ini file in this directory
-n No php.ini file will be used
-d foo[=bar] Define INI entry foo with value 'bar'
-e Generate extended information for debugger/profiler
-f <file> Parse <file>. Implies `-q'
-h This help
-i PHP information
-l Syntax check only (lint)
-m Show compiled in modules
-q Quiet-mode. Suppress HTTP Header output.
-s Display colour syntax highlighted source.
-v Version number
-w Display source with stripped comments and whitespace.
-z <file> Load Zend extension <file>.
................................... failed
[root@centos php-5.2.17]#
解决方法:
4.nginx和php-fpm服务启动正常,测试页打不开
[root@node2 conf]# netstat -anp |grep -E 'nginx|php-fpm'
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 24328/nginx
tcp 0 0 127.0.0.1:9000 0.0.0.0:* LISTEN 23844/php-fpm.conf)
unix 3 [ ] STREAM CONNECTED 2421896 24328/nginx
unix 3 [ ] STREAM CONNECTED 2421895 24328/nginx
unix 3 [ ] STREAM CONNECTED 2420554 23844/php-fpm.conf)
unix 3 [ ] STREAM CONNECTED 2420553 23844/php-fpm.conf)
[root@node2 conf]#
解决方法:
[root@node2 sbin]# vim ../conf/nginx.conf
fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
修改为
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
[root@node2 sbin]# killall nginx
[root@node2 sbin]# ./nginx
5.缺少依赖包(postgresql-devel)
2013-11-24 15:08
configure: error: Cannot find libpq-fe.h. Please specify correct PostgreSQL installation path
解决方法
yum install postgresql-devel
6.启动nginx报错( [emerg]: unknown directive "fastcgi_pass" in /opt/nginx/conf/nginx.conf:67)
[root@localhost conf]# ../sbin/nginx
[emerg]: unknown directive "fastcgi_pass"in /opt/nginx/conf/nginx.conf:67)
[root@localhost conf]#
解决方法:
在配置,安装nginx时不要加--without-http_fastcgi_module选项
7.启动nginx报错(nginx: [emerg] unknown directive "proxy_pass"in /usr/local/tong/nginx/
conf/nginx.conf:55)
[root@localhost conf]# ../sbin/nginx
nginx: [emerg] unknown directive "proxy_pass" in /usr/local/tong/nginx/conf/nginx.conf:55
[root@localhost conf]#
解决方法:
在配置,安装nginx时不要加 --without-http_proxy_module选项
8.启动nginx报错(nginx: [emerg] unknown directive "gzip" in /usr/local/tong/nginx/conf/nginx.conf:33)
[root@localhost conf]# ../sbin/nginx
nginx: [emerg] unknown directive "gzip" in /usr/local/tong/nginx/conf/nginx.conf:33
[root@localhost conf]#
解决方法:
在配置,安装nginx时不要加--without-http_gzip_module选项