LNMP安裝常見問題集錦(一)

LNMP安裝常見問題集錦(一)  


一、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 好了。

二、nginx: [emerg] getpwnam("www") failed
出現狀況:剛裝完nginx後,運行測試文件的時候。
錯誤意思:得到 www  用戶失敗。
解決辦法:在nginx.conf中 把"#user nobody;"的前面#註釋去掉,改成"user www www;"

三、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的配置文件是否正確

四、nginx: [warn] conflicting server name "" on 0.0.0.0:80, ignored
出現狀況: 配置完nginx的 配置文件後,reload時出現的這個錯誤。
錯誤意思:nginx的 配置文件中有域名衝突了
解決辦法:查看配置文件是否有衝突的域名,若是有的話刪除再reload就能夠了。
linux上用LINUX下用grep "blogguy.cn"搜索一下,通常是因爲修改的是沒有注意形成的。
搜索到有相同的重複,去掉重複的域名配置就能夠了。

五、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 的配置文件 而後重啓就行了。

六、[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

七、[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的時候遇到,該問題和問題六、實際是同一個問題。
錯誤意思: 找不到  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

八、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! php

2.可能進程裏已經存在mysql進程
解決方法:用命令「ps -ef|grep mysqld」查看是否有mysqld進程,若是有使用「kill -9  進程號」殺死,而後從新啓動mysqld! html

3.多是第二次在機器上安裝mysql,有殘餘數據影響了服務的啓動。
解決方法:去mysql的數據目錄/data看看,若是存在mysql-bin.index,就趕快把它刪除掉吧,它就是罪魁禍首了。本人就是使用第三條方法解決的 !http://blog.rekfan.com/?p=186 mysql

4.mysql在啓動時沒有指定配置文件時會使用/etc/my.cnf配置文件,請打開這個文件查看在[mysqld]節下有沒有指定數據目錄(datadir)。
解決方法:請在[mysqld]下設置這一行:datadir = /usr/local/mysql/data linux

5.skip-federated字段問題
解決方法:檢查一下/etc/my.cnf文件中有沒有沒被註釋掉的skip-federated字段,若是有就當即註釋掉吧。 nginx

6.錯誤日誌目錄不存在
解決方法:使用「chown」 「chmod」命令賦予mysql全部者及權限 sql

7.selinux惹的禍,若是是centos系統,默認會開啓selinux
解決方法:關閉它,打開/etc/selinux/config,把SELINUX=enforcing改成SELINUX=disabled後存盤退出重啓機器試試。 centos

8.mysql的data目錄掛載的磁盤空間已經用完 api

解決方法:df -h 查看磁盤使用狀況,果真磁盤滿了,由於當時分區採用系統默認,不知道爲何不能自動擴容而後清理多餘數據,之後在研究吧。啓動mysql,成功啓動! 安全




此篇博文會一直更新,其中都是都是一下常遇到的問題,望對你們有所幫助。 服務器

via

相關文章
相關標籤/搜索