在linux中使用yum安裝php+mysql數據庫小編整理的文章有很多了,下文一聚教程小編再來為各位整理一篇相關文章,希望對各位有幫助.
系統:centos 5.x
需要軟件包:epel-release-5-4.noarch.rpm、remi-release-5.rpm
1.安裝準備
- ##Install Remi Repository on RHEL/CentOS 5.0-5.9 - 32 Bit ##
- rpm -Uvh http://dl.fedoraproject.org/pub/epel/5/i386/epel-release-5-4.noarch.rpm
- rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-5.rpm
- ##Install Remi Repository on RHEL/CentOS 5.0-5.9 - 64 Bit ##
- rpm -Uvh http://dl.fedoraproject.org/pub/epel/5/x86_64/epel-release-5-4.noarch.rpm
- rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-5.rpm
2.安裝apche php mysql
yum --enablerepo=remi,remi-test install httpd mysql mysql-server php php-common -y
3.安裝apache擴展
yum --enablerepo=remi,remi-test install httpd-manual mod_ssl mod_perl mod_auth_mysql httpd-devel -y
4.安裝php擴展
- yum --enablerepo=remi,remi-test install php-mysql php-pgsql php-pecl-mongo php-sqlite /
- php-pecl-memcache php-pecl-memcached php-gd php-mbstring php-mcrypt php-xml php-pecl-apc php-cli / --Vevb.com
- php-pear php-pdo
5.安裝mysql擴展
yum --enablerepo=remi,remi-test install mysql-connector-odbc mysql-devel libdbi-dbd-mysql
6.啟動并驗證
- service mysqld start
- service httpd start
- chkconfig httpd on
- chkconfig mysqld on
- httpd -v
- Server version: Apache/2.2.3
- Server built: Sep 16 2014 11:05:09
- php -v
- PHP 5.4.40 (cli) (built: Apr 15 2015 16:05:43)
- Copyright (c) 1997-2014 The PHP Group
- Zend Engine v2.4.0, Copyright (c) 1998-2014 Zend Technologies
- mysql -V
- mysql Ver 14.14 Distrib 5.5.43, for Linux (x86_64) using readline 5.1
好了,這樣就可以了,安裝結束.
新聞熱點
疑難解答