Guide to install and setup a Laravel framework on your archlinux system and serve php-based database applications.
LLAMP stands for a Laravel (php framework) Linux system with Apache (webserver), MariaDB (database) and PHP (programming language). In this guide we will also install PhpMyAdmin (database admin GUI) to easily manage the SQL tables.
Laravel is a web application framework with expressive, elegant syntax. We’ve already laid the foundation — freeing you to create without sweating the small things.
If you don't have PHP and Composer installed on your local machine, the following commands will install PHP, Composer, and the Laravel installer:
/bin/bash -c "$(curl -fsSL https://php.new/install/linux)"
If you already have PHP and Composer installed, you may install the Laravel installer via Composer:
composer global require laravel/installer
After you have installed PHP, Composer, and the Laravel installer, you're ready to create a new Laravel application. The Laravel installer will prompt you to select your preferred testing framework, database, and starter kit:
laravel new your-app-name
Create your database first
Update the .env
file in your project with the database name you want to connect to, as well as the other environment variables if they differ from the default.
Once the application has been created, you can start Laravel's local development server, queue worker, and Vite development server using the dev
Composer script:
cd example-app
npm install && npm run build
composer run dev
sudo pacman -Syu
The Apache HTTP Server is an open-source and free product of the Apache Software Foundation and one of the most widely used web servers on the Internet. In addition to factors such as performance, expandability, security, freedom from license costs and support from a very large community, its long-term availability for a wide variety of operating systems is one of the reasons for its widespread use; it is most frequently used as a LAMP system.
sudo pacman -S apache
PHP (for "PHP: Hypertext Preprocessor") is a scripting language with a syntax based on C and Perl, which is mainly used to create dynamic websites or web applications. PHP is distributed as free software under the PHP license. PHP is characterized by broad database support and Internet protocol integration as well as the availability of numerous function libraries.
sudo pacman -S php php-cgi php-gd php-pgsql php-apache
MariaDB is a free, relational open source database management system that was created by a fork from MySQL. The project was initiated by MySQL's former main developer Michael Widenius, who also developed the storage engine Aria, on which MariaDB was originally based.
sudo pacman -S mariadb
Run mariadb-install-db --user=mysql --basedir=/usr --datadir=/var/lib/mysql
Start the mariadb service: systemctl enable --now mariadb
mysql_secure_installation
mysql --protocol=socket #run this command as root (e.g. prefixed with sudo)
Setup User
sudo mysql -u root # I had to use "sudo" since it was a new installation
mysql> USE mysql;
mysql> CREATE USER 'YOUR_SYSTEM_USER'@'localhost' IDENTIFIED BY 'YOUR_PASSWD';
mysql> GRANT ALL PRIVILEGES ON *.* TO 'YOUR_SYSTEM_USER'@'localhost';
mysql> UPDATE user SET plugin='auth_socket' WHERE User='YOUR_SYSTEM_USER';
mysql> FLUSH PRIVILEGES;
mysql> exit;
sudo systemctl restart/start/stop mysql
⚠️ Got Error Delete User:FLUSH PRIVILEGES
sudo rm -rf /etc/mysql sudo rm -rf /var/lib/mysql
phpMyAdmin (PMA for short) is a free web application for the administration of MySQL databases and MariaDB. The software is implemented in PHP, hence the name phpMyAdmin. Most functions can be executed without writing SQL statements, such as listing data records, creating/deleting tables, adding columns, creating/deleting databases and managing users.
sudo pacman -S phpmyadmin
Create the Apache configuration file:
/etc/httpd/conf/extra/phpmyadmin.conf
Alias /phpmyadmin "/usr/share/webapps/phpMyAdmin"
<Directory "/usr/share/webapps/phpMyAdmin">
DirectoryIndex index.php
AllowOverride All
Options FollowSymlinks
Require all granted
</Directory>
And include it in /etc/httpd/conf/httpd.conf
:
# phpMyAdmin configuration
Include conf/extra/phpmyadmin.conf
You can now access the PhpMyAdmin webinterface at: http://localhost/phpmyadmin
sudo pacman -S code
Make sure to restart the apache daemon after your configurations: systemctl restart httpd
systemctl status httpd
systemctl start httpd
systemctl enable/disable httpd
Open your browser and go to: http://localhost/yout-app-name