简体   繁体   English

无法在UBUNTU中安装LAMP服务器

[英]Cannot install LAMP server in UBUNTU

I am new using Ubuntu. 我是使用Ubuntu的新手。 Basically I want to set the LAMP package in order to test PHP locally. 基本上我想设置LAMP包以便在本地测试PHP。 So I installed tasksel then I executed in the terminal. 所以我安装了taskel然后在终端中执行。

sudo tasksel

Which promps a list of servers I can install. 哪个提示我可以安装的服务器列表。 I move the cursor to LAMP Server option, hits enter and returns to the command line. 我将光标移至LAMP Server选项,单击Enter,然后返回命令行。 Like if I had pressed EXIT. 就像我按EXIT一样。

What am I missing? 我想念什么? Can someone experienced help me install LAMP even if it is on another way? 有经验的人可以帮我安装LAMP吗,即使它在其他方式上也可以吗? I have Ubuntu 13, by the way. 顺便说一下,我有Ubuntu 13。 I have been struggling with this for a while now. 我已经为此苦了一段时间了。

To install apache, open terminal and type in these commands: 要安装apache,请打开终端并输入以下命令:

sudo apt-get update
sudo apt-get install apache2

to test if apache is working use this simple script: 要测试apache是​​否正常工作,请使用以下简单脚本:

ifconfig eth0 | grep inet | awk '{ print $2 }'

and browse to : http://<you'r ip address> 并浏览到: http://<you'r ip address>

to install mysql open the terminal and write this: 要安装mysql,请打开终端并输入以下内容:

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

Once you have installed MySQL, we should activate it with this command: 安装完MySQL后,我们应该使用以下命令将其激活:

sudo mysql_install_db

Finish up by running the MySQL set up script: 通过运行MySQL设置脚本来完成:

sudo /usr/bin/mysql_secure_installation

The prompt will ask you for your current root password. 提示将询问您当前的root密码。

Type it in. 输入。

Enter current password for root (enter for none): 
OK, successfully used password, moving on...

Now, its time to install PHP: 现在,该安装PHP了:

sudo apt-get install php5 libapache2-mod-php5 php5-mcrypt

That's it! 而已! restart apache to apply the changes: 重新启动apache以应用更改:

sudo service apache2 restart

Hope it helps. 希望能帮助到你。

You can try with. 您可以尝试。

sudo tasksel install lamp-server

https://help.ubuntu.com/community/ApacheMySQLPHP https://help.ubuntu.com/community/ApacheMySQLPHP

Change user to root 将用户更改为root

sudo su root

update the repository 更新资料库

sudo apt-get update

install LAMP packages by, 通过以下方式安装LAMP软件包:

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

This three simple step is enough to install LAMP. 这三个简单的步骤足以安装LAMP。

Courtasy: iGyan: Install LAMP with PHPmyadmin in linux 提供: iGyan:在Linux中使用PHPmyadmin安装LAMP

您可以使用以下命令行在Ubuntu中轻松安装LAMP堆栈:

apache2 mysql-server mysql-client libapache2-mod-auth-mysql php5 php5-mysql libapache2-mod-php5 php5-mcrypt php5-curl php5-cli php5-gd phpmyadmin apache2-utils

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM