ubuntu10.10 搭建LAMP

来源:互联网 发布:图片展示类cms系统 编辑:程序博客网 时间:2024/05/17 23:41

1.install mysql
  apt-get install mysql-server mysql-client
  While installing, it will promot you to set the password of root user, for example nopasswd, then after it finished, use this instruction to test whether the mysql server is running
    netstat -tap | grep mysql
     if it display
     tcp 0 0 localhost.localdomain:mysql *:* LISTEN -,
     it means the mysql server is running, if not,execute
    /etc/init.d/mysql restart
     to start the mysql.Execute
    mysql -u -root -p
     it will let you input the password of root user, after input the root user, execute
    grant all privileges on *.* to 'xiao'@'%' identified by 'xiaoxiao' with grant option;
     to make the changes take effect instantlly,then execute
    flush privileges;
     to create a user xiao, then execute
    create database androidDatabase
     then
    use androidDatabase
     then
    create table androidTable(xiao varchar(30), content varchar(30));
     then insert into androidTable values("xiao","xiaoxiao");
2.install apache
  apt-get install apache2
3.install php
  apt-get install php5
3.touch a file named test.php in /tmp/www/ and input <?php echo phpinfo();?>, if it will shows the php version information.
4.touch a file named ConnectDatabase.php, it occurs an error that Call to undefined function mysql_connect(), execute
    apt-get install php5-mysql
    and
    /etc/init.d/apache2 start.
The install is over.

原创粉丝点击