• 959阅读
  • 1回复

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

楼层直达
1.安装nginx软件出现的错误 O$X^Ea7~  
{Rn*)D9  
collect2: ld returned 1 exit status #)4p ,H  
make[1]: *** [objs/nginx] Error 1 umt(e:3f5  
make[1]: Leaving directory `/root/nginx-1.3.13' @XVx{t;g2  
make: *** [build] Error 2 f;!L\$yKy  
[root@centos nginx-1.3.13]# Gn;^]8d  
C|]Zpn#{K  
解决方法:  p4P"U  
&UAYYH  
[root@centos nginx-1.3.13]# yum install pcre-* h~ q5GhY!9  
[root@centos nginx-1.3.13]# ./configure --user=nginx --group=nginx \ \"d\b><R  
--with-pcre  --without-http_gzip_module \ >AWWwq -  
--without-http_rewrite_module --without-http_proxy_module \ DIgur}q)@  
--without-http_upstream_ip_hash_module \ u ^M'[<{  
--without-http_upstream_least_conn_module \ \)W Z D  
--without-http_upstream_keepalive_module \ 0Y8Cz/$  
--with-http_stub_status_module --with-http_flv_module \ 4W=fQx]  
--with-http_mp4_module _jaB[Q=By  
Q1(4l?X@  
测试:  xF*i+'2  
xdMY2u  
[root@centos nginx-1.3.13]# k{bC3)'$#R  
..................................... XJ1Bl  
-e "s|%%ERROR_LOG_PATH%%|/usr/local/nginx/logs/error.log|" \ Sx1OY0)s  
< man/nginx.8 > objs/nginx.8 BC#O.93`  
make[1]: Leaving directory `/root/nginx-1.3.13' xRZ/[1f!  
[root@centos nginx-1.3.13]# echo $?      --没有错误 u[nLrEnD  
0 QkYKm<b  
[root@centos nginx-1.3.13]# At&kW3(  
< Yc)F.:  
D58RHgY[  
yi2F#o 'K  
2.安装php出现对mysql的错误 gw$?&[wY  
]1M Z:]k  
./configure --prefix=/usr/local/php5.2.17   --enable-fpm  \ 1?G%&X@ X  
--enable-dba --enable-ftp  --with-gd  \ t_+owiF)M  
--with-jpeg-dir --with-png-dir  --with-ldap  \ lHE \Z`  
--enable-mbstring   --with-mysql=/usr/local/mysql5.0/  \ ZuKOscVS#T  
--with-mysqli=/usr/local/mysql5.0/bin/mysql_config   \ ;WgzR_'!'  
--with-ncurses  --with-pdo-mysql --with-snmp  --enable-zip PJ,G_+b!  
........................................................................ B;nIKZ  
checking whether to enable PDO support... yes +jO#?J  
checking for PDO_DBLIB support via FreeTDS... no &PX!'%X68h  
checking for Firebird support for PDO... no u/xP$  
checking for MySQL support for PDO... yes C8=rsh  
checking for mysql_config... not found 9t8ccr  
configure: error: Cannot find MySQL header files under    --错误结果 ~*`wRiUhis  
),$^h7[n  
解决方法(没有mysql头文件): h!tg+9%  
|)mUO:*  
[root@centos bin]# yum install mysql-devel    --安装这个软件就可以了 #%{  
~+PKWs'}F  
rddn"~lm1  
M7#CMLy  
3.启动php-fpm服务失败 -CALU X  
[q^pMH#U"  
[root@centos php-5.2.17]# /usr/local/php5.2.17/sbin/php-fpm start ob/HO (h3  
Starting php_fpm Error in argument 1, char 1: no argument for option - ~/Y8wxg  
Usage: php-cgi [-q] [-h] [-s] [-v] [-i] [-f <file>] SN`L@/I  
php-cgi <file> [args...] m"o=R\C  
-a               Run interactively ;a[3RqmKW  
-C               Do not chdir to the script's directory Z*(OcQ-  
-c <path>|<file> Look for php.ini file in this directory QwuSo{G  
-n               No php.ini file will be used C*Q x  
-d foo[=bar]     Define INI entry foo with value 'bar' Rli`]~!w  
-e               Generate extended information for debugger/profiler v'Up& /(  
-f <file>        Parse <file>.  Implies `-q' V3axwg_  
-h               This help Rb <{o8  
-i               PHP information UYpln[S  
-l               Syntax check only (lint) ePxf.U  
-m               Show compiled in modules o/!a7>xO4  
-q               Quiet-mode.  Suppress HTTP Header output. 0IsnG?"  
-s               Display colour syntax highlighted source. 8 ;=?Lw?  
-v               Version number If|i `,Iy  
-w               Display source with stripped comments and whitespace. lPz5.(5'  
-z <file>        Load Zend extension <file>. ~SEIIq  
................................... failed *yW9-(  
[root@centos php-5.2.17]# eh3CVgH91;  
?\a';@h  
解决方法: XP65  
]8opI\  
只看该作者 安逸沙发  发表于: 2019-10-16
4.nginx和php-fpm服务启动正常,测试页打不开 8\Bb7*  
8p_6RvG  
[root@node2 conf]# netstat -anp |grep -E 'nginx|php-fpm' uR6 `@F  
tcp        0      0 0.0.0.0:80                  0.0.0.0:*                   LISTEN      24328/nginx gUY~ l= c  
tcp        0      0 127.0.0.1:9000              0.0.0.0:*                   LISTEN      23844/php-fpm.conf) U1O8u-X  
unix  3      [ ]         STREAM     CONNECTED     2421896 24328/nginx LkXho>y  
unix  3      [ ]         STREAM     CONNECTED     2421895 24328/nginx wKKQAM6P1  
unix  3      [ ]         STREAM     CONNECTED     2420554 23844/php-fpm.conf) wSi$.C2  
unix  3      [ ]         STREAM     CONNECTED     2420553 23844/php-fpm.conf) QD%!a{I  
[root@node2 conf]# e~7FK_y#0  
bEln.)  
wKioL1Nfc92B2fVZAAJTu4RWgnI287.jpg }(7TiCwd  
K&eT*JW>  
解决方法: .><-XJ  
Tl2(%qB  
[root@node2 sbin]# vim ../conf/nginx.conf @)U;hk)j;  
fastcgi_param  SCRIPT_FILENAME   /scripts$fastcgi_script_name; }x+6<Rp'E_  
修改为 qsQ{`E0  
fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name; U$Z<lx2P  
[root@node2 sbin]# killall nginx ) J.xQ}g  
[root@node2 sbin]# ./nginx @yo6w}3+-  
iD*Hh-  
wKiom1NfdH2A8onKAANqa8R_lMM740.jpg 1\~I "$}  
8d_J9Ho  
I=:"Fqj'N  
L_aqr?Q  
5.缺少依赖包(postgresql-devel) bX$1PY X  
NU3TXO  
2013-11-24 15:08 AwjXY,2  
configure: error: Cannot find libpq-fe.h. Please specify correct PostgreSQL installation path kJpO0k9?eY  
(xHu@l!]  
解决方法 U[02$gd0l  
 V?1[R  
yum install postgresql-devel (' 7$K  
:L@n(bu RN  
r{^43g?  
b>VV/j4!/  
6.启动nginx报错( [emerg]: unknown directive "fastcgi_pass" in /opt/nginx/conf/nginx.conf:67) *asv^aFpS  
9I]Bt=2z  
[root@localhost conf]# ../sbin/nginx 8QK8q: |  
[emerg]: unknown directive "fastcgi_pass"in /opt/nginx/conf/nginx.conf:67) U 7.kYu  
[root@localhost conf]# | bRU=dg  
IHdA2d?.]  
解决方法: ((+XzV>  
tp}/>gU!  
在配置,安装nginx时不要加--without-http_fastcgi_module选项 EW(bM^dk}  
N-?5[T"  
8 5X}CCQ  
y ;Cs#eo  
7.启动nginx报错(nginx: [emerg] unknown directive "proxy_pass"in /usr/local/tong/nginx/ -yBKA]"<I  
CTW\Dt5  
conf/nginx.conf:55) Z::I3 Q  
(&Rk#iU 2  
[root@localhost conf]# ../sbin/nginx /]3[|  
nginx: [emerg] unknown directive "proxy_pass" in /usr/local/tong/nginx/conf/nginx.conf:55 t_jn-Idcf  
[root@localhost conf]# FHQ`T\fC$@  
k3qQU)  
解决方法: d-B+s%>D  
jeWv~JA%L|  
在配置,安装nginx时不要加 --without-http_proxy_module选项 ih".y3  
)1 T2u  
JkJ @bh Eu  
'JMW.;Lh?X  
8.启动nginx报错(nginx: [emerg] unknown directive "gzip" in /usr/local/tong/nginx/conf/nginx.conf:33) YUEyGhkMV{  
#j~FlY5  
[root@localhost conf]# ../sbin/nginx oL@-<;zKO  
nginx: [emerg] unknown directive "gzip" in /usr/local/tong/nginx/conf/nginx.conf:33 \t7yH]:>@  
[root@localhost conf]# nUP, Yd  
HXa[0VOx  
解决方法: (0NffM1  
-j3Lgm  
在配置,安装nginx时不要加--without-http_gzip_module选项 ~|} ]  
r&E gP  
|X8?B =  
9Y,JYc#  
转载于:https://blog.51cto.com/tongcheng/1371466
快速回复

限100 字节
安逸网提示:如果您在写长篇帖子又不马上发表,建议存为草稿
 
认证码:
上一个 下一个