DEBIAN 下安装 PHP5+mysql+APACHE2

来源:互联网 发布:推广淘宝店铺帖子范文 编辑:程序博客网 时间:2024/05/21 01:30
根据网上介绍:

2、apt-get  install  php5


      apt-get  install   apache2


      apt-get  install    mysql-server   mysql-client 


       apt-get  install  php5-mysql  php5-curl  php5-gd


       dpkg  -l  'php5-*'


       aptitude  install  libapache2-mod-php5  php5-mysql


3、/etc/apache2/httdpd.conf 添加:


      AddType  application/x-httpd-php  .php


      AddType  application/x-httpd-php-source  .phps


4、ln  -s  /etc/apache2/mods-available/php5.*  /etc/apache2//mods-enabled


5、apt-get  install  apache2-mpm-prefork


6、/etc/init.d/apache2  restart


安装完之后,发现mysql的密码不知道怎么竟然不为空,只好再进行手动设置mysql的密码了.:

# /etc/init.d/mysql stop
# mysqld_safe --user=mysql --skip-grant-tables --skip-networking &
# mysql -u root mysql
mysql> UPDATE user SET Password=PASSWORD('newpassword') where USER='root';
mysql> FLUSH PRIVILEGES;
mysql> quit
# /etc/init.d/mysql restart

终于可以进入mysql了.

 
原创粉丝点击