继续浏览精彩内容
慕课网APP
程序员的梦工厂
打开
继续
感谢您的支持,我会继续努力的
赞赏金额会直接到老师账户
将二维码发送给自己后长按识别
微信支付
支付宝支付

CentOS yum 安装 Apache + PHP + MySQL

米琪卡哇伊
关注TA
已关注
手记 199
粉丝 4
获赞 28

# 编写本地yum仓库

rm -rf /etc/yum.repos.d/*

cd /etc/yum.repos.d/

cat > local.repo <<end

[local]

name=qiqi

baseurl=file:///media/RHEL_6.1\ i386\ Disc\ 1/

enabled=1

gpgcheck=0

end

# 检查并卸载

rpm -qa|grep httpd

rpm -e httpd

rpm -qa|grep mysql

rpm -e mysql

rpm -qa|grep php

rpm -e php


# 删除默认的Apache

yum -y remove httpd


# 查找最快的源

yum -y install yum-fastestmirror


# 更新

yum -y update


# 安装必要的组件

yum -y install patch make gcc gcc-c++ gcc-g77 flex bison file

yum -y install libtool libtool-libs autoconf kernel-devel

yum -y install libjpeg libjpeg-devel libpng libpng-devel libpng10 libpng10-devel gd gd-devel

yum -y install freetype freetype-devel libxml2 libxml2-devel zlib zlib-devel

yum -y install glib2 glib2-devel bzip2 bzip2-devel libevent libevent-devel

yum -y install ncurses ncurses-devel curl curl-devel e2fsprogs

yum -y install e2fsprogs-devel krb5 krb5-devel libidn libidn-devel

yum -y install openssl openssl-devel vim-minimal nano sendmail

yum -y install fonts-chinese gettext gettext-devel

yum -y install ncurses-devel

yum -y install gmp-devel pspell-devel

yum -y install unzip


# 安装Apache+MySQL+PHP

yum -y install httpd php mysql mysql-server php-mysql


# 启动httpd服务

/sbin/service httpd start


# 启动mysql服务

/sbin/service mysqld start


# 设置mysql数据库root帐号密码,引号内填密码

mysqladmin -u root password ‘123’


# 默认站点目录为/var/www/html/


# 安装apache扩展

yum -y install httpd-manual mod_ssl mod_perl mod_auth_mysql

# 安装php的扩展

yum install php-gd

yum -y install php-gd php-xml php-mbstring php-ldap php-pear php-xmlrpc

# 安装mysql扩展

yum -y install mysql-connector-odbcmysql-devel libdbi-dbd-mysql


打开App,阅读手记
0人推荐
发表评论
随时随地看视频慕课网APP