LNMP环境搭建遇到的问题

LNMP安装常见问题 


1、ERROR: invalid PHP executable specified by TEST_PHP_EXECUTABLE  = /usr/local/src/php-5.3.18/sapi/cli/php
出现情况:make php过程中的错误
错误意思:  关闭安全模式就好了,都是safe模式的测试 惹的祸。最新版的php  安装包中已经没有safe模块了。
解决办法:  该错误可以忽略直接make install 好了。

2、nginx: [emerg] getpwnam("www") failed
出现情况:刚装完nginx后,运行测试文件的时候。
错误意思:获得 www  用户失败。
解决办法:在nginx.conf中 把"#user nobody;"的前面#注释去掉,改为"user www www;"

3、nginx: [error] open() "/usr/local/nginx/logs/nginx.pid" failed (2: No such file or directory)
出现情况:刚安装完nginx后重启时报的错。
错误意思:在    /usr/local/nginx/logs 目录下没有nginx.pid
解决办法:  运行这句话,问题解决 "/usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf" 这句话的意思的为nginx指定配置文件路径。
/usr/local/nginx/sbin/nginx -t  测试nginx的配置文件是否正确

4、nginx: [warn] conflicting server name "" on 0.0.0.0:80, ignored
出现情况:  配置完nginx的 配置文件后,reload时出现的这个错误。
错误意思:nginx的  配置文件中有域名冲突了
解决办法:查看配置文件是否有冲突的域名,如果有的话删除再reload就可以了。
linux上用LINUX下用grep "blogguy.cn"搜索一下,一般是由于修改的是没有注意造成的。
搜索到有相同的重复,去掉重复的域名配置就可以了。

5、nginx: [alert] kill(34719, 1) failed (3: No such process)
出现情况:重启linux系统后,运行 "/usr/local/nginx/sbin/nginx -s reload" 报这个错误
错误意思:nginx启动的时候杀死进程34719失败,原因是没有这个进程。
解决办法:
[root  @mylinux ~]# /usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf
[root  @mylinux ~]# /usr/local/nginx/sbin/nginx -s reload
指定一下nginx 的配置文件 然后重启就好了。

6、[root@mylinux logs]# /usr/local/php/sbin/php-fpm -t
[23-Jun-2013 21:00:29] ERROR: failed to open configuration file '/usr/local/php/etc/php-fpm.conf': No such file or directory (2)
[23-Jun-2013 21:00:29] ERROR: failed to load configuration file '/usr/local/php/etc/php-fpm.conf'
[23-Jun-2013 21:00:29] ERROR: FPM initialization failed
出现情况:运行 "  /usr/local/php/sbin/php-fpm -t  " 测试 php-fpm 的配置文件时出现。
错误意思:找不到   php-fpm.conf 文件(php-fpm配置文件)
解决办法:
[root@mylinux init.d]# cd /usr/local/php/etc
[root@mylinux etc]# cp php-fpm.conf.default php-fpm.conf
[root@mylinux etc]# /usr/local/php/sbin/php-fpm -t
[23-Jun-2013 21:04:00] NOTICE: configuration file /usr/local/php/etc/php-fpm.conf test is successful

7、[root@mylinux init.d]# /etc/init.d/php-fpm start  或者 service php-fpm start
Starting php-fpm [23-Jun-2013 21:16:01] ERROR: failed to open configuration file '/usr/local/php/etc/php-fpm.conf': No such file or directory (2)
[23-Jun-2013 21:16:01] ERROR: failed to load configuration file '/usr/local/php/etc/php-fpm.conf'
[23-Jun-2013 21:16:01] ERROR: FPM initialization failed
 failed
出现情况:启动php-fpm的时候遇到,该问题和问题6、实际是同一个问题。
错误意思:  找不到   php-fpm.conf 文件(php-fpm配置文件)
解决办法:
[root@mylinux init.d]# cd /usr/local/php/etc
[root@mylinux etc]# cp php-fpm.conf.default php-fpm.conf
[root@mylinux etc]# service php-fpm start
Starting php-fpm  done

8、Starting MySQL.. ERROR! The server quit without updating PID file (/usr/local/mysql/data/mylinux.pid).
出现情况:运行"  service mysqld start"或者" /etc/init.d/mysqld start"  启动mysqld守护进程的时
错误意思:重启mysql失败,原因是找不到
解决办法:
从报错上看,看不出具体问题,只能看日志了
[root@mylinux /]# cd /usr/local/mysql/data
[root@mylinux data]# tail -f -n 20 mylinux.err

