一、环境安装
1.安装apache2
sudo apt-get install apache2
安装后在浏览器中打开:http://localhost/或者http://127.0.0.1
如果出现It works!证明apache安装成功。
2.安装PHP
sudo apt-get install php5
sudo apt-get install libapache2-mod-php5
sudo /etc/init.d/apache2 restart
测试:
sudo vi /var/www/testphp.php
写入php works!保存退出vi。
然后在浏览器中输入http://127.0.0.1/testphp.php或者http://localhost/testphp.php
如果显示出php works!表示php配置成功。
3.安装MYSQL
sudo apt-get install mysql-server
安装过程中按提示设置root密码即可。
注:修改密码:
mysql -uroot -p
mysql>use mysql;
mysql>update user set password=PASSWORD('new password') WHERE user='root';
mysql>exit
重启mysql,或是刷新权限也行
重启即可: sudo /etc/init.d/mysql restart 或是 restart mysql
4、让apache、php支持mysql
sudo apt-get install libapache2-mod-auth-mysql
sudo apt-get install php5-mysql
sudo /etc/init.d/apache2 restart
至此Ubuntu+apache2+php 5+mysql的安装完成。
提示:
/etc/apache2/下:
1、apache2.conf 是主配置文件,httpd.conf 用户配置文件
2、虚拟目录在 httpd.conf 中
DocumentRoot “路径”
ServerName 名称
#Listen 127.0.0.1:80 #注意这个文件中不能写上监听,如果必须要写,那就需要先去apache2.conf下将include /etc/apache2/ports.conf 给注释掉,因为ports.conf中已经监听来80端口
3、目录设置在 /etc/apache2/sites-enabled/000-default 可以设置虚拟主机
4、php.ini: /etc/php5/apache2/php.ini
5、mysql.cnf: /etc/mysql/my.cnf
4、重启apache : /etc/init.d/apache2 restart
5、重启mysql: sudo /etc/init.d/mysql restart 或是 restart mysql
6、日志文件: /var/log/apache2/
二、GD库安装
sudo apt-get install php5-gd
sudo /etc/init.d/apache2 restart
三、curl扩展安装
sudo apt-get install php5-curl
sudo /etc/init.d/apache2 restart
ubuntu,lamp
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件! 如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
更新日志
- 魏新雨《为你祈祷+新歌精逊2CD[WAV]
- 影心、明萨拉你选哪个?国外美女COS《博德3》
- 澳洲女子骑车跌入“自杀树”丛 疼痛持续9个月崩溃
- 育碧公布2024“她创力”计划:为女性游戏人提供辅导
- 刘美君.2017-千色·30总选3CD【环球】【WAV+CUE】
- 群星.2022-星河长明电视原声带【乐有奇思】【FLAC分轨】
- 陈淑桦.1995-淑桦盛开Forever【滚石】【WAV+CUE】
- 《再来一张》评测:出师成败皆系“赌”
- 《银河汉堡店》测评:我是银河走菜王!
- 《末日地带2》评测:酣畅淋漓的“和面”之旅
- 萧煌奇《没事的》[320K/MP3][96.22MB]
- 萧煌奇《没事的》[FLAC/分轨][263.38MB]
- 群星《音你而来 第6期》[320K/MP3][90.61MB]
- 交错战线爬塔攻略一览
- 战锤40K星际战士2全近战武器使用教学|近战武器连招表