yum安装LAMP环境与管理,yumlamp环境_PHP教程
yum安装LAMP环境与管理,yumlamp环境
准备环境
yum添加163源
地址:
http://mirrors.163.com/.help/centos.html
下载方式:
wget http://mirrors.163.com/.help/CentOS6-Base-163.repo
使用 yum 程序安装所需开发包(以下为标准的rpm包名称)
yum install gcc gcc-c++ gcc-g77 flex bison autoconf automake bzip2-devel
zlib-devel ncurses-devel libjpeg-devel libpng-devel libtiff-devel
freetype-devel pam-devel openssl-devel libxml2-devel gettext-devel pcre-devel mysql-devel net-snmp-devel
curl-devel perl-DBI
安装mysql
yum -y install mysql mysql-server
自启动:
chkconfig --level 235 mysqld on
启动服务:
/etc/init.d/mysqld start
配置mysql的密码:
mysqladmin -u root password 123456 (自行修改!!)
mysql的配置文件:
/etc/my.cnf
安装apache
yum -y install httpd
自启动:
chkconfig --level 235 httpd on
启动服务:
/etc/init.d/httpd start
apache的web存放目录:
/var/www/html
apache的配置文件:
/etc/httpd/conf/httpd.conf
Listen 80
ServerName 127.0.0.1:80
DocumentRoot “/var/www/html”
DirectoryIndex index.php index.html index.html.var
安装php
yum -y install php
重启httpd服务激活php:
/etc/init.d/httpd restart
测试php是否安装完成
vim /var/www/html/info.php
phpinfo();
?>
安装php的组件
搜索php组件:
yum search php
安装常用组件:
yum -y install php-mysql php-gd php-imap php-ldap php-odbc php-pear php-xml
php-xmlrpc php-bcmath php-mbstring
记得安装完要重启httpd服务激活组件:
/etc/init.d/httpd restart
php配置文件:
vi /etc/php.ini
memory_limit=128M
post_max_size=8M
upload_max_filesize=2M
一条命令安装:
yum -y install gcc gcc-c++ gcc-g77 flex bison autoconf automake bzip2-devel zlib-devel ncurses-devel libjpeg-devel libpng-devel libtiff-devel freetype-devel pam-devel openssl-devel libxml2-devel gettext-devel pcre-devel mysql-devel net-snmp-devel curl-devel perl-DBI mysql mysql-server httpd php php-mysql php-gd php-imap php-ldap php-odbc php-pear php-xml php-xmlrpc php-bcmath php-mbstring
然后配置 mysql密码和更改apache配置文件即可。
上一篇: 字符串相等原因
推荐阅读
-
yum安装LAMP环境与管理,yumlamp环境_PHP教程
-
yum安装LAMP环境与管理,yumlamp环境
-
php环境配置 php5 MySQL5 apache2 phpmyadmin安装与配置图文教程
-
在CentOS6.4中安装配置LAMP环境的详细步骤_PHP教程
-
php环境配置 php5 mysql5 apache2 phpmyadmin安装与配置_PHP教程
-
Ubuntu14下LAMP环境的安装以及yaf扩展的安装,ubuntu14yaf_PHP教程
-
CentOS 5.5使用yum来安装LAMP(php运行环境)
-
centos下yum搭建安装linux+apache+mysql+php环境教程
-
Centos7.4环境安装lamp-php7.0教程
-
CentOS 5.5使用yum来安装LAMP(php运行环境)