1. 程式人生 > >linux 安裝apache ,php,mysql

linux 安裝apache ,php,mysql

1、安裝apache

使用yum命令安裝Apache

yum –y install httpd

設定開機啟動Apache

chkconfig --levels 235 httpd on

啟動Apache

service httpd start |restart

2、安裝php

檢視安裝的php版本,yum list installed | grep php 

如果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  


追加CentOS 6.5的epel及remi源。

rpm -Uvh http://ftp.iij.ad.jp/pub/linux/fedora/epel/6/x86_64/epel-release-6-8.noarch.rpm


rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm

安裝php5.6及擴充套件


yum install --enablerepo=remi --enablerepo=remi-php56 php php-opcache php-devel php-mbstring php-mcrypt php-mysqlnd php-phpunit-PHPUnit php-pecl-xdebug php-pecl-xhprof