Comments on Installing Lighttpd with PHP 7 (PHP-FPM) and MySQL 5.7 on Ubuntu 16.04 LTS
Lighttpd is a secure, fast, standards-compliant web server designed for speed-critical environments. This tutorial shows how you can install Lighttpd on an Ubuntu 16.04 server with PHP 7 support (through PHP-FPM) and MySQL 5.7. PHP-FPM (FastCGI Process Manager) is an alternative PHP FastCGI implementation with some additional features useful for sites of any size, especially busier sites. I use PHP-FPM in this tutorial instead of Lighttpd's spawn-fcgi.
15 Comment(s)
Comments
Hello,
Could you add ISPConfig3 on this setup? If yes, have you tried it?
Thanks,
ISPConfig 3 requires Apache or Nginx as web server, s you can not use it with lighttpd. Nginx is as fast as Lighttpd, so if you want to have a fast alternative to Apache, then use one of the Nginx perfect server tutorials to install ISPConfig.
Untill phpmyadmin everything worked, dunno if it's phpmyadmin or this tuto, I expect the first.
In order to bring up phpMyAdmin I had to perform this command sudo ln -s /usr/share/phpmyadmin /var/www/html
That's only necessary if you missed to enable the lighttpd option (with the space bar of your keyboard) in the apt installer in this step of the tutorial:
Web server to reconfigure automatically: <-- lighttpd
Another way to fix it if you missed to enable it during install is to run: dpkg-reconfigure phpmyadmin
Tried to change the socket to listen on 127.0.0.1 and now my whole site is down showing 503 Service Not Available. Tried to change back to using the sock and still nothing. Cannot restart FPM without it throwing and error. Help please.
I said screw it and just rebuilt another server and this time I will not try to change to listen on 127.0.0.1
My knowledge about Linux is yet not so good. After updating to Ubuntu 14 my HTTP server died. Now I know the exact problem was PHP5>PHP7 update. Your tutorial helped me fix it - 15-fastcgi-php.conf was wrong. So thanks a lot, you saved me a lot of time!
Thank you very much!
Hi
What is the login credentials to phpmyadmin?
Thanks for a good tutorial.
Tobias
Great guide, but i needed to symlink my phpmyadmin to the html folder before being able to log in.
sudo ln -s /usr/share/phpmyadmin/ /var/www/phpmyadminI agree with Mark's comment that this is a great guide, Like him, I also couldnt get to the phpmyadmin after following the instructions. His comment got me started in the right direction but i needed a slightly different symlink than Mark's. Here is what worked for me:
sudo ln -s /usr/share/phpmyadmin/ /var/www/html/phpmyadmin
p.s. tried to reply to Marks, but the main text box on the reply form wouldnt allow me to type into it.
403 forbidden. Why?
Great guide - thanks! One thing that was causing a major headache for me during the phpmyadmin install is the part where you select your web server type. Pressing enter does not select the web server type! You must first hit spacebar to select, then hit enter afterwards. Otherwise you will get a 404 on /phpmyadmin.
If you messed up on this step like me, you may be having trouble getting the full configuration guide to reappear. You need to purge it, which totally removes all config files:
apt-get purge phpmyadmin
Then reinstall and the the option to select web server will appear again.
For those who installed lighttpd from sources (like me due to very old version in Ubuntu's repository): I wasn't able to call lighttpd-enable-mod as the program is not present in the build (The program 'lighttpd-enable-mod' is currently not installed. You can install it by typing: apt install lighttpd). I was not able to find it anywhere and build it again, possibly with altered build options. So, the only thing I actually needed was adding following lines into config in /etc/lighttpd/lighttpd.conf: server.modules = ( # ... "mod_fastcgi" ) fastcgi.server += ( ".php" => (( "socket" => "/var/run/php/php7.0-fpm.sock", "broken-scriptfilename" => "enable" )) )See there is no fastcgi-php module neither.And yeah, don't forget to change rights to /var/run/php/php7.0-fpm.sock appropriately if you're receiving 503 - Service Not Available.