centos7重启php环境

apache
启动
systemctl start httpd
停止
systemctl stop httpd
重启
systemctl restart httpd
或者

service httpd stop

service httpd start

service httpd restart

-------------------------------------------------------
mysql
启动
systemctl start mysqld
停止
systemctl stop mysqld
重启
systemctl restart mysqld

或者

service mysqld stop

service mysqld start

service mysqld restart

-----------------------------------------------------

php-fpm
启动
systemctl start php-fpm
停止
systemctl stop php-fpm
重启
systemctl restart php-fpm

或者可以服务的方式启动、停止和重启:
service php-fpm start
service php-fpm stop
service php-fpm reload

---------------------------------------------------------
nginx
启动
systemctl start nginx
停止
systemctl stop nginx
重启
systemctl restart nginx

或者

service nginx stop
service nginx start
service nginx restart

传统方法

一、启动

cd usr/local/nginx/sbin

./nginx

二、重启

更改配置重启nginx

kill -HUP 主进程号或进程号文件路径

或者使用

cd /usr/local/nginx/sbin

./nginx -s reload

判断配置文件是否正确

nginx -t -c /usr/local/nginx/conf/nginx.conf

或者

cd  /usr/local/nginx/sbin

./nginx -t

三、关闭

查询nginx主进程号

ps -ef | grep nginx

从容停止   kill -QUIT 主进程号

快速停止   kill -TERM 主进程号

强制停止   kill -9 nginx

若nginx.conf配置了pid文件路径,如果没有,则在logs目录下

kill -信号类型 '/usr/local/nginx/logs/nginx.pid'

------------------------------------------------------------
开机自启

chkconfig httpd on

chkconfig mysqld on
-----------------------------------------------------------

一、MySQL启动方式

1、使用 service 启动:service mysqld start

2、使用 mysqld 脚本启动:/etc/init.d/mysqld start

3、使用 safe_mysqld 启动:safe_mysqld&

二、MySQL停止

1、使用 service 启动:   service mysqld stop

2、使用 mysqld 脚本启动:/etc/init.d/mysqld stop

3、mysqladmin shutdown

三、MySQL重启

1、使用 service 启动:service mysqld restart

2、使用 mysqld 脚本启动:/etc/init.d/mysqld restart

四、强制关闭

以上方法都无效的时候,可以通过强行命令:“killall mysql”来关闭MySQL,但是不建议用这样的方式,因为这种野蛮的方法会强行终止MySQL数据库服务,有可能导致表损坏……所以自己掂量着用。

Windows下重启MySQL服务,对于没装mysql图形管理端的用户来说启动和停止mysql服务:
…\…\bin>net stop mysql
…\…\bin>net start mysql

转载于:https://my.oschina.net/u/3194172/blog/3031189

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值