VPS侦探论坛

 找回密码
 注册
查看: 8981|回复: 10

跑PHP時~502 Bad Gateway 錯誤

[复制链接]
发表于 2011-1-5 18:22:00 | 显示全部楼层 |阅读模式

我試了好多次
從4.0安裝到5.0都失敗
502 Bad Gateway
幫我看一下阿~~

還有要如何查VPS是用什麼OS 的?
我不知是CentOS還是Debian/Ubuntu的

[ 本帖最后由 kobebeef 于 2011-1-5 18:27 编辑 ]

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?注册

x
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
发表于 2011-1-6 09:18:05 | 显示全部楼层

回复 1# 的帖子



mysql启动时有错误,看看/usr/local/mysql/var/主机名.err 里面的错误信息。php安装编译没有错误,可能是没有启动/usr/local/php/sbin/php-fpm restart 再看一下。

centos的系统
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
 楼主| 发表于 2011-1-6 11:36:18 | 显示全部楼层

還是不行阿!!
[root@server lnmp0.5-full]#/usr/local/php/sbin/php-fpm restart
Shutting down php_fpm /usr/local/php/sbin/php-fpm: line 69: kill: (14644) - No such process
................................... failed
Starting php_fpm  done
我又再裝了一次LNMP
這次更慘~
只出現 It works!
p.php 都http 404

[ 本帖最后由 kobebeef 于 2011-1-6 15:56 编辑 ]

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?注册

x
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
 楼主| 发表于 2011-1-6 15:53:18 | 显示全部楼层



可以用了~
系統reboot後就可以

現在只差mysql啟動不了
Reload LNMP...
Reload Nginx configure...
the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok
configuration file /usr/local/nginx/conf/nginx.conf test is successful
kill: usage: kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l [s                                                                                                                                                        igspec]
Nginx program is reloding!
Stopping MySQL database server: mysqld.
/etc/init.d/mysql: WARNING: /etc/mysql/my.cnf cannot be read. See README.Debian.gz (w                                                                                                                                                        arning).
Starting MySQL database server: mysqld . . . . . . . . . . . . . . failed!
Shutting down php_fpm . done
Starting php_fpm  done
[root@server lnmp0.5-full]#

[ 本帖最后由 kobebeef 于 2011-1-6 16:11 编辑 ]
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
发表于 2011-1-6 16:15:16 | 显示全部楼层

回复 4# 的帖子


mysql启动时有错误,看看/usr/local/mysql/var/主机名.err 里面的错误信息。

军哥运维代购:http://shop63846532.taobao.com/

 楼主| 发表于 2011-1-6 16:26:03 | 显示全部楼层

這些是說哪裡出錯了?
我看不懂
要如何修改?

