centos6.8上PHP5.3升級到PHP5.4及更高版本方法

來源:互聯網
上載者:User

標籤:errors   imap   update   安裝mysql   map   its   oar   輸入   path   


執行命令下載、安裝yum源,當前是針對Centos6並且64位版本的源:

[[email protected]_249 yum.repos.d]# rpm -ivh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm[[email protected]_249 yum.repos.d]# rpm -ivh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm

編輯[remi.repo]下的enabled選項從0設為1

[[email protected]_249 yum.repos.d]# sed -i ‘/enabled/s/=0/=1/g‘ /etc/yum.repos.d/remi.repo 

運行如下命令

[[email protected]_249 yum.repos.d]# yum clean all[[email protected]_249 yum.repos.d]# yum makecache 

安裝php5.4

[[email protected]_249 yum.repos.d]# yum install php54 php54-php-devel php54-php-mysql* php54-php-gd php54-php-fpm php54-php-mbstring

如果安裝php5.5

[[email protected]_249 yum.repos.d]# yum install php55 php55-php-devel php55-php-mysql* php55-php-gd php55-php-fpm php55-php-mbstring

目前可以安裝到php7.0
查看所有支援版本

[[email protected]_249 yum.repos.d]# yum list php* |grep php-develphp-devel.x86_64                          5.3.3-46.el6_6          @updates      php54-php-devel.x86_64                    5.4.45-2.el6.remi       @remi         php-devel.x86_64                          5.6.15-1.el6.remi       remi-php56    php55-php-devel.x86_64                    5.5.30-1.el6.remi       remi          php56-php-devel.x86_64                    5.6.16-0.1.RC1.el6.remi remi-test     php70-php-devel.x86_64                    7.0.0-0.25.RC8.el6.remi remi    

運行如下命令[yum update PHP*],則直接升級到php5.6

安裝運行yum報錯解決方案:
Error: Cannot retrieve metalink for repository: epel. Please verify its path and try again

編輯[epel.repo]下的baseurl前的#號去掉,mirrorlist前添加#號

[[email protected]_249 yum.repos.d]# sed ‘s/#baseurl=/baseurl=/g;s/mirrorlist=/#mirrorlist=/g‘ /etc/yum.repos.d/epel.repo
1.安裝php
yum install php -y

   2.安裝PHP組件,使PHP支援MySQL,輸入命令:

yum install php-mysql php-gd libjpeg* php-imap php-ldap php-odbc php-pear php-xml php-xmlrpc php-mbstring php-mcrypt php-bcmath php-mhash libmcrypt -y

3.在/etc目錄中找到php.ini檔案,下載到本地,使用Notepad++開啟。

expose_php = Off #禁止顯示php版本的資訊display_errors = OFF #關閉錯誤提示register_globals = OFF #關閉註冊全域變數magic_quotes_gpc = On #開啟magic_quotes_gpc來防止SQL注入log_errors = On #記錄錯誤記錄檔
4.安裝mysql:
yum install mysql mysql-server
啟動mysql:
/etc/init.d/mysqld start   建議開機啟動chkconfig --level 3 mysqld  on

開連接埠:

  /sbin/iptables -I INPUT -p tcp --dport 80 -j ACCEPT cantos 6.9開啟80連接埠
  /etc/rc.d/init.d/iptables save 儲存

  vi /etc/selinux/config
  #SELINUX=enforcing #注釋掉
  #SELINUXTYPE=targeted #注釋掉
  SELINUX=disabled #增加

centos6.8上PHP5.3升級到PHP5.4及更高版本方法

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.