Installing and configuring the Lamp Stack on Ubuntu

Asked

Viewed 222 times

0

Hello I’m new to linux, and would like to install a PHP and Laravel development environment in my Ubuntu 16.04 to study both the language and the framework, and for that I need:

Apache Mysql PHP 7 Composer

I need Composer to install Laravel, preferably the newer version, or at least the 5.2 version, I intend to use Atom as Editor and Mysql Workbench as SGBD.

Never before I had contact with Linux, I would also like to know how to start the services, if someone can at least indicate me an article about it (can be in English) I would be grateful.

1 answer

1

Updating the system:

$ sudo apt-get update
$ sudo apt-get upgrade

Installing the Apache:

$ sudo apt-get install apache2

Starting the apache:

$ systemctl restart apache2 

Test the installation by calling localhost in a browser.

Installing Mysql:

$ sudo apt-get install mysql-server php7-mysql

Installing the PHP7

$ sudo apt install php7.0 libapache2-mod-php7.0 php7.0-mcrypt php7.0-mbstring

Installing Composer (you’ll need zip and git):

$ sudo apt install zip 
$ apt install git
$ cd ~
curl -sS https://getcomposer.org/installer | php

The last command must create a file called compser.phar in your home directory, which can be executed on the command line, to install it globally, move it to the directory /usr/local/bin/with the command:

$ sudo mv composer.phar /usr/local/bin/composer

Try to see the commands of the Composer:

$ composer

Installing Lavarel, first let’s configure mysql, log in with the password you informed at the time of installation:

$ mysql -u root -p

After logging in, you will be at the mysql, type the commands (the names to USER. And DATABSE, may be different from the example:

mysql> CREATE USER 'laravel'@'localhost' IDENTIFIED BY 'laravel';
mysql> GRANT ALL PRIVILEGES ON *.* TO 'laravel'@'localhost' WITH GRANT OPTION;
mysql> CREATE DATABASE laravel;

Okay, all installed, now clone a lavarel project to test, I suggest the one from the lavarel itself. The project also has, a good tutorial.

Final remark:
If Voce is in a hurry and machine to run a virtual, maybe it is better to install an appliance, has some free very good, for example:

Debian Bitnami.
Technologies: Mysql, PHP, Varnish, Apache, phpMyAdmin, Smarty, Zend Framework, Laravel, Codeigniter, Symfony, Cakephp

Install on the linux system itself that you are using (or in windows, if you prefer) and thus you have time to install calmly on the real machine, if you do not end up liking the virtual and staying with it definatively. :-)

Browser other questions tagged

You are not signed in. Login or sign up in order to post.