110106 04:34:42 mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/var
110106  4:34:42 [ERROR] Can't start server : Bind on unix socket: Permission denied
110106  4:34:42 [ERROR] Do you already have another mysqld server running on socket: /tmp/mysql.sock ?
110106  4:34:42 [ERROR] Aborting
110106  4:34:42 [Note] /usr/local/mysql/libexec/mysqld: Shutdown complete
110106 04:34:42 mysqld_safe mysqld from pid file /usr/local/mysql/var/server.rufuit.com.pid ended
110106 04:34:43 mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/var
110106  4:34:43 [ERROR] Can't start server : Bind on unix socket: Permission denied
110106  4:34:43 [ERROR] Do you already have another mysqld server running on socket: /tmp/mysql.sock ?
110106  4:34:43 [ERROR] Aborting
110106  4:34:43 [Note] /usr/local/mysql/libexec/mysqld: Shutdown complete
110106 04:34:43 mysqld_safe mysqld from pid file /usr/local/mysql/var/server.rufuit.com.pid ended
110106 04:53:37 mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/var
110106  4:53:37 [ERROR] Can't start server : Bind on unix socket: Permission denied
110106  4:53:37 [ERROR] Do you already have another mysqld server running on socket: /tmp/mysql.sock ?
110106  4:53:37 [ERROR] Aborting
110106  4:53:37 [Note] /usr/local/mysql/libexec/mysqld: Shutdown complete
110106 04:53:37 mysqld_safe mysqld from pid file /usr/local/mysql/var/server.rufuit.com.pid ended
110106 04:53:40 mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/var
110106  4:53:40 [ERROR] Can't start server : Bind on unix socket: Permission denied
110106  4:53:40 [ERROR] Do you already have another mysqld server running on socket: /tmp/mysql.sock ?
110106  4:53:40 [ERROR] Aborting
110106  4:53:40 [Note] /usr/local/mysql/libexec/mysqld: Shutdown complete
110106 04:53:40 mysqld_safe mysqld from pid file /usr/local/mysql/var/server.rufuit.com.pid ended
110106 04:56:31 mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/var
110106  4:56:31 [ERROR] Can't start server : Bind on unix socket: Permission denied
110106  4:56:31 [ERROR] Do you already have another mysqld server running on socket: /tmp/mysql.sock ?
110106  4:56:31 [ERROR] Aborting
110106  4:56:31 [Note] /usr/local/mysql/libexec/mysqld: Shutdown complete
110106 04:56:31 mysqld_safe mysqld from pid file /usr/local/mysql/var/server.rufuit.com.pid ended
110106 04:57:05 mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/var
110106  4:57:05 [ERROR] Can't start server : Bind on unix socket: Permission denied
110106  4:57:05 [ERROR] Do you already have another mysqld server running on socket: /tmp/mysql.sock ?
110106  4:57:05 [ERROR] Aborting
110106  4:57:05 [Note] /usr/local/mysql/libexec/mysqld: Shutdown complete
110106 04:57:05 mysqld_safe mysqld from pid file /usr/local/mysql/var/server.rufuit.com.pid ended
110106 05:15:12 mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/var
110106  5:15:12 [ERROR] Can't start server : Bind on unix socket: Permission denied
110106  5:15:12 [ERROR] Do you already have another mysqld server running on socket: /tmp/mysql.sock ?
110106  5:15:12 [ERROR] Aborting
110106  5:15:12 [Note] /usr/local/mysql/libexec/mysqld: Shutdown complete
110106 05:15:12 mysqld_safe mysqld from pid file /usr/local/mysql/var/server.rufuit.com.pid ended
110106 05:15:14 mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/var
110106  5:15:14 [ERROR] Can't start server : Bind on unix socket: Permission denied
110106  5:15:14 [ERROR] Do you already have another mysqld server running on socket: /tmp/mysql.sock ?
110106  5:15:14 [ERROR] Aborting
110106  5:15:14 [Note] /usr/local/mysql/libexec/mysqld: Shutdown complete
110106 05:15:14 mysqld_safe mysqld from pid file /usr/local/mysql/var/server.rufuit.com.pid ended
110106 05:20:26 mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/var
110106  5:20:26 [ERROR] Can't start server : Bind on unix socket: Permission denied
110106  5:20:26 [ERROR] Do you already have another mysqld server running on socket: /tmp/mysql.sock ?
110106  5:20:26 [ERROR] Aborting
110106  5:20:26 [Note] /usr/local/mysql/libexec/mysqld: Shutdown complete
110106 05:20:26 mysqld_safe mysqld from pid file /usr/local/mysql/var/server.rufuit.com.pid ended
110106 05:53:10 mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/var
110106  5:53:10 [ERROR] Can't start server : Bind on unix socket: Permission denied
110106  5:53:10 [ERROR] Do you already have another mysqld server running on socket: /tmp/mysql.sock ?
110106  5:53:10 [ERROR] Aborting
110106  5:53:10 [Note] /usr/local/mysql/libexec/mysqld: Shutdown complete
110106 05:53:10 mysqld_safe mysqld from pid file /usr/local/mysql/var/server.rufuit.com.pid ended
110106 05:53:11 mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/var
110106  5:53:11 [ERROR] Can't start server : Bind on unix socket: Permission denied
110106  5:53:11 [ERROR] Do you already have another mysqld server running on socket: /tmp/mysql.sock ?
110106  5:53:11 [ERROR] Aborting
110106  5:53:11 [Note] /usr/local/mysql/libexec/mysqld: Shutdown complete
110106 05:53:11 mysqld_safe mysqld from pid file /usr/local/mysql/var/server.rufuit.com.pid ended
110106 06:03:41 mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/var
110106  6:03:42 [ERROR] Can't start server : Bind on unix socket: Permission denied
110106  6:03:42 [ERROR] Do you already have another mysqld server running on socket: /tmp/mysql.sock ?
110106  6:03:42 [ERROR] Aborting
110106  6:03:42 [Note] /usr/local/mysql/libexec/mysqld: Shutdown complete
110106 06:03:42 mysqld_safe mysqld from pid file /usr/local/mysql/var/server.rufuit.com.pid ended
110106 10:24:01 mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/var
110106 10:24:01 [ERROR] Can't start server : Bind on unix socket: Permission denied
110106 10:24:01 [ERROR] Do you already have another mysqld server running on socket: /tmp/mysql.sock ?
110106 10:24:01 [ERROR] Aborting
110106 10:24:01 [Note] /usr/local/mysql/libexec/mysqld: Shutdown complete
110106 10:24:01 mysqld_safe mysqld from pid file /usr/local/mysql/var/server.rufuit.com.pid ended
110106 10:33:57 mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/var
110106 10:33:58 [ERROR] Can't start server : Bind on unix socket: Permission denied
110106 10:33:58 [ERROR] Do you already have another mysqld server running on socket: /tmp/mysql.sock ?
110106 10:33:58 [ERROR] Aborting
110106 10:33:58 [Note] /usr/local/mysql/libexec/mysqld: Shutdown complete
110106 10:33:58 mysqld_safe mysqld from pid file /usr/local/mysql/var/server.rufuit.com.pid ended

