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
nginx
啟動
systemctl start nginx
停止
systemctl stop nginx
重啟
systemctl restart nginx
            
            
                或者
            
service nginx stop
service nginx start
service nginx restart
            
                開機自啟
            
            
                chkconfig httpd on
            
            
                chkconfig mysqld on
 
            
            
                 
            
            
                一、MySQL啟動方式
            
            
                
                    
                        
                            | 
                                 
                                    1
                                 
                                
                                    2
                                 
                                
                                    3
                                 
                                
                                    4
                                 
                                
                                    5
                                 
                             | 
                            
                                 
                                    1、使用 service 啟動:service mysqld start
                                 
                                
                                     
                                 
                                
                                    2、使用 mysqld 腳本啟動:/etc/init.d/mysqld start
                                 
                                
                                     
                                 
                                
                                    3、使用 safe_mysqld 啟動:safe_mysqld&
                                 
                             | 
                        
                    
                
             
            
                二、MySQL停止
            
            
                
                    
                        
                            | 
                                 
                                    1
                                 
                                
                                    2
                                 
                                
                                    3
                                 
                                
                                    4
                                 
                                
                                    5
                                 
                             | 
                            
                                 
                                    1、使用 service 啟動:   service mysqld stop
                                 
                                
                                     
                                 
                                
                                    2、使用 mysqld 腳本啟動:/etc/init.d/mysqld stop
                                 
                                
                                     
                                 
                                
                                    3、mysqladmin shutdown
                                 
                             | 
                        
                    
                
             
            
                三、MySQL重啟
            
            
                
                    
                        
                            | 
                                 
                                    1
                                 
                                
                                    2
                                 
                                
                                    3
                                 
                             | 
                            
                                 
                                    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
            
            
                 
            
            
                 
            
            
                卸載PHP
            
            
                yum remove php
yum remove php*
yum remove php-*
yum remove php7
yum remove php70
yum remove php7.0
yum remove php-common
這才是苦大仇深卸載個干干凈凈= w
            
            
                 
            
            
                 
            
            
            
                默認的版本太低了,手動安裝有一些麻煩,想采用Yum安裝的可以使用下面的方案:
            
            
                1.檢查當前安裝的PHP包
            
            
                yum list installed | grep php
            
            
                如果有安裝的PHP包,先刪除他們
            
            
                 yum remove php.x86_64 php-cli.x86_64 php-common.x86_64 php-gd.x86_64 php-ldap.x86_64 php-mbstring.x86_64 php-mcrypt.x86_64 php-mysql.x86_64 php-pdo.x86_64
            
            
                2.Centos 5.X
            
            
                  rpm -Uvh http://mirror.webtatic.com/yum/el5/latest.rpm
  CentOs 6.x
  rpm -Uvh http://mirror.webtatic.com/yum/el6/latest.rpm
  CentOs 7.X
rpm -Uvh https://mirror.webtatic.com/yum/el7/epel-release.rpm
rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
            
            
                如果想刪除上面安裝的包,重新安裝
rpm -qa | grep webstatic
rpm -e  上面搜索到的包即可
3.運行yum install
            
            
                  yum install php55w.x86_64 php55w-cli.x86_64 php55w-common.x86_64 php55w-gd.x86_64 php55w-ldap.x86_64 php55w-mbstring.x86_64 php55w-mcrypt.x86_64 php55w-mysql.x86_64 php55w-pdo.x86_64
 
            
            
                yum install php56w.x86_64 php56w-cli.x86_64 php56w-common.x86_64 php56w-gd.x86_64 php56w-ldap.x86_64 php56w-mbstring.x86_64 php56w-mcrypt.x86_64 php56w-mysql.x86_64 php56w-pdo.x86_64
            
            
                
注:如果想升級到5.6把上面的55w換成56w就可以了。
yum install php70w.x86_64 php70w-cli.x86_64 php70w-common.x86_64 php70w-gd.x86_64 php70w-ldap.x86_64 php70w-mbstring.x86_64 php70w-mcrypt.x86_64 php70w-mysql.x86_64 php70w-pdo.x86_64
4.安裝PHP FPM
            
            
                yum install php55w-fpm 
yum install php56w-fpm 
yum install php70w-fpm
注:如果想升級到5.6把上面的55w換成56w就可以了。
            
            
                nginx重啟不了