Support » Fixing WordPress » Updated to php 8.1.7 – now only serving index.php as text

  • Resolved TNG1


    Hello all,

    I’m a somewhat noob when in all this so my apologies if I am missing something simple.

    I have a site up and running on a Digital Ocean Ubuntu 20.044 LTS server with apache2, all has been screaming along awesomely until this morning when I updated the server through apt.

    Truth be told I was doing 5 things at once and I just didn’t pay too much attention while doing it.

    So it seems I updated php to 8.1.7 and now when I go to the site I am only serving up the contents of index.php as text.

    Same holds true for it only returns: <?php phpinfo(); ?>

    So obviously I have an issue preventing my webserver from handling php as code instead of simple text.

    I assume it has something to do with phi.ini but I thought I would reach out here first.

    I sure could use a push in the right direction…

    Thanks in advance for any and all replies.


Viewing 4 replies - 1 through 4 (of 4 total)
  • Hi @tng1
    I think Maximum WordPress Plugins/themes are using a maximum 7.4 version for development, and also currently maximum plugins/themes aren’t supported 8+ PHP version, so currently I recommend you should use the 7.4 version until all plugins/themes are ready for the 8+ PHP version.

    Best Regards

    Thread Starter TNG1


    Thanks for your reply, Bashar.

    I opted to reinstall php7.4
    apt install php7.4
    then I set 7.4 as default since I still have 8.1.7 installed
    update-alternatives --set php /usr/bin/php7.4
    I also had to reinstall the 7.4 mysql extension with
    apt install php7.4-mysql

    That did the trick…hope this helps someone else out there with the same issue.


    Hi @tng1
    can you share any screenshots of your error?

    Thread Starter TNG1


    Md, thanks for your help on this. Closing the thread as my last post solved the issus.

Viewing 4 replies - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.