• 962阅读
  • 1回复

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

楼层直达
1.安装nginx软件出现的错误 Ps Qq ^/  
g1muT.W]S  
collect2: ld returned 1 exit status O[y.3>l[s  
make[1]: *** [objs/nginx] Error 1 `R0>;TdT  
make[1]: Leaving directory `/root/nginx-1.3.13' 5.F.mUO  
make: *** [build] Error 2 (qlI QC  
[root@centos nginx-1.3.13]# 4?g~GI3  
uNl<= 1  
解决方法: +cM;d4  
lZV]Z3=p'0  
[root@centos nginx-1.3.13]# yum install pcre-* f( hK>H  
[root@centos nginx-1.3.13]# ./configure --user=nginx --group=nginx \ .\X/o!xC  
--with-pcre  --without-http_gzip_module \ Hx2UDHF  
--without-http_rewrite_module --without-http_proxy_module \ ~YO')  
--without-http_upstream_ip_hash_module \ HI#}M|4n  
--without-http_upstream_least_conn_module \ mLPQ5`_  
--without-http_upstream_keepalive_module \ 39S}/S)  
--with-http_stub_status_module --with-http_flv_module \ yopEqO  
--with-http_mp4_module l Vo](#W  
Dd<gYPC  
测试: b.47KJzt  
4o9#B:N]J  
[root@centos nginx-1.3.13]# Sq/M %z5'  
..................................... s#&jE GBug  
-e "s|%%ERROR_LOG_PATH%%|/usr/local/nginx/logs/error.log|" \ .Di+G-#aEs  
< man/nginx.8 > objs/nginx.8 aWm0*W"(@  
make[1]: Leaving directory `/root/nginx-1.3.13' JMuUj_^}7  
[root@centos nginx-1.3.13]# echo $?      --没有错误 Ooc,R(  
0 lEQ 63)Z  
[root@centos nginx-1.3.13]# 1m|Oi%i4  
FgE6j;   
3lM mSKN  
=\J^_g4-l  
2.安装php出现对mysql的错误 <4^ _dJ9=  
@bmu4!"d  
./configure --prefix=/usr/local/php5.2.17   --enable-fpm  \ hx+a.N  
--enable-dba --enable-ftp  --with-gd  \ mJc'oG-  
--with-jpeg-dir --with-png-dir  --with-ldap  \ 9j49#wG0"B  
--enable-mbstring   --with-mysql=/usr/local/mysql5.0/  \ ?:s`}b  
--with-mysqli=/usr/local/mysql5.0/bin/mysql_config   \ 28d:  
--with-ncurses  --with-pdo-mysql --with-snmp  --enable-zip R5X<8(4p  
........................................................................ IJD'0/R'c  
checking whether to enable PDO support... yes |D$U{5}Mv  
checking for PDO_DBLIB support via FreeTDS... no ]8htJ]<|Q  
checking for Firebird support for PDO... no uWG'AmK_#E  
checking for MySQL support for PDO... yes Iu 2RK  
checking for mysql_config... not found qe"5&cc1  
configure: error: Cannot find MySQL header files under    --错误结果 5G_*T  
Um9!<G=;  
解决方法(没有mysql头文件): \'GX^0yK  
%HL@O]ftS  
[root@centos bin]# yum install mysql-devel    --安装这个软件就可以了 g/lv>*+gS  
67}y/C]<  
.J%}ROm  
Q6MDhv,  
3.启动php-fpm服务失败 |42E'zH&  
y`mEsj  
[root@centos php-5.2.17]# /usr/local/php5.2.17/sbin/php-fpm start L G,XhN  
Starting php_fpm Error in argument 1, char 1: no argument for option - ;T"}dJel#  
Usage: php-cgi [-q] [-h] [-s] [-v] [-i] [-f <file>] $*xnq%A  
php-cgi <file> [args...] W5 fO1F  
-a               Run interactively Z:,HB]&;9  
-C               Do not chdir to the script's directory "o<:[c9/  
-c <path>|<file> Look for php.ini file in this directory I?4J69'  
-n               No php.ini file will be used @s/;y VVq  
-d foo[=bar]     Define INI entry foo with value 'bar' ]B3 0d  
-e               Generate extended information for debugger/profiler ]o6yU#zn~e  
-f <file>        Parse <file>.  Implies `-q' OZ![9l  
-h               This help d+fmVM?p  
-i               PHP information #T#&qo#  
-l               Syntax check only (lint) &^ =t%A%#  
-m               Show compiled in modules z|+L>O-8  
-q               Quiet-mode.  Suppress HTTP Header output. 1^!= J<`K;  
-s               Display colour syntax highlighted source. 0Hff/~J  
-v               Version number x:xKlPGd  
-w               Display source with stripped comments and whitespace. s3g$F23  
-z <file>        Load Zend extension <file>. Mr2dhSQ !  
................................... failed cX7xG U  
[root@centos php-5.2.17]# }= s@y"["  
*r:8=^C7S  
解决方法: .A\9|sRZ5  
.}SW`R Pk  
只看该作者 安逸沙发  发表于: 2019-10-16
4.nginx和php-fpm服务启动正常,测试页打不开 bsCl w  
)ZZjuFQJ)  
[root@node2 conf]# netstat -anp |grep -E 'nginx|php-fpm' 8M6 Xd]{%  
tcp        0      0 0.0.0.0:80                  0.0.0.0:*                   LISTEN      24328/nginx 9j94]w2v  
tcp        0      0 127.0.0.1:9000              0.0.0.0:*                   LISTEN      23844/php-fpm.conf) 6=pE5UfT  
unix  3      [ ]         STREAM     CONNECTED     2421896 24328/nginx /H (55^EMZ  
unix  3      [ ]         STREAM     CONNECTED     2421895 24328/nginx nm#ISueh  
unix  3      [ ]         STREAM     CONNECTED     2420554 23844/php-fpm.conf) {beu  
unix  3      [ ]         STREAM     CONNECTED     2420553 23844/php-fpm.conf) |.#G G7F^S  
[root@node2 conf]# wak:"B[  
+DsdzR`Gx,  
wKioL1Nfc92B2fVZAAJTu4RWgnI287.jpg 8_W=)w6  
b#%$y  
解决方法: &u`]Zn   
42oW]b%P{;  
[root@node2 sbin]# vim ../conf/nginx.conf ?<;9=l\Q  
fastcgi_param  SCRIPT_FILENAME   /scripts$fastcgi_script_name;  Y+d+  
修改为 m{gw:69h  
fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name; \; voBU  
[root@node2 sbin]# killall nginx \<aR^Sj.  
[root@node2 sbin]# ./nginx RW`j^q,c3  
9oU1IT9   
wKiom1NfdH2A8onKAANqa8R_lMM740.jpg a.z)m} +  
\1He9~6  
OWys`2W  
OQ&'3hv{  
5.缺少依赖包(postgresql-devel) ;Rf@S$  
^]NFr*'!  
2013-11-24 15:08 O?`_RN4l  
configure: error: Cannot find libpq-fe.h. Please specify correct PostgreSQL installation path :V0sKg|sS  
bo-L|R&O  
解决方法 +QEP:#qZw  
"-Yj~  
yum install postgresql-devel mb>8=hMg  
\ZtKaEXnx  
LC4W?']/  
!'#GdRstv  
6.启动nginx报错( [emerg]: unknown directive "fastcgi_pass" in /opt/nginx/conf/nginx.conf:67) fZp3g%u  
X4<Y5?&0  
[root@localhost conf]# ../sbin/nginx bao"iv~z  
[emerg]: unknown directive "fastcgi_pass"in /opt/nginx/conf/nginx.conf:67) e^}@X[*'#  
[root@localhost conf]# j[A:So  
c,:nWf  
解决方法: X"sJiFS  
q8!]x-5$6j  
在配置,安装nginx时不要加--without-http_fastcgi_module选项 #;= sJ[m4  
cua( w  
=!G{+&j  
lL&U ioo}D  
7.启动nginx报错(nginx: [emerg] unknown directive "proxy_pass"in /usr/local/tong/nginx/ dQz#&&s-  
,M~> t7+  
conf/nginx.conf:55) s\< @v7A  
J0imWluhQ  
[root@localhost conf]# ../sbin/nginx p1\mjM  
nginx: [emerg] unknown directive "proxy_pass" in /usr/local/tong/nginx/conf/nginx.conf:55 o7 0] F  
[root@localhost conf]# :G#+ 5 }  
<xe_t=N  
解决方法: =kf"%vFV  
DN iH" 0%  
在配置,安装nginx时不要加 --without-http_proxy_module选项 *U}ztH-+/  
80`$F{xcX  
-w>ss&  
0yvp>{;p  
8.启动nginx报错(nginx: [emerg] unknown directive "gzip" in /usr/local/tong/nginx/conf/nginx.conf:33) 1J72*`4OK  
>t<\zC|~w  
[root@localhost conf]# ../sbin/nginx RehraY3q  
nginx: [emerg] unknown directive "gzip" in /usr/local/tong/nginx/conf/nginx.conf:33 MTN*{ug2:  
[root@localhost conf]# 6(BgnH8oc  
Nu OxEyC  
解决方法: fUGappb  
q3#+G:nh  
在配置,安装nginx时不要加--without-http_gzip_module选项 r/HCWs|  
KQvSeH>r  
C\aHr!  
p:K%-^  
转载于:https://blog.51cto.com/tongcheng/1371466
快速回复

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