I'm trying to serve a website running Apache2 alongside PHP on my Raspberry Pi 1.3.

I have already installed Apache with sudo apt install apache2 -y followed by sudo apt install php libapache2-mod-php -y. The RootDocument is pointing to index.php.

However, PHP is not loading. When I try to lookup the module inside /etc/apache2/mods-available, the PHP module itself is nowhere to be found. What can I do?

2 Answers 2


libapache2-mod-php is a virtual package provided by libapache2-mod-php7.3 in Buster and libapache2-mod-php7.0 in Stretch. Check if you have the correct package installed. If not, you should find out why (perhaps you need to run sudo apt-get -f install). As a last resort, you can install the correct package manually.


Run the Apache module enable software.

From memory

sudo a2enmod

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.