• 960阅读
  • 1回复

在Linux系统中安装LNMP出现的错误总结

楼层直达
1.安装nginx软件出现的错误 O8f?; ]  
LmRy1T,act  
collect2: ld returned 1 exit status SbcS]H5Sk  
make[1]: *** [objs/nginx] Error 1  ''|W9!  
make[1]: Leaving directory `/root/nginx-1.3.13' u]:oZMnj  
make: *** [build] Error 2 ] ;KJ6  
[root@centos nginx-1.3.13]# GL&y@6  
6=kEyJT'  
解决方法: >3ZFzh&OYQ  
qjwxhabc  
[root@centos nginx-1.3.13]# yum install pcre-* y~(h>gi,x  
[root@centos nginx-1.3.13]# ./configure --user=nginx --group=nginx \ U1Q:= yD  
--with-pcre  --without-http_gzip_module \ \1d (9jR  
--without-http_rewrite_module --without-http_proxy_module \ Q[Z8ok  
--without-http_upstream_ip_hash_module \ v/@^Q1 G/:  
--without-http_upstream_least_conn_module \ zofa-7'Bn  
--without-http_upstream_keepalive_module \ `CBZhI%%  
--with-http_stub_status_module --with-http_flv_module \ ,k.3|aZE  
--with-http_mp4_module &\#sI9  
fJ5iS  
测试: Q`~jw>x  
]99|KQ<s  
[root@centos nginx-1.3.13]# H  >j  
..................................... i=ea ?eT`  
-e "s|%%ERROR_LOG_PATH%%|/usr/local/nginx/logs/error.log|" \ C'G/AU  
< man/nginx.8 > objs/nginx.8 VQ"hUX8  
make[1]: Leaving directory `/root/nginx-1.3.13' XQ#;Zs/l  
[root@centos nginx-1.3.13]# echo $?      --没有错误 aL*&r~`&e'  
0 eds o2  
[root@centos nginx-1.3.13]# 3Ko/{f  
G(Lzf(  
bT\1>  
_?<|{O  
2.安装php出现对mysql的错误 5BWH-2HsB  
vY4\59]P  
./configure --prefix=/usr/local/php5.2.17   --enable-fpm  \ mi ik%7>W  
--enable-dba --enable-ftp  --with-gd  \ 5*E]ETo@R  
--with-jpeg-dir --with-png-dir  --with-ldap  \ zxMX Xm;  
--enable-mbstring   --with-mysql=/usr/local/mysql5.0/  \ 7_%"BVb"  
--with-mysqli=/usr/local/mysql5.0/bin/mysql_config   \ =V-A@_^!c  
--with-ncurses  --with-pdo-mysql --with-snmp  --enable-zip Z&#('Z  
........................................................................ B&\IGWG(  
checking whether to enable PDO support... yes Z?}dq-Vh&  
checking for PDO_DBLIB support via FreeTDS... no >go,K{cK6  
checking for Firebird support for PDO... no `rgn<I"  
checking for MySQL support for PDO... yes .>CPRVuVI  
checking for mysql_config... not found !HrKXy 0{  
configure: error: Cannot find MySQL header files under    --错误结果 t5[ #x4 p  
`JOOnTenQ  
解决方法(没有mysql头文件): 2-7IJ\  
IHe/xQ@  
[root@centos bin]# yum install mysql-devel    --安装这个软件就可以了 ~$ng^D  
O]lSWEe  
18~>ZR  
#i@;J]x(  
3.启动php-fpm服务失败 0KYEb%44  
IAYR+c  
[root@centos php-5.2.17]# /usr/local/php5.2.17/sbin/php-fpm start }v Z+A  
Starting php_fpm Error in argument 1, char 1: no argument for option - W{%TlN  
Usage: php-cgi [-q] [-h] [-s] [-v] [-i] [-f <file>] n1JRDw"e$$  
php-cgi <file> [args...] /]=C{)8  
-a               Run interactively TatpXN\  
-C               Do not chdir to the script's directory [K9'<Qnu  
-c <path>|<file> Look for php.ini file in this directory n1~o1  
-n               No php.ini file will be used fBalTk;G{U  
-d foo[=bar]     Define INI entry foo with value 'bar' '$|[R98  
-e               Generate extended information for debugger/profiler ~p1j`r;  
-f <file>        Parse <file>.  Implies `-q' |UK}  
-h               This help S/^"@?z,vE  
-i               PHP information {U!8|(  
-l               Syntax check only (lint) ZT,B(#m  
-m               Show compiled in modules '`eO\huf  
-q               Quiet-mode.  Suppress HTTP Header output. "ul {d(K3  
-s               Display colour syntax highlighted source. q8^^H$<Db  
-v               Version number X=hYB}}nu  
-w               Display source with stripped comments and whitespace. RnhL< Ywu  
-z <file>        Load Zend extension <file>. Ys@}3\Mc  
................................... failed %;e/7`>Ma  
[root@centos php-5.2.17]# I 4,K43|  
c:-!'l$ !  
解决方法: x/;buW-  
JS*m65e  
只看该作者 安逸沙发  发表于: 2019-10-16
4.nginx和php-fpm服务启动正常,测试页打不开 p0KkPE">p4  
$B6"fYiDk  
[root@node2 conf]# netstat -anp |grep -E 'nginx|php-fpm'  [69[Ct  
tcp        0      0 0.0.0.0:80                  0.0.0.0:*                   LISTEN      24328/nginx 5Rv6+d  
tcp        0      0 127.0.0.1:9000              0.0.0.0:*                   LISTEN      23844/php-fpm.conf) *E<%db C2  
unix  3      [ ]         STREAM     CONNECTED     2421896 24328/nginx G>?hojvi  
unix  3      [ ]         STREAM     CONNECTED     2421895 24328/nginx 8&6h()  
unix  3      [ ]         STREAM     CONNECTED     2420554 23844/php-fpm.conf) O a_2J#~$  
unix  3      [ ]         STREAM     CONNECTED     2420553 23844/php-fpm.conf) sXzxEhp  
[root@node2 conf]# Le9^,B@Pb  
r5qp[Ss3F  
wKioL1Nfc92B2fVZAAJTu4RWgnI287.jpg x+zz:^yHYf  
AZ)H/#be  
解决方法: p=U*4[9k  
fX).A`  
[root@node2 sbin]# vim ../conf/nginx.conf G#ov2  
fastcgi_param  SCRIPT_FILENAME   /scripts$fastcgi_script_name; :E/]Bjq$;  
修改为 Hm|8ydNs  
fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name; Rh-e C6P  
[root@node2 sbin]# killall nginx 7aVQp3<  
[root@node2 sbin]# ./nginx >Ha tb bA  
T]d9tX-  
wKiom1NfdH2A8onKAANqa8R_lMM740.jpg Z@fMU2e=Z  
q"OvuHBSOn  
R]e?<,"X  
RiC1lCE  
5.缺少依赖包(postgresql-devel) _p/ _t76s  
O,"4HZG  
2013-11-24 15:08 p9k' .H^:_  
configure: error: Cannot find libpq-fe.h. Please specify correct PostgreSQL installation path ,)3%@MwO  
wP.b2X_V  
解决方法 B2Qt tcJ  
rf_(pp)  
yum install postgresql-devel <&:OSd:%  
lB9 9J"A  
vZ[wr@)  
+6tj w 6  
6.启动nginx报错( [emerg]: unknown directive "fastcgi_pass" in /opt/nginx/conf/nginx.conf:67) 1sgI,5liUs  
K*^3FO}JG  
[root@localhost conf]# ../sbin/nginx rw(EI,G  
[emerg]: unknown directive "fastcgi_pass"in /opt/nginx/conf/nginx.conf:67) 34S0W]V  
[root@localhost conf]# -?L~\WJAL  
PhTMXv<cE  
解决方法: s`Z | A  
2wR?ON=Q  
在配置,安装nginx时不要加--without-http_fastcgi_module选项 V0 70oZ  
GH ] c  
66ULR&D8  
RLl*@SEi"  
7.启动nginx报错(nginx: [emerg] unknown directive "proxy_pass"in /usr/local/tong/nginx/ .d mUh-  
@`"U D  
conf/nginx.conf:55) 9BW"^$  
G,o5JL"t  
[root@localhost conf]# ../sbin/nginx 4Wsp PHj  
nginx: [emerg] unknown directive "proxy_pass" in /usr/local/tong/nginx/conf/nginx.conf:55 n:dnBwY  
[root@localhost conf]# lqaOLZH  
&Ul8h,qw  
解决方法: Twq/Y07M  
2g0_[$[m  
在配置,安装nginx时不要加 --without-http_proxy_module选项 `2 6t+Tb  
>]dH1@@  
 =&8Cg  
1iLrKA  
8.启动nginx报错(nginx: [emerg] unknown directive "gzip" in /usr/local/tong/nginx/conf/nginx.conf:33) *'l|ws  
*@+E82D  
[root@localhost conf]# ../sbin/nginx Mp-hNO}.Z  
nginx: [emerg] unknown directive "gzip" in /usr/local/tong/nginx/conf/nginx.conf:33 ,#V }qSKUS  
[root@localhost conf]# k`(Cwp{Oc  
IIh \ d.o  
解决方法: W ])Lc3X  
:iEIo7B  
在配置,安装nginx时不要加--without-http_gzip_module选项 ehTRw8"R  
!+o`,KTYp  
2~B9 (|  
v!WkPvU  
转载于:https://blog.51cto.com/tongcheng/1371466
快速回复

限100 字节
安逸网提示:如果您提交过一次失败了,可以用”恢复数据”来恢复帖子内容
 
认证码:
上一个 下一个