Skip to main content
Drupal 8

Main navigation

  • Home
    • Question And Answer
    • NEWS
    • Projects
  • Tutorials - Drupal
    • Android
    • Other
User account menu
  • Log in

Breadcrumb

  1. Home

Install LAMP On Debian based Linux

By editor , 1 July, 2016
Question

How to Install LAMP (Linux, Apache, MySQL and PHP) stack On Debian based Linux systems (Debian, Ubuntu, Mint ...) ?

Install Apache 2 server

sudo apt-get install apache2

#Test Apache 2
#Open : http://localhost/


Install PHP 5.6

Note : To use Drupal 8, you must install atlest PHP 5.5.9. If you need to install other Version Visit this Tuto.

sudo apt-get install python-software-properties
sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get install -y php5.6

NOTE:
If you have this message add-apt-repository: command not found
run : apt-get install software-properties-common

Install PHP5.6 Modules

sudo apt-get install libapache2-mod-php5.6 php5.6-cgi php5.6-cli php5.6-curl php5.6-imap php5.6-gd php5.6-mysql php5.6-pgsql php5.6-sqlite3 php5.6-mbstring php5.6-json php5.6-bz2 php5.6-mcrypt php5.6-xmlrpc php5.6-gmp php5.6-xsl php5.6-soap php5.6-xml php5.6-zip php5.6-dba

#For PHP to work and be compatible with Apache you must restart Apache.
sudo /etc/init.d/apache2 restart

 

Install MySQL Server

sudo apt-get install mysql-server

Optional.
In order for other computers on your network to view the server you have created, you must first edit the "Bind Address". Begin by opening up Terminal to edit the my.cnf file (/etc/mysql/my.cnf).
Change the line

bind-address = 127.0.0.1
Change the 127.0.0.1 to your IP address.

Change Mysql root password

mysql -u root
#mysql>
SET PASSWORD FOR 'root'@'localhost' = PASSWORD('yourpassword');

 

Run As a LAMP Install script

sudo apt-get install apache2
sudo apt-get install php5 libapache2-mod-php5
sudo /etc/init.d/apache2 restart
sudo apt-get install mysql-server

LAMP Install script

You can download and use my LAMP install script.
1. Extract the file.
2. change file mode. sudo chmod +x *.sh
3. Run the script. sudo ./install_lamp.sh

 

File
install_lamp.sh_.zip (455 bytes)

Tags

  • Linux
  • Shell
  • Server
Install PHP 5 (5.4, 5.5, 5.6) and PHP 7 on Linux
Install Apache 2 with SSL On Debian based Linux
Install MAMP. Apache MySQL PHP on Mac
Download and Install drupal 8/9 - Composer

Comments

Plain text

  • No HTML tags allowed.
  • Lines and paragraphs break automatically.
  • Web page addresses and email addresses turn into links automatically.

Links

  • Drupal.org
  • Drupal core release cycle
  • Drupal events with ease
  • Unit test with Drupal using PHPUnit (Drupal 10)
  • Tokens for file upload url
  • Tips for Docker
  • CKEditor inline image files usage for custom forms.
  • Install Docker on Linux Mint
  • Install PHP 8.1
  • Drupal Security Best Practices
  • Order and sort items with tabledrag
  • Add a custom service YAML container
  • Apply a patch with composer