Could you tell me please how to install LAMPP full in Ubuntu 16.04, I don't know what should I do with this part:

sudo apache2ctl configtest

I know after that I should after use this one :

sudo nano /etc/apache2/apache2.conf

What should I do when executing this:

sudo nano /etc/apache2/apache2.conf

In Ubuntu 16.04.3 LTS you can follow these steps to install Apache2, MySQL, PHP7 and phpmyadmin, I tested this today and it shouln't give you any kind of problems:

  1. Install Apache2:

    sudo apt update
    sudo apt install apache2
  2. Edit the file /etc/apache2/apache2.conf, add the following line at the end:

    ServerName <yourDomainOrIP>
  3. Check if your config is OK:

    sudo apache2ctl configtest

    The output should be like this: Syntax OK

  4. Restart Apache to implement changes:

    sudo systemctl restart apache2
  5. Verify if Apache is working, open you browser and go to: http://your_ip_address, you should see somehing like the following image:

    Apache Works

  6. Install MySQL:

    sudo apt install mysql-server

    During this installation you will be asked to enter the MySQL password.

  7. Secure your MySQL installation executing:

    sudo mysql_secure_installation

    Choose the options that you prefer in this step.

  8. Install PHP:

    sudo apt install php libapache2-mod-php php-mcrypt php-mysql
  9. Edit the file /etc/apache2/mods-enabled/dir.conf, after editing it should look like this:

    <IfModule mod_dir.c>
        DirectoryIndex index.php index.html index.cgi index.pl index.xhtml index.htm
  10. Restart Apache and check its status:

    sudo systemctl restart apache2
    sudo systemctl status apache2

    After this step if you want to install PHP modules, you can search for them using:

    apt-cache search php- | less
  11. Test if PHP works, create an info.php:

    sudo nano /var/www/html/info.php

    An put the following content inside:

    <?php phpinfo(); ?>

    Now go to http://your_ip_address/info.php and you should see something like the image below:

    PHP Info

  12. Install phpmyadmin:

    sudo apt install phpmyadmin php-mbstring php-gettext

    During the installation you will be asked to choose your web server (apache2) and if you want to use dbconfig-common to configure the db, finally the password for phpmyadmin will be requested.

    This process adds phpmyadmin to /etc/apache2/conf-enabled/, you can verify it with: ls /etc/apache2/conf-enabled/

    ls /etc/apache2/conf-enabled/

  13. Enable PHP mcrypt and mbstring:

    sudo phpenmod mcrypt
    sudo phpenmod mbstring
  14. Restart Apache again and test if everything works.

    sudo systemctl restart apache2

    Go to http://your_ip_address/phpmyadmin and you will see the login page:

    phpmyadmin Login screen

    Enter your credentials and then you're done:

    phpmyadmin databases

Hope it helps.

  • 2
    Why do difficult? sudo apt-get install lamp-server^ and up to point 8 is done with a single command.
    – Rinzwind
    Jan 23 '18 at 7:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.