天天看點

php 環境搭建 linux下

1.安裝mysql

yum install mysql-server –y

2.安裝apache

yum install httpd –y

3.安裝php子產品

yum install php-mysql php-gd php-imap php-odbc php-pear php-xml php-xmlrpc php-mcrypt php-mbstring –y

4.配置apache

vi /etc/httpd/conf/httpd.conf

directoryindex index.php index.html index.html.var

5.配置php

vi /etc/php.ini

memory_limit=128m

post_max_size=8m

upload_max_filesize=2m

6.mysql、apache2自動啟動

chkconfig mysqld on

chkconfig httpd on

7.啟動mysql、apache2

service mysqld start

service httpd start

8.停止mysql、apache2

service mysqld stop

service httpd stop

mysql修改密碼

mysqladmin -uroot password root

繼續閱讀