Ubuntu中如何搭建LAMP开发环境

55次阅读
没有评论

共计 747 个字符,预计需要花费 2 分钟才能阅读完成。

本篇内容介绍了“Ubuntu 中如何搭建 LAMP 开发环境”的有关知识,在实际案例的操作过程中,不少人都会遇到这样的困境,接下来就让丸趣 TV 小编带领大家学习一下如何处理这些情况吧!希望大家仔细阅读,能够学有所成!

1. 更新

sudo apt-get update

2. 安装 apache

sudo apt-get install apache2

3. 安装 MySQL

sudo apt install mysql-server mysql-client

输入密码,Tab 键,回车

输入确认密码,Tab 键,回车

4.

sudo mysql_secure_installation

Ubuntu 中如何搭建 LAMP 开发环境

Ubuntu 中如何搭建 LAMP 开发环境

Ubuntu 中如何搭建 LAMP 开发环境

Ubuntu 中如何搭建 LAMP 开发环境

Ubuntu 中如何搭建 LAMP 开发环境

Ubuntu 中如何搭建 LAMP 开发环境

5. 安装 PHP7.0

sudo apt install php7.0 php7.0-mysql php7.0-curl php7.0-gd php7.0-mbstring php-gettext php7.0-mcrypt php7.0-xmlrpc libapache2-mod-php7.0

Ubuntu 中如何搭建 LAMP 开发环境

Ubuntu 中如何搭建 LAMP 开发环境

6. 配置 Apache 服务器

sudo vi /etc/apache2/mods-enabled/dir.conf

Ubuntu 中如何搭建 LAMP 开发环境

Ubuntu 中如何搭建 LAMP 开发环境

7. 重启 Apache 服务器

sudo systemctl restart apache2

Ubuntu 中如何搭建 LAMP 开发环境

8.

sudo find /var/www/html/-type d -exec chmod 755 {} ;

sudo find /var/www/html/-type f -exec chmod 644 {} ;

Ubuntu 中如何搭建 LAMP 开发环境

9. 查看 PHP 版本

php -v

Ubuntu 中如何搭建 LAMP 开发环境

10. 到这里安装完成了,测试,在浏览器地址栏输入 localhost。

sudo vi /var/www/html/index.php

Ubuntu 中如何搭建 LAMP 开发环境

Ubuntu 中如何搭建 LAMP 开发环境

Ubuntu 中如何搭建 LAMP 开发环境

“Ubuntu 中如何搭建 LAMP 开发环境”的内容就介绍到这里了,感谢大家的阅读。如果想了解更多行业相关的知识可以关注丸趣 TV 网站,丸趣 TV 小编将为大家输出更多高质量的实用文章!

正文完
 
丸趣
版权声明:本站原创文章,由 丸趣 2023-07-13发表,共计747字。
转载说明:除特殊说明外本站除技术相关以外文章皆由网络搜集发布,转载请注明出处。
评论(没有评论)