I have installed lighttp and php on a debian machine.
but php is not working yet.
I need to configure it to work together.
install lighttp with php
Re: install lighttp with php
You can install php-fpm,
best is to install the others also
To enable PHP support for Lighttpd.
you need to modify the php.ini file
Change cgi.fix_pathinfo value to 1:
By default, PHP-FPM listens on the UNIX socket /var/run/php7-fpm.sock. So, we will need to modify the file /etc/php/7.4/fpm/pool.d/www.conf and set PHP-FPM to listens on TCP socket.
finde the line
replace, or comment out, and add
Next step is to tell lighttpd to use the TCP-port.
in /etc/lighttpd/conf-available/15-fastcgi-php.conf
comment out or replace them with the following:
enable FastCGI + FastCGI-PHP modules with the following command:
don't forget to restart:
should work now.
best is to install the others also
Code: Select all
apt-get install php php-cli php-common php-fpm php-mysql
you need to modify the php.ini file
Code: Select all
nano /etc/php/7.4/fpm/php.ini
Code: Select all
cgi.fix_pathinfo=1
finde the line
Code: Select all
listen = /run/php/php7.4-fpm.sock
Code: Select all
listen = 127.0.0.1:9000
in /etc/lighttpd/conf-available/15-fastcgi-php.conf
Code: Select all
"bin-path" => "/usr/bin/php-cgi",
"socket" => "/var/run/lighttpd/php.socket",
Code: Select all
"host" => "127.0.0.1",
"port" => "9000",
Code: Select all
lighty-enable-mod fastcgi
lighty-enable-mod fastcgi-php
Code: Select all
systemctl restart php7.4-fpm
systemctl restart lighttpd