Ubuntu搭建LAMP环境
来源:互联网 发布:表亲结婚知乎 编辑:程序博客网 时间:2024/05/17 10:06
原文地址:http://blog.csdn.net/callmeback/article/details/8130190
LAMP搭建环境
安装过程
第一步 安装Apache2
sudo apt-get install apache2
第二步 安装PHP模块sudo apt-get install php5
第三步 安装Mysqlsudo apt-get install mysql-server
sudo apt-get install mysql-client
第四步 其他模块安装sudo apt-get install mysql-client
sudo apt-get install libapache2-mod-php5
sudo apt-get install libapache2-mod-auth-mysql
sudo apt-get install php5-mysql
sudo apt-get install php5-gd
第五步 测试Apache是否正常工作sudo apt-get install libapache2-mod-auth-mysql
sudo apt-get install php5-mysql
sudo apt-get install php5-gd
打开浏览器,输入localhost,看看是否有It Works!网页展示。目录为/var/www
第六步 修改权限/var/wwwsudo chomod 777 /var/www
第七步 安装phpmyadminsudo apt-get install phpmyadmin
安装过程中选择apache2,点击确定。下一步选择是要配置数据库,并输入密码。
第八步 测试phpmyadmin安装过程中选择apache2,点击确定。下一步选择是要配置数据库,并输入密码。
sudo ln -s /usr/share/phpmyadmin/var/www
然后直接运行http://localhost/phpmyadmin,看有没有数据库管理软件出现。
然后直接运行http://localhost/phpmyadmin,看有没有数据库管理软件出现。
配置过程
第一步 启用mod_rewrite模块
sudo a2enmod rewrite
重启Apache服务器:sudo /etc/init.d/apache2 restart或者sudo service apache2 restart
第二步 设置Apache支持.htm .html .php重启Apache服务器:sudo /etc/init.d/apache2 restart或者sudo service apache2 restart
sudo gedit /etc/apache2/apache2.conf&
添加以下句子:AddType application/x-httpd-php .php .htm .html
第三步 测试php网页添加以下句子:AddType application/x-httpd-php .php .htm .html
编辑mysql_test.php代码如下:
<?php
<?php
$link = mysql_connect("localhost", "root", "password");
if(!$link)
if(!$link)
die('Could not connect: ' . mysql_error());
else
echo "Mysql 配置正确!";
mysql_close($link);
?>
访问 http://localhost/mysql_test.php 显示’Mysql 配置正确‘就代表配置正确。
第四步 第三步这里出现了乱码以后解决方法访问 http://localhost/mysql_test.php 显示’Mysql 配置正确‘就代表配置正确。
打开配置文件sudo gedit /etc/apache2/apache2.conf&
添加如下代码:AddDefaultCharset UTF-8,如果中文仍然是乱码,则重启apache2,:sudo /etc/init.d/apache2 restart
到此为止配置OK。 添加如下代码:AddDefaultCharset UTF-8,如果中文仍然是乱码,则重启apache2,:sudo /etc/init.d/apache2 restart
0 0
- Ubuntu LAMP环境搭建
- Ubuntu 搭建LAMP环境
- Ubuntu搭建LAMP环境
- ubuntu搭建LAMP环境
- Ubuntu搭建LAMP环境
- Ubuntu搭建LAMP环境
- ubuntu 环境lamp搭建
- Ubuntu搭建LAMP环境
- Ubuntu搭建LAMP环境
- LAMP环境搭建(Ubuntu
- Ubuntu搭建LAMP环境
- Ubuntu搭建LAMP环境
- Ubuntu搭建LAMP环境
- ubuntu搭建lamp环境
- Ubuntu搭建LAMP环境
- Ubuntu搭建LAMP环境
- Ubuntu搭建LAMP环境
- Ubuntu LAMP 环境搭建
- github设置添加SSH
- JavaScript继承的实现
- ZOJ 题目2859 Matrix Searching(二维RMQ)
- C++线下测试回顾
- 第17章:图片按钮ZoomButton和ZoomControl
- Ubuntu搭建LAMP环境
- mac下eclipse ndk配置
- Unity3D NGUI制作进度条
- maven 实战指南:添加本地jar文件到本地仓库
- 重载操作符>> 和 <<
- XMLHttpRequest API Specification
- iOS程序内打开和发送邮件
- JSP内置对象(二)Session对象
- 上传前实时图片预览