130623 16:34:53 mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/data
130623 16:34:53 [Note] Plugin 'FEDERATED' is disabled.
130623 16:34:53 InnoDB: The InnoDB memory heap is disabled
130623 16:34:53 InnoDB: Mutexes and rw_locks use GCC atomic builtins
130623 16:34:53 InnoDB: Compressed tables use zlib 1.2.3
130623 16:34:53 InnoDB: Initializing buffer pool, size = 128.0M
130623 16:34:53 InnoDB: Completed initialization of buffer pool
InnoDB: Unable to lock ./ibdata1, error: 11
InnoDB: Check that you do not already have another mysqld process
InnoDB: using the same InnoDB data or log files.
InnoDB: Unable to lock ./ibdata1, error: 11
InnoDB: Check that you do not already have another mysqld process
InnoDB: using the same InnoDB data or log files.
InnoDB: Unable to lock ./ibdata1, error: 11
InnoDB: Check that you do not already have another mysqld process
InnoDB: using the same InnoDB data or log files.
InnoDB: Unable to lock ./ibdata1, error: 11
InnoDB: Check that you do not already have another mysqld process
InnoDB: using the same InnoDB data or log files.
InnoDB: Unable to lock ./ibdata1, error: 11
InnoDB: Check that you do not already have another mysqld process
InnoDB: using the same InnoDB data or log files.
InnoDB: Unable to lock ./ibdata1, error: 11
InnoDB: Check that you do not already have another mysqld process
InnoDB: using the same InnoDB data or log files.
InnoDB: Unable to lock ./ibdata1, error: 11
InnoDB: Check that you do not already have another mysqld process
InnoDB: using the same InnoDB data or log files.
InnoDB: Unable to lock ./ibdata1, error: 11
InnoDB: Check that you do not already have another mysqld process
InnoDB: using the same InnoDB data or log files.
InnoDB: Unable to lock ./ibdata1, error: 11
InnoDB: Check that you do not already have another mysqld process
InnoDB: using the same InnoDB data or log files.
InnoDB: Unable to lock ./ibdata1, error: 11
InnoDB: Check that you do not already have another mysqld process
InnoDB: using the same InnoDB data or log files.
InnoDB: Unable to lock ./ibdata1, error: 11
InnoDB: Check that you do not already have another mysqld process
InnoDB: using the same InnoDB data or log files.
InnoDB: Unable to lock ./ibdata1, error: 11
InnoDB: Check that you do not already have another mysqld process
InnoDB: using the same InnoDB data or log files.
130623 16:36:33  InnoDB: Unable to open the first data file
InnoDB: Error in opening ./ibdata1
130623 16:36:33  InnoDB: Operating system error number 11 in a file operation.
InnoDB: Error number 11 means 'Resource temporarily unavailable'.
InnoDB: Some operating system error numbers are described at
InnoDB: http://dev.mysql.com/doc/refman/5.5/en/operating-system-error-codes.html
130623 16:36:33 InnoDB: Could not open or create data files.
130623 16:36:33 InnoDB: If you tried to add new data files, and it failed here,
130623 16:36:33 InnoDB: you should now edit innodb_data_file_path in my.cnf back
130623 16:36:33 InnoDB: to what it was, and remove the new ibdata files InnoDB created
130623 16:36:33 InnoDB: in this failed attempt. InnoDB only wrote those files full of
130623 16:36:33 InnoDB: zeros, but did not yet use them in any way. But be careful: do not
130623 16:36:33 InnoDB: remove old data files which contain your precious data!
130623 16:36:33 [ERROR] Plugin 'InnoDB' init function returned error.
130623 16:36:33 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
130623 16:36:33 [ERROR] Unknown/unsupported storage engine: InnoDB
130623 16:36:33 [ERROR] Aborting
130623 16:36:33 [Note] /usr/local/mysql/bin/mysqld: Shutdown complete
130623 16:36:33 mysqld_safe mysqld from pid file /usr/local/mysql/data/mylinux.pid ended

出现情况:  查看以上日志很明显是一句   InnoDB: Check that you do not already have another mysqld process
说明已经有mysqld进程在运行了,所以启动mysql失败。
解决办法:
[root@mylinux etc]#  ps -ef|grep mysqld
[root@mylinux etc]#  kill -9  进程号
[root@mylinux etc]#  service mysqld start
这是启动一次 mysql 报的具体的错误。
我重启了一下CentOS服务器,再重启一下mysqld,问题自己解决了,可能是由于LVM磁盘管理软件的原因。

google了下 ,出现这个问题可能的原因有多种,具体什么原因最好的办法是先查看下错误日志:

1.可能是/usr/local/mysql/data/rekfan.pid文件没有写的权限
解决方法 :给予权限,执行 “chown -R mysql:mysql /var/data” “chmod -R 755 /usr/local/mysql/data”  然后重新启动mysqld!

2.可能进程里已经存在mysql进程
解决方法:用命令“ps -ef|grep mysqld”查看是否有mysqld进程,如果有使用“kill -9  进程号”杀死,然后重新启动mysqld!

3.可能是第二次在机器上安装mysql,有残余数据影响了服务的启动。
解决方法:去mysql的数据目录/data看看,如果存在mysql-bin.index,就赶快把它删除掉吧,它就是罪魁祸首了。本人就是使用第三条方法解决的 !http://blog.rekfan.com/?p=186

4.mysql在启动时没有指定配置文件时会使用/etc/my.cnf配置文件,请打开这个文件查看在[mysqld]节下有没有指定数据目录(datadir)。
解决方法:请在[mysqld]下设置这一行:datadir = /usr/local/mysql/data

5.skip-federated字段问题
解决方法:检查一下/etc/my.cnf文件中有没有没被注释掉的skip-federated字段,如果有就立即注释掉吧。

6.错误日志目录不存在
解决方法:使用“chown” “chmod”命令赋予mysql所有者及权限

7.selinux惹的祸,如果是centos系统,默认会开启selinux
解决方法:关闭它,打开/etc/selinux/config,把SELINUX=enforcing改为SELINUX=disabled后存盘退出重启机器试试。

8.mysql的data目录挂载的磁盘空间已经用完

解决方法:df -h 查看磁盘使用情况,果然磁盘满了,因为当时分区采用系统默认,不知道为什么不能自动扩容然后清理多余数据,以后在研究吧。启动mysql,成功启动!


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值