• 968阅读
  • 1回复

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

楼层直达
1.安装nginx软件出现的错误 (*V!V3E3#  
:2:%  
collect2: ld returned 1 exit status ZjrBOb  
make[1]: *** [objs/nginx] Error 1 Wc;N;K52   
make[1]: Leaving directory `/root/nginx-1.3.13' eW}-UeT  
make: *** [build] Error 2 pigu]mj  
[root@centos nginx-1.3.13]# Be<bBKQb  
^BW8zu@=O  
解决方法: s*eM}d.p  
&>K|F >7q  
[root@centos nginx-1.3.13]# yum install pcre-* |t;Ktl  
[root@centos nginx-1.3.13]# ./configure --user=nginx --group=nginx \ g9d/nR X&  
--with-pcre  --without-http_gzip_module \ bQI.Qk  
--without-http_rewrite_module --without-http_proxy_module \ oU*e=uehj  
--without-http_upstream_ip_hash_module \ #]^M/y h  
--without-http_upstream_least_conn_module \ + EKp*Vje  
--without-http_upstream_keepalive_module \ ^W^Y"0y9`  
--with-http_stub_status_module --with-http_flv_module \ &b2@+/ F  
--with-http_mp4_module ?,[$8V  
!MmbwB'  
测试: kb~ 9/)~g  
$d&7q5[  
[root@centos nginx-1.3.13]# ]2|KG3t  
..................................... i=fhK~Jd  
-e "s|%%ERROR_LOG_PATH%%|/usr/local/nginx/logs/error.log|" \ ?3v-ppw%  
< man/nginx.8 > objs/nginx.8 I^D*) z   
make[1]: Leaving directory `/root/nginx-1.3.13' VwXR,(  
[root@centos nginx-1.3.13]# echo $?      --没有错误 LVL#qNIu  
0 *;lb<uLv  
[root@centos nginx-1.3.13]# .l,NmF9  
X-j<fX_  
q s9r$o.\l  
NpA%7Q~B$,  
2.安装php出现对mysql的错误 D{4]c)>  
_e|-O>#pl  
./configure --prefix=/usr/local/php5.2.17   --enable-fpm  \  BfW@f  
--enable-dba --enable-ftp  --with-gd  \ qJXf c||Zg  
--with-jpeg-dir --with-png-dir  --with-ldap  \ 8yuTT^  
--enable-mbstring   --with-mysql=/usr/local/mysql5.0/  \ mt-t8~A  
--with-mysqli=/usr/local/mysql5.0/bin/mysql_config   \ W:2]d  
--with-ncurses  --with-pdo-mysql --with-snmp  --enable-zip \@_?mL@=  
........................................................................ @\=4 Rin/q  
checking whether to enable PDO support... yes eHyIFoaC/  
checking for PDO_DBLIB support via FreeTDS... no ',6d0>4 *  
checking for Firebird support for PDO... no #*}cc  
checking for MySQL support for PDO... yes !Jaj2mS.N  
checking for mysql_config... not found }O6E5YCm  
configure: error: Cannot find MySQL header files under    --错误结果 TZObjSm_v  
1Msc:7:L  
解决方法(没有mysql头文件): ;^8X(R  
 t&G #%  
[root@centos bin]# yum install mysql-devel    --安装这个软件就可以了 OX.g~M ig|  
Z%VgAV>>  
Ys@\~?ym+  
0-Wv$o[  
3.启动php-fpm服务失败 HU-#xK  
PkF'#W%  
[root@centos php-5.2.17]# /usr/local/php5.2.17/sbin/php-fpm start <\?dPRw2>  
Starting php_fpm Error in argument 1, char 1: no argument for option - #2qv"ntW  
Usage: php-cgi [-q] [-h] [-s] [-v] [-i] [-f <file>] s&6/fa  
php-cgi <file> [args...] ? UBE0C  
-a               Run interactively eg>]{`WQ  
-C               Do not chdir to the script's directory ^FK-e;J  
-c <path>|<file> Look for php.ini file in this directory \Jr7Hy1;  
-n               No php.ini file will be used C.hRL4+;Zm  
-d foo[=bar]     Define INI entry foo with value 'bar' - !s=`9o  
-e               Generate extended information for debugger/profiler c.;<+dYsm*  
-f <file>        Parse <file>.  Implies `-q' ;)!);q+  
-h               This help tL S$D-  
-i               PHP information A{\!nq_~N  
-l               Syntax check only (lint) [J43]  
-m               Show compiled in modules >W=^>8u  
-q               Quiet-mode.  Suppress HTTP Header output. qUG)+~g`  
-s               Display colour syntax highlighted source. a O(&<  
-v               Version number p/Lk'h~  
-w               Display source with stripped comments and whitespace. :X#'E Lo|  
-z <file>        Load Zend extension <file>. rJc=&'{&)N  
................................... failed (^LR9 CW  
[root@centos php-5.2.17]# )W3kBDD  
6g%~~hX  
解决方法: bODyJ7=[  
2p8}6y:}7  
只看该作者 安逸沙发  发表于: 2019-10-16
4.nginx和php-fpm服务启动正常,测试页打不开 %ae|4u#b  
}2@Aj  
[root@node2 conf]# netstat -anp |grep -E 'nginx|php-fpm' zn!H&!8&  
tcp        0      0 0.0.0.0:80                  0.0.0.0:*                   LISTEN      24328/nginx R<* c   
tcp        0      0 127.0.0.1:9000              0.0.0.0:*                   LISTEN      23844/php-fpm.conf) b A/,{R  
unix  3      [ ]         STREAM     CONNECTED     2421896 24328/nginx /#WRd}IjK  
unix  3      [ ]         STREAM     CONNECTED     2421895 24328/nginx (T&rvE  
unix  3      [ ]         STREAM     CONNECTED     2420554 23844/php-fpm.conf) R ;XG2  
unix  3      [ ]         STREAM     CONNECTED     2420553 23844/php-fpm.conf) QkY]z~P4  
[root@node2 conf]# q oA?  
yf 7Sz$Eq  
wKioL1Nfc92B2fVZAAJTu4RWgnI287.jpg YB;q5[  
`1O<UJX  
解决方法: 3vcKK;qCB  
gfr y5e  
[root@node2 sbin]# vim ../conf/nginx.conf oR``Jiob|  
fastcgi_param  SCRIPT_FILENAME   /scripts$fastcgi_script_name; Y! 8 I  
修改为 /=y _ #l  
fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name; 8ch^e[U`  
[root@node2 sbin]# killall nginx {hP_"nN#  
[root@node2 sbin]# ./nginx =qg;K'M5  
T(@J]Y-  
wKiom1NfdH2A8onKAANqa8R_lMM740.jpg ~4T:v _Q7g  
AlVB hR`  
[9-&Lq_ g  
@7}]\}SR  
5.缺少依赖包(postgresql-devel) REK(^1 h  
;Z asK0  
2013-11-24 15:08 )iU@P7W=  
configure: error: Cannot find libpq-fe.h. Please specify correct PostgreSQL installation path _Hp[}sv4)  
ukInS:7  
解决方法 w>TlM*3D/  
H1fKe=$1  
yum install postgresql-devel n2p(@  
V Kw33  
d#W>"Cqxqa  
p~evPTHnrX  
6.启动nginx报错( [emerg]: unknown directive "fastcgi_pass" in /opt/nginx/conf/nginx.conf:67) Y0 ?<~Gf  
{gkY:$xnrG  
[root@localhost conf]# ../sbin/nginx r9vO(m~  
[emerg]: unknown directive "fastcgi_pass"in /opt/nginx/conf/nginx.conf:67) #Ave r]eK  
[root@localhost conf]# B]lM69Hz  
"oLY";0(=  
解决方法: IwZe2$f  
Q|] 9  
在配置,安装nginx时不要加--without-http_fastcgi_module选项 huTWoMU  
1$toowb"Zy  
(kFg2kG  
i9=*ls^Cx  
7.启动nginx报错(nginx: [emerg] unknown directive "proxy_pass"in /usr/local/tong/nginx/ 6xT" j)h  
?rSm6V  
conf/nginx.conf:55) DRy,n)U&  
YkJnZ_k/P  
[root@localhost conf]# ../sbin/nginx h3BDHz,  
nginx: [emerg] unknown directive "proxy_pass" in /usr/local/tong/nginx/conf/nginx.conf:55 [[A}MF*@  
[root@localhost conf]# +/|t8zFWs  
svj0;x5  
解决方法: N^@aO&+A  
*L+)R*|:&  
在配置,安装nginx时不要加 --without-http_proxy_module选项 b.lK0 Xo  
0$1-5XY9  
m0[JiwPI  
%[J|n~8_Z  
8.启动nginx报错(nginx: [emerg] unknown directive "gzip" in /usr/local/tong/nginx/conf/nginx.conf:33) rJws#^ ]  
JV_V2L1Ut  
[root@localhost conf]# ../sbin/nginx FAbl5VW'  
nginx: [emerg] unknown directive "gzip" in /usr/local/tong/nginx/conf/nginx.conf:33 'A)r)z {X  
[root@localhost conf]# x !^u$5c  
ZgH(,g,TU  
解决方法: WB(Gx_o3  
"79"SSfOc  
在配置,安装nginx时不要加--without-http_gzip_module选项 G}ccf%  
vAH`tPi>  
b 9cY  
*C"-$WU3o  
转载于:https://blog.51cto.com/tongcheng/1371466
快速回复

限100 字节
安逸网提示:批量上传需要先选择文件,再选择上传
 
认证码:
上一个 下一个