• 欢迎访问搞代码网站,推荐使用最新版火狐浏览器和Chrome浏览器访问本网站!
  • 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏搞代码吧

ubuntu上配置LAMP+phpadmin

php 搞代码 4年前 (2022-01-24) 31次浏览 已收录 0个评论

ubuntu下配置LAMP+phpadmin

用ubuntu安装lamp就是简单:

搭建LAMP:

sudo apt-get install apache2 php5-mysql libapache2-mod-php5 mysql-server

在地址栏输入:http://localhost,当出现It works!说明我们的环境已经搭建好!

?

然后安装下phpadmin:

?? 在phpmyadmin网站上下载软件包,解压缩到本地目录/var/www/phpmyadmin,如果你请直接解压到/var/www/phpmyadmin,如果不存在phpmyadmin,请自行创建在终端下执行

sudo cp /var/www/phpmyadmin/config.sample.inc.php /var/www/phpmyadmin/config.inc.php

?

sudo gedit /var/www/phpmyadmin/config.inc.php

?

找到“blowfish_secret”在后面填上任意字母:

$cfg['Servers'][$i]['auth_type']='cookie';$cfg['Servers'][$i]['host']='localhost';$cfg['Servers'][$i]['connect_type']='tcp';$cfg['Servers'][$i]['compress']='false';$cfg['Servers'][$i]['extension']='mysql';

?保存退出!

?

在ubuntu上找到一些资

。本文来源gao!%daima.com搞$代*!码网1

搞代gaodaima码料,一共参考:

?

配置文件路径:

1>apache 的配置文件路径 /etc/apache2/apache2.conf

2>apache 网站字符编码配置路径 /etc/apache2/conf.d/charset

3>php.ini 路径 /etc/php5/apache2/php.ini

4>mysql配置文件 路径 /etc/mysql/my.cnf 一般不要使用,尤其是新手

5>phpmyadmin配置文件路径 /etc/phpmyadmin/apache.conf

6>默认网站根目录 /var/www

?

常用命令

1.重启apache:

sudo /etc/init.d/apache2 restart

?2.重启mysql:

sudo /etc/init.d/mysql restart

?

配置apache

1.更改默认字符集
终端中使用命令

sudo nano /etc/apache2/conf.d/charset 

?将其中的:

# AddDefaultCharset 

?的井号去掉,后面字段改成UTF-8(如果您的网站是这样了话)

AddDefaultCharset     UTF-8 

?中间的空格数并不重要,但一定要有。

?

2.添加支持文件类型(一般不需要),与网站地址(需要)

终端中使用命令:

sudo nano /etc/apache2/apache2.conf

?在配置文件最后面加入下面几行: 添加文件类型支持

AddType application/x-httpd-php .php .htm .html

?添加首页文件 三个的顺序可以换 前面的访问优先 (当然你也可以加别的 比如default.php)

DirectoryIndex index.htm index.html index.php

其具体的资料参考:http://wiki.ubuntu.org.cn/index.php?title=LAMP_%E6%9C%8D%E5%8A%A1%E5%99%A8%E5%AE%89%E8%A3%85%E9%85%8D%E7%BD%AE&variant=zh-cn#.E5.9F.BA.E7.A1.80

?

?

?

?

?

?

?

?

?

?

?

?


搞代码网(gaodaima.com)提供的所有资源部分来自互联网,如果有侵犯您的版权或其他权益,请说明详细缘由并提供版权或权益证明然后发送到邮箱[email protected],我们会在看到邮件的第一时间内为您处理,或直接联系QQ:872152909。本网站采用BY-NC-SA协议进行授权
转载请注明原文链接:ubuntu上配置LAMP+phpadmin

喜欢 (0)
[搞代码]
分享 (0)
发表我的评论
取消评论

表情 贴图 加粗 删除线 居中 斜体 签到

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址