Monday, January 02, 2017

Arch Linux: Install lighttpd and php.

sudo pacman -S lighttpd php-fpm
Add the folowing line to: /etc/lighttpd/lighttpd.conf include "conf.d/fastcgi.conf"
Create folder conf.d and file fastcgi.conf with the following contents:
server.modules += ( "mod_fastcgi" )

index-file.names += ( "index.php" )

fastcgi.server = (
".php" => (
"localhost" => (
"socket" => "/run/php-fpm/php-fpm.sock",
"broken-scriptfilename" => "enable"
))
)

Enable php-fpm and lighttpd services: sudo systemctl enable php-fpm
sudo systemctl enable lighttpd

To start now php-fpm and lighttpd services: sudo systemctl start php-fpm
sudo systemctl start lighttpd

To check, go to /srv/www/ and create file index.php <?php
phpinfo();
?>
Make sure index.php has permission to be executed and read. To enable phpmyadmin sudo pacman -S phpmyadmin And place the following in /etc/lighttpd/lighttpd.conf alias.url = ( "/phpmyadmin" => "/usr/share/webapps/phpMyAdmin/")

server.modules = (
"mod_alias"
)