工欲善其事必先利其器,搭建好web开发的环境是第一步,以下为ubuntu15.10的web环境搭建过程:
- sudo apt-get install apache2(输入localhost可以查看是否成功)
- sudo apt-get install php5
- sudo apt-get install mysql-server mysql-client
- sudo apt-get install phpmyadmin
- sudo chmod 777 /var/www(默认网页放在/var/www/html下面)
- sudo ln -s /usr/share/phpmyadmin /var/www/html/
- 在/etc/php5/cli/php.ini下编辑添加:
extension=mysql.so
extension=mysqli.so - 重启apach2: sudo /etc/init.d/apache2 start(访问localhost/phpmyadmin出现登陆界面说明成功)
以下为ubuntu16.04安装步骤:
- sudo apt-get install apache2
- sudo apt-get install mysql-server mysql-client
- sudo apt-get install php7.0
- sudo chmod -R 777 /var/www
- sudo ln -s /usr/share/phpmyadmin /var/www/html/
- sudo apt-get install libapache2-mod-php