安装httpd mysql mysql-server php:
yum install -y httpd mysql mysql-server php php-devel
安装php的扩展
yum install -y php-mysql php-gd php-imap php-ldap php-odbc php-pear php-xml php-xmlrpc php-mbstring
启动apache、mysql:
/etc/init.d/httpd start/etc/init.d/mysqld startchkconfig httpd onchkconfig mysqld on
初始化数据库:
$ mysql_secure_installationEnter current password for rootSet root password? [Y/n]New password:Remove anonymous users? [Y/n] yDisallow root login remotely? [Y/n] nRemove test database and access to it? [Y/n] yReload privilege tables now? [Y/n] 回车
新建一个 PHP 页面进行测试:
$ vi /var/www/html/info.php
重启httpd服务:
/etc/init.d/httpd restart
访问测试地址:http://ip/info.php
部署过程遇到的问题:php网页空白。
解决方法:修改相应文件读写权限:
chmod -R 777 /var/www/html/test/config/