linux lamp
1. 用yum安装Apache,Mysql,PHP. 1.1安装Apache yum install httpd httpd-devel 安装完成后,用/etc/init.d/httpd start 启动apache 设为开机启动:chkconfig httpd on 1.2 安装mysql 1.2.1 yum install mysql mysql-server mysql-devel 同样,完成后,用/etc/init.d/mysqld start 启动mysql 1.2.2 设置mysql密码
mysqladmin -u root password "123456"
1.2.4 设为开机启动 chkconfig mysqld on 2. 安装php
[root@CentOS ~]# yum install php lighttpd-fastcgi php-cli php-mysql php-gd php-imap php-ldap \
php-odbc php-pear php-xml \ php-xmlrpc php-mbstring php-mcrypt \ php-mssql php-snmp php-soap \
php-tidy php-common \ php-devel php-fpm
//安装php和所需组件使PHP支持MySQL、FastCGI模式
[root@CentOS ~]# service php-fpm start
[root@CentOS ~]# chkconfig --levels 235 php-fpm on 3. 测试一下 3.1在/var/www/html/新建个test.php文件,将以下内容写入,然后保存。 <?php echo phpinfo(); ?>
localhost/test.php