Shameless ad
Some of the links in this article are "affiliate links", a link with a special tracking code. This means if you click on an affiliate link and purchase the item, we will receive an affiliate commission.
The price of the item is the same whether it is an affiliate link or not. Regardless, we only recommend products or services we believe will add value to our readers.
By using the affiliate links, you are helping support our Website, and we genuinely appreciate your support.
LAMP with phpMyAdmin
Why use LAMP with phpMyAdmin?
LAMP with phpMyAdmin allows you to make local websites on your Ubuntu PC. It provides the Apache web server, PHP, MySQL, and phpMyAdmin.
Useful LAMP with phpMyAdmin Information
![LAMP with phpMyAdmin Configuration Information](https://11714007canadainc.com/media/images/Important-LAMP-Information.jpg)
Once installed, the local website can be found at http://localhost/.
/var/www/html/ is the folder for http://localhost/.
http://localhost/phpmyadmin to access phpMyAdmin.
Change the 8.1 to the number for your PHP version.
/etc/php/8.1/apache2/php.ini is the PHP initialization file path.
/usr/bin/php is the PHP executable file path.
Remember This
You will see packages installing. Unless told otherwise, simply use the defaults. For example, if you are asked to continue and the choices are Y/n, simply press Enter. The default is Y, so Y will be chosen.
If sudo prompts you for a password, enter the password you use to log into Ubuntu.
Proceed with Caution
You can seriously mess up your computer if you do not know what you are doing in Terminal.
Terminal is for advanced users only. Terminal assumes you are an expert and does not do the “Does the user know what they are doing?” checks the GUI does.
Terminal assumes you are an expert. It will simply not question you, and will obey.
This a very powerful feature, but is a two-edged sword if Terminal is used carelessly.
Installing LAMP with phpMyAdmin
Installing Linux
Ubuntu is a Linux distribution. If you are wanting to run a LAMP stack on Ubuntu, you likely have Ubuntu installed already.
If not, and you want to install Ubuntu on a PC, visit the Ubuntu website.
Installing Apache
To install, Apache, enter the following command into Terminal.
sudo apt install apache2
![Ubuntu Apache sudo apt install apache2](https://11714007canadainc.com/media/images/Ubuntu-Apache-sudo-apt-install-apache2.jpg)
Apache will install.
![Ubuntu Apache installing start](https://11714007canadainc.com/media/images/Ubuntu-Apache-installing-start.jpg)
![Ubuntu Apache installing middle](https://11714007canadainc.com/media/images/Ubuntu-Apache-installing-middle.jpg)
![Ubuntu Apache installing end](https://11714007canadainc.com/media/images/Ubuntu-Apache-installing-end.jpg)
Tell Ubuntu to start Apache when Ubuntu on startup. Enter the following command into Terminal.
sudo systemctl start apache2
![Ubuntu Apache sudo systemctl start apache2](https://11714007canadainc.com/media/images/Ubuntu-Apache-sudo-systemctl-start-apache2.jpg)
In a browser, go to http://localhost/.
![Ubuntu Apache go to localhost](https://11714007canadainc.com/media/images/Ubuntu-go-to-localhost.jpg)
If you see the Apache Default Page, Apache is installed and working!
![Ubuntu Apache working localhost](https://11714007canadainc.com/media/images/Ubuntu-Apache-working-localhost.jpg)
Installing PHP
To install PHP, enter the following command into Terminal. Change 8.1 to your version of PHP.
Change 8.1 to your version of PHP.
sudo apt install php8.1 php8.1-mysql php-common php8.1-cli php8.1-common php8.1-opcache libapache2-mod-php8.1
![Ubuntu PHP install PHP](https://11714007canadainc.com/media/images/Ubuntu-PHP-install-PHP.jpg)
PHP will install.
![Ubuntu PHP installing PHP start](https://11714007canadainc.com/media/images/Ubuntu-PHP-installing-PHP-start.jpg)
![Ubuntu PHP installing PHP middle](https://11714007canadainc.com/media/images/Ubuntu-PHP-installing-PHP-middle.jpg)
![Ubuntu PHP installing PHP end](https://11714007canadainc.com/media/images/Ubuntu-PHP-installing-PHP-end.jpg)
Find the PHP initialization file path. Create a temporary phpinfo.php file by entering the following command into Terminal.
echo '<?php phpinfo(); ?>' | sudo tee -a /var/www/html/phpinfo.php > /dev/null
![Ubuntu PHP Create a temporary phpinfo_php file](https://11714007canadainc.com/media/images/Ubuntu-PHP-Create-a-temporary-phpinfo_php-file.jpg)
In a browser, go to http://localhost/phpinfo.php.
![Ubuntu PHP go to localhost:phpinfo_php](https://11714007canadainc.com/media/images/Ubuntu-PHP-go-to-localhostphpinfo_php.jpg)
Find the section for Loaded Configuration File.
![Ubuntu PHP find Loaded Configuration Path section](https://11714007canadainc.com/media/images/Ubuntu-PHP-find-Loaded-Configuration-Path-section.jpg)
The Loaded Configuration File is the PHP initialization file path.
![Ubuntu PHP find Loaded Configuration Path](https://11714007canadainc.com/media/images/Ubuntu-PHP-find-Loaded-Configuration-Path.jpg)
Copy the loaded configuration file path and keep it in a safe place for future use.
![Ubuntu PHP copy initialization filepath](https://11714007canadainc.com/media/images/Ubuntu-PHP-copy-initialization-filepath.jpg)
Delete the temporary phpinfo.php for security reasons. Enter the following command into Terminal.
sudo rm /var/www/html/phpinfo.php
![Ubuntu PHP Delete temporary phpinfo_php](https://11714007canadainc.com/media/images/Ubuntu-PHP-Delete-temporary-phpinfo_php.jpg)
Find the PHP executable file path. Enter the following command into Terminal.
which php
![Ubuntu PHP which php](https://11714007canadainc.com/media/images/Ubuntu-PHP-which-php.jpg)
It will tell you the PHP executable file path.
![Ubuntu PHP executable filepath](https://11714007canadainc.com/media/images/Ubuntu-PHP-executable-filepath.jpg)
Copy the PHP executable file path and keep it in a safe place for future use.
![Ubuntu PHP copy PHP executable filepath](https://11714007canadainc.com/media/images/Ubuntu-PHP-copy-PHP-executable-filepath.jpg)
Installing MariaDb
To install MariaDb, enter the following command into Terminal.
sudo apt install mariadb-server mariadb-client
![Ubuntu apt install mariadb-server mariadb-client](https://11714007canadainc.com/media/images/Ubuntu-MariaDb-apt-install-mariadb-server-mariadb-client.jpg)
MariaDb will install.
![Ubuntu MariaDb installing start](https://11714007canadainc.com/media/images/Ubuntu-MariaDb-installing-start.jpg)
![Ubuntu MariaDb installing end](https://11714007canadainc.com/media/images/Ubuntu-MariaDb-installing-end.jpg)
You will be ask for the current root password. Since there is none, press Enter.
![Ubuntu MariaDb Enter MariaDb root password](https://11714007canadainc.com/media/images/Ubuntu-MariaDb-Enter-MariaDb-root-password.jpg)
When asked to switch to unix_socket authentication, press Enter.
![Ubuntu MariaDb switch to unix_socket authenication](https://11714007canadainc.com/media/images/Ubuntu-MariaDb-switch-to-unix_socket-authenication.jpg)
When asked if you want to change the root password, press Enter.
![Ubuntu MariaDb Change the root password](https://11714007canadainc.com/media/images/Ubuntu-MariaDb-Change-the-root-password.jpg)
Create a password. Store it in a secure place for future use. Enter the password.
![Ubuntu MariaDb Enter root password](https://11714007canadainc.com/media/images/Ubuntu-MariaDb-Enter-root-password.jpg)
Re-enter the password exactly when prompted.
![Ubuntu MariaDb Enter root password again](https://11714007canadainc.com/media/images/Ubuntu-MariaDb-Enter-root-password-again.jpg)
When asked to remove anonymous users, press Enter.
![Ubuntu MariaDb remove anonymous users](https://11714007canadainc.com/media/images/Ubuntu-MariaDb-remove-anonymous-users.jpg)
When asked to disallow root login remotely, press Enter.
![Ubuntu MariaDb disallow root login remotely](https://11714007canadainc.com/media/images/Ubuntu-MariaDb-disallow-root-login-remotely.jpg)
When asked to remove the test database and access to it, press Enter.
![Ubuntu MariaDb remove test database and access to it](https://11714007canadainc.com/media/images/Ubuntu-MariaDb-remove-test-database-and-access-to-it.jpg)
When asked to Reload the privilege tables now, press Enter.
![Ubuntu MariaDb reload privilege tables now](https://11714007canadainc.com/media/images/Ubuntu-MariaDb-reload-privilege-tables-now.jpg)
MariaDB is now installed!
![Ubuntu MariaDb Thanks for using MariaDb](https://11714007canadainc.com/media/images/Ubuntu-MariaDb-Thanks-for-using-MariaDb.jpg)
The PHP Initialization File Path for LAMP
The easy way is to just take my word for it.
/etc/php/8.1/apache2/php.ini is the PHP initialization file path. Change the 8.1 to the number for your PHP version.
The PHP Executable File Path for LAMP
The easy way is to just take my word for it.
/usr/bin/php is the PHP executable file path.
Installing phpMyAdmin
Enter the following command into Terminal.
sudo apt install phpmyadmin
![Ubuntu apt install phpmyadmin](https://11714007canadainc.com/media/images/Ubuntu-phpMyAdmin-apt-install-phpmyadmin.jpg)
You will see packages installing.
![Ubuntu apt install phpmyadmin installing](https://11714007canadainc.com/media/images/Ubuntu-apt-install-phpmyadmin-installing.jpg)
Eventually, you will get to this.
![Ubuntu Apache selected](https://11714007canadainc.com/media/images/Ubuntu-Apache-selected.jpg)
When the prompt appears, “apache2” is highlighted but not selected. You must press Space to select Apache, or the installer will not set up the appropriate files during installation.
Press Space. An asterisk will show up in the red area, indicating you chose Apache.
Press Tab. The OK button will turn red. Now, press Enter to select Apache.
You will be asked if you want to configure the database for phpMyAdmin with dbconfig-common. Press Enter.
![Ubuntu Yes for dbconfig-common](https://11714007canadainc.com/media/images/Ubuntu-Yes-for-dbconfig-common-1.jpg)
You will be asked to create a password. Enter the password you want. Then press Tab, then press Enter.
Keep a copy of the password in a safe place for future use. This is the phpMyAdmin root password.
![Ubuntu phpMyAdmin root password](https://11714007canadainc.com/media/images/Ubuntu-phpMyAdmin-root-password.jpg)
![Ubuntu phpMyAdmin root password ok](https://11714007canadainc.com/media/images/Ubuntu-phpMyAdmin-root-password-ok.jpg)
You will be asked to confirm the password you just typed in. Type the password again. The two passwords you just entered must be identical.
![Ubuntu phpMyAdmin confirm root password](https://11714007canadainc.com/media/images/Ubuntu-phpMyAdmin-enter-the-root-password-for-phpMyAdmin-again.jpg)
Press Tab, then Enter.
![Ubuntu phpMyAdmin confirm root password ok](https://11714007canadainc.com/media/images/Ubuntu-phpMyAdmin-root-password-confirmation-ok-1.jpg)
Enter the following command into Terminal.
sudo ln -s /etc/phpmyadmin/apache.conf /etc/apache2/conf-available/phpmyadmin.conf
![Ubuntu configure phpMyAdmin](https://11714007canadainc.com/media/images/Ubuntu-configure-phpMyAdmin.jpg)
Enter the following command into Terminal.
sudo a2enconf phpmyadmin.conf
![Ubuntu a2enable phpMyAdmin_conf](https://11714007canadainc.com/media/images/Ubuntu-a2enable-phpMyAdmin_conf.jpg)
Enter the following command into Terminal.
sudo systemctl reload apache2.service
![Ubuntu reload apache2_service](https://11714007canadainc.com/media/images/Ubuntu-reload-apache2_service.jpg)
In your browser, go to http://localhost/phpmyadmin/.
![Ubuntu Go to localhost phpmyadmin](https://11714007canadainc.com/media/images/Ubuntu-Go-to-localhost-phpmyadmin.jpg)
You will see the phpMyAdmin login page. Enter root in the Username field. Enter the phpMyAdmin root password into the Password field. Click the Go button.
![Ubuntu Log into phpMyAdmin](https://11714007canadainc.com/media/images/Ubuntu-Log-into-phpMyAdmin.jpg)
Now, you are logged into phpMyAdmin!
![Ubuntu phpMyAdmin](https://11714007canadainc.com/media/images/Ubuntu-phpMyAdmin.jpg)
Congratulations! You have now successfully installed LAMP with phpMyAdmin on Ubuntu Desktop.
Important Information about LAMP with phpMyAdmin
![LAMP with phpMyAdmin Configuration Information](https://11714007canadainc.com/media/images/Important-LAMP-Information.jpg)
Once installed, the local website can be found at http://localhost/.
/var/www/html/ is the folder for http://localhost/.
http://localhost/phpmyadmin to access phpMyAdmin.
Change the 8.1 to the number for your PHP version.
/etc/php/8.1/apache2/php.ini is the PHP initialization file path.
/usr/bin/php is the PHP executable file path.
Resources
How to Install Microsoft Visual Studio Code
Microsoft Visual Studio Code
What is Microsoft Visual Studio Code?
Visual Studio Code is a streamlined code editor with support for development operations like debugging, task running, and version control. It aims to provide just the tools a developer needs for a quick code-build-debug cycle and leaves more complex workflows to fuller featured IDEs, such as Visual Studio IDE.
code.visualstudio.com
How to Install Microsoft Visual Studio Code
Open Ubuntu Software.
![Open Ubuntu software](https://11714007canadainc.com/media/images/Ubuntu-Uninstall-VS-Code-click-ubuntu-software-icon.jpg)
Click on the search icon and search for code. In Ubuntu, Microsoft Visual Studio Code is simply called code.
![Ubuntu VS Code search for code](https://11714007canadainc.com/media/images/Ubuntu-Uninstall-VS-Code-search-for-code.jpg)
Microsoft Visual Studio Code
![Microsoft Visual Studio Code](https://11714007canadainc.com/media/images/Ubuntu-Uninstall-VS-Code-click-on-code.jpg)
The following screen will appear. Click on the Install button.
![Click on the Install button.](https://11714007canadainc.com/media/images/Ubuntu-VS-Code-Install-Click-on-Install-Button.jpg)
Visual Studio Code will install.
![VS Code will install](https://11714007canadainc.com/media/images/Ubuntu-VS-Code-Install-installing.jpg)
Microsoft Visual Code is now installed.
![VS Code is now installed.](https://11714007canadainc.com/media/images/Ubuntu-VS-Code-Install-installed.jpg)
Click on Show Applications.
![Click on Show Applications](https://11714007canadainc.com/media/images/Ubuntu-Click-on-Show-Applications.jpg)
Search for code.
![Show Applications search for code](https://11714007canadainc.com/media/images/Ubuntu-search-for-app-code.jpg)
Right-click on the Visual Studio Code icon. Click Add Fovorites.
![add favorites](https://11714007canadainc.com/media/images/Ubuntu-Show-Applications-Add-to-Favorites.jpg)
Open Visual Studio Code.
![Open VS Code](https://11714007canadainc.com/media/images/Ubuntu-Open-VSCode.jpg)
Click Get Started.
![Click Get Started](https://11714007canadainc.com/media/images/Mac-VS-Code-Click-Get-Started.jpg)
Click open a folder.
![Click open a folder](https://11714007canadainc.com/media/images/Mac-VS-Code-Click-Open-Folder.jpg)
Select the folder you wish to code in. Then click the Open button.
![select folder](https://11714007canadainc.com/media/images/Ubuntu-VS-Code-Select-folder-click-open.jpg)
Click the “Yes, I trust…” button.
![](https://11714007canadainc.com/media/images/Mac-VS-Code-Click-Yes-I-Trust.jpg)
Microsoft Visual Code is now installed!
![](https://11714007canadainc.com/media/images/Microsoft-Visual-Studio-Code-is-Installed.jpg)
settings.json
{
“phpserver.phpConfigPath”: “/etc/php/8.1/apache2/php.ini”,
“phpserver.phpPath”: “/usr/bin/php”,
“php.executablePath”: “/usr/bin/php”,
“php.validate.executablePath”: “/usr/bin/php”,
}