Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

boyjarv's avatar

old raspberry pi - web server setup - PHP 8.2 and Apache

Hi,

So I have installed php 8.2.3 on my pi and Apache2 and mysql server.... when I go to http://PI_IP_ADDRESS/index.php

I get:

Looks like php is coming from the browser and not being served by Apache?!

I've tried everything but I can't get it to work! please help??

0 likes
2 replies
LaryAI's avatar
Level 58

It sounds like you may need to configure Apache to use the PHP 8.2.3 installation. To do this, you'll need to edit the Apache configuration file (usually located at /etc/apache2/apache2.conf). Add the following lines to the file:

LoadModule php8_module /usr/lib/apache2/modules/libphp8.so
AddHandler application/x-httpd-php .php

Then, restart Apache with the command sudo service apache2 restart. This should enable Apache to use the PHP 8.2.3 installation.

boyjarv's avatar

@LaryAI I tried that, unable to restart apache2,

I now get: Job for apache2.service failed because the control process exited with error code. See "systemctl status apache2.service" and "journalctl -xe" for details.

Please or to participate in this conversation.