[ 本帖最后由 kobebeef 于 2011-1-6 16:27 编辑 ]
发表于 2011-1-6 16:30:53 | 显示全部楼层

回复 6# 的帖子


可能已经有一个mysql在运行,执行ps aux 看一下有mysql的进程不
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
 楼主| 发表于 2011-1-6 16:31:57 | 显示全部楼层

[root@server ~]#ps aux
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
root         1  0.0  0.0  10304   784 ?        Ss   10:57   0:00 init [3]
root         2  0.0  0.0      0     0 ?        S<   10:57   0:00 [migration/0]
root         3  0.0  0.0      0     0 ?        SN   10:57   0:00 [ksoftirqd/0]
root         4  0.0  0.0      0     0 ?        S<   10:57   0:00 [watchdog/0]
root         5  0.0  0.0      0     0 ?        S<   10:57   0:00 [events/0]
root         6  0.0  0.0      0     0 ?        S<   10:57   0:00 [khelper]
root         7  0.0  0.0      0     0 ?        S<   10:57   0:00 [kthread]
root         9  0.0  0.0      0     0 ?        S<   10:57   0:00 [xenwatch]
root        10  0.0  0.0      0     0 ?        S<   10:57   0:00 [xenbus]
root        15  0.0  0.0      0     0 ?        S<   10:57   0:00 [migration/1]
root        16  0.0  0.0      0     0 ?        SN   10:57   0:00 [ksoftirqd/1]
root        17  0.0  0.0      0     0 ?        S<   10:57   0:00 [watchdog/1]
root        18  0.0  0.0      0     0 ?        S<   10:57   0:00 [events/1]
root        19  0.0  0.0      0     0 ?        S<   10:57   0:00 [migration/2]
root        20  0.0  0.0      0     0 ?        SN   10:57   0:00 [ksoftirqd/2]
root        21  0.0  0.0      0     0 ?        S<   10:57   0:00 [watchdog/2]
root        22  0.0  0.0      0     0 ?        S<   10:57   0:00 [events/2]
root        23  0.0  0.0      0     0 ?        S<   10:57   0:00 [migration/3]
root        24  0.0  0.0      0     0 ?        SN   10:57   0:00 [ksoftirqd/3]
root        25  0.0  0.0      0     0 ?        S<   10:57   0:00 [watchdog/3]
root        26  0.0  0.0      0     0 ?        S<   10:57   0:00 [events/3]
root        31  0.0  0.0      0     0 ?        S<   10:57   0:00 [kblockd/0]
root        32  0.0  0.0      0     0 ?        S<   10:57   0:00 [kblockd/1]
root        33  0.0  0.0      0     0 ?        S<   10:57   0:00 [kblockd/2]
root        34  0.0  0.0      0     0 ?        S<   10:57   0:00 [kblockd/3]
root        35  0.0  0.0      0     0 ?        S<   10:57   0:00 [cqueue/0]
root        36  0.0  0.0      0     0 ?        S<   10:57   0:00 [cqueue/1]
root        37  0.0  0.0      0     0 ?        S<   10:57   0:00 [cqueue/2]
root        38  0.0  0.0      0     0 ?        S<   10:57   0:00 [cqueue/3]
root        42  0.0  0.0      0     0 ?        S<   10:57   0:00 [khubd]
root        44  0.0  0.0      0     0 ?        S<   10:57   0:00 [kseriod]
root       125  0.0  0.0      0     0 ?        S    10:57   0:00 [khungtaskd]
root       126  0.0  0.0      0     0 ?        S    10:57   0:00 [pdflush]
root       127  0.0  0.0      0     0 ?        S    10:57   0:00 [pdflush]
root       128  0.0  0.0      0     0 ?        S<   10:57   0:00 [kswapd0]
root       129  0.0  0.0      0     0 ?        S<   10:57   0:00 [aio/0]
root       130  0.0  0.0      0     0 ?        S<   10:57   0:00 [aio/1]
root       131  0.0  0.0      0     0 ?        S<   10:57   0:00 [aio/2]
root       132  0.0  0.0      0     0 ?        S<   10:57   0:00 [aio/3]
root       262  0.0  0.0      0     0 ?        S<   10:57   0:00 [kpsmoused]
root       321  0.0  0.0      0     0 ?        S<   10:57   0:00 [kstriped]
root       347  0.0  0.0      0     0 ?        S<   10:57   0:00 [kjournald]
root       418  0.0  0.1  16912  1136 ?        S<s  10:57   0:00 udevd --daemon
root       882  0.0  0.1 127716  1464 ?        Sl   10:57   0:00 /usr/sbin/rsyslogd -
root       923  0.0  0.1  48856  1196 ?        Ss   10:57   0:00 /usr/sbin/sshd
101       1201  0.0  0.0  40660  1012 ?        Ss   10:58   0:00 /usr/sbin/exim4 -bd
root      1401  0.0  0.5 110628  5500 ?        Ss   10:58   0:00 /usr/local/php/bin/p
www       1402  0.0  1.0 112004 10688 ?        S    10:58   0:00 /usr/local/php/bin/p
www       1403  0.0  0.7 110408  7592 ?        S    10:58   0:00 /usr/local/php/bin/p
www       1404  0.0  0.8 112748  9060 ?        S    10:58   0:00 /usr/local/php/bin/p
www       1405  0.0  0.9 112760 10148 ?        S    10:58   0:00 /usr/local/php/bin/p
www       1406  0.0  0.7 110680  8380 ?        S    10:58   0:00 /usr/local/php/bin/p
root      1408  0.0  0.0  27572   880 ?        Ss   10:58   0:00 nginx: master proces
www       1411  0.0  2.0  47680 21372 ?        S    10:58   0:00 nginx: worker proces
ntp       1417  0.0  0.1  22372  1392 ?        Ss   10:58   0:00 /usr/sbin/ntpd -p /v
root      1437  0.0  0.0  18540   924 ?        Ss   10:58   0:00 /usr/sbin/cron
root      1633  0.0  0.1  17468  1620 ?        Ss   10:58   0:00 /bin/sh
root      1634  0.0  0.2  66064  3112 ?        Ss   10:58   0:00 sshd: root@pts/0
root      1636  0.0  0.1  17508  1828 pts/0    Ss   10:59   0:00 -bash
root      1646  0.0  0.2  66056  3112 ?        Ss   11:00   0:00 sshd: root@notty
root      1649  0.0  0.1  42084  1912 ?        Ss   11:01   0:00 /usr/lib/openssh/sft
root      2115  0.0  0.2  65920  3084 ?        Ss   11:06   0:00 sshd: root@pts/1
root      2117  0.0  0.1  17492  1736 pts/1    Ss   11:06   0:00 -bash
root      2352  0.0  0.1   8880  1264 ?        S    11:10   0:00 /bin/sh /usr/bin/mys
mysql     2366  0.0  1.4  58288 15156 ?        Sl   11:10   0:00 /usr/sbin/mysqld --b
root      2367  0.0  0.0   3772   636 ?        S    11:10   0:00 logger -p daemon.err
root      2628  0.0  0.1  21516  1368 ?        S    11:11   0:00 /usr/sbin/vsftpd
root      2629  0.0  0.2  26832  2316 pts/0    S+   11:11   0:00 vi /etc/vsftpd.conf
nobody    2632  0.0  0.1  27784  1056 ?        Ss   11:11   0:00 /usr/sbin/vsftpd
ftp       2634  0.0  0.0  27808   912 ?        S    11:11   0:00 /usr/sbin/vsftpd
root      2638  0.0  0.0  14720   984 pts/1    R+   11:13   0:00 ps aux
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
发表于 2011-1-6 16:54:37 | 显示全部楼层

回复 8# 的帖子


原来通过yum 安装过mysql,执行service mysqld stop
然后yum remove mysql mysql-server
再/root/lnmp restart试试

军哥运维代购:http://shop63846532.taobao.com/

 楼主| 发表于 2011-1-6 16:57:19 | 显示全部楼层



[root@server ~]#service mysqld stop
-bash: service: command not found
[root@server ~]#yum remove mysql mysql-server
-bash: yum: command not found
[root@server ~]#
发表于 2011-1-6 17:09:03 | 显示全部楼层

/etc/init.d/mysqld stop

apt-get remove mysql-server
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|Archiver|VPS侦探 ( 鲁ICP备16040043号-1 )

GMT+8, 2024-11-18 05:36 , Processed in 0.030050 second(s), 17 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表