How to Install LEMP Stack on Manjaro
Published on: August 7, 2021
Hi all, in this video i will show how to full install LEMP (NGINX+MariaDB+PHP) on Manjaro.
I hope you enjoy!
Links
Steps
1. NGINX
$ sudo pacman -Syyu
$ sudo pacman -S nginx
$ sudo systemctl enable --now nginx
$ sudo systemctl status nginx
Check http://localhost in your browser to see default nginx page.
2. MariaDB
$ sudo pacman -S mysql
$ sudo mysql_install_db --user=mysql \
--basedir=/usr --datadir=/var/lib/mysql
$ sudo systemctl enable --now mysqld
$ sudo systemctl status mysqld
$ mysql_secure_installation
3. PHP and PHP-FPM
$ sudo pacman -S php php-fpm php-gd
$ sudo systemctl enable --now php-fpm
$ sudo systemctl status php-fpm
4. Configs
Edit /etc/php/php.ini and change the values by uncommenting ::
extension=gd
extension=pdo_mysql
extension=mysqli
Edit /etc/nginx/nginx.conf and Add the content as shown after ‘location’ contents.
Add the content as shown after ‘location’ contents.
location ~ \.php$ {
fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock;
fastcgi_index index.php;
root /usr/share/nginx/html;
include fastcgi.conf;
}
Create /usr/share/nginx/html/info.php with the following content:
<?php phpinfo(); ?>
Restart the nginx and php-fpm.
$ sudo systemctl restart nginx
$ sudo systemctl restart php-fpm
5. Finish
Finally point your browser to http://localhost/info.php