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

本文涉及的产品
云数据库 RDS MySQL Serverless,0.5-2RCU 50GB
简介:

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]#

wKioL1Nfc92B2fVZAAJTu4RWgnI287.jpg

解决方法:

[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

wKiom1NfdH2A8onKAANqa8R_lMM740.jpg

 

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选项










本文转自 z597011036 51CTO博客,原文链接:http://blog.51cto.com/tongcheng/1371466,如需转载请自行联系原作者
相关实践学习
基于CentOS快速搭建LAMP环境
本教程介绍如何搭建LAMP环境,其中LAMP分别代表Linux、Apache、MySQL和PHP。
全面了解阿里云能为你做什么
阿里云在全球各地部署高效节能的绿色数据中心,利用清洁计算为万物互联的新世界提供源源不断的能源动力,目前开服的区域包括中国(华北、华东、华南、香港)、新加坡、美国(美东、美西)、欧洲、中东、澳大利亚、日本。目前阿里云的产品涵盖弹性计算、数据库、存储与CDN、分析与搜索、云通信、网络、管理与监控、应用服务、互联网中间件、移动服务、视频服务等。通过本课程,来了解阿里云能够为你的业务带来哪些帮助 &nbsp; &nbsp; 相关的阿里云产品:云服务器ECS 云服务器 ECS(Elastic Compute Service)是一种弹性可伸缩的计算服务,助您降低 IT 成本,提升运维效率,使您更专注于核心业务创新。产品详情: https://www.aliyun.com/product/ecs
目录
相关文章
|
7天前
|
资源调度 JavaScript 搜索推荐
Linux系统之部署envlinks极简个人导航页
【4月更文挑战第11天】Linux系统之部署envlinks极简个人导航页
41 2
|
10天前
|
缓存 Linux 测试技术
安装【银河麒麟V10】linux系统--并挂载镜像
安装【银河麒麟V10】linux系统--并挂载镜像
61 0
|
10天前
|
监控 Unix Linux
Linux操作系统调优相关工具(四)查看Network运行状态 和系统整体运行状态
Linux操作系统调优相关工具(四)查看Network运行状态 和系统整体运行状态
26 0
|
10天前
|
Linux C语言
linux yum安装ffmpeg 图文详解
linux yum安装ffmpeg 图文详解
28 0
|
10天前
|
NoSQL Linux Redis
linux 下和win下安装redis 并添加开机自启 图文详解
linux 下和win下安装redis 并添加开机自启 图文详解
15 0
|
10天前
|
Linux
linux yum 安装rar和unrar
linux yum 安装rar和unrar
35 0
|
17天前
|
存储 前端开发 Linux
Linux系统之部署ToDoList任务管理工具
【4月更文挑战第1天】Linux系统之部署ToDoList任务管理工具
61 1
|
8天前
|
存储 算法 Linux
【实战项目】网络编程:在Linux环境下基于opencv和socket的人脸识别系统--C++实现
【实战项目】网络编程:在Linux环境下基于opencv和socket的人脸识别系统--C++实现
24 6
|
3天前
|
关系型数据库 MySQL Linux
Linux联网安装MySQL Server
Linux联网安装MySQL Server
13 0
|
3天前
|
运维 网络协议 Unix
18.系统知识-Linux常用命令
18.系统知识-Linux常用命令