I installed PHP 5.6 with:
apt install php5.6
Then I added a -s link in /etc/apache2/mods-enabled
for php5.6.conf
and php5.6.load
When I restarted apache2 I got this error that wasn't there before:
Syntax error on line 146 of /etc/apache2/apache2.conf
Line 146 looks like this:
IncludeOptional mods-enabled/*.load
so I looked at php5.6.load
and it says:
# Conflicts: php5
# Depends: mpm_prefork
LoadModule php5_module /usr/lib/apache2/modules/libphp5.6.so
Finally I tried to look at /usr/lib/apache2/modules/libphp5.6.so
but it wasn't there.
hostnamectl spits this out:
Icon name: computer-vm
Chassis: vm
Virtualization: vmware
Operating System: Ubuntu 18.04.6 LTS
Kernel: Linux 4.15.0-213-generic
Architecture: x86-64
This is a server that was provisioned to me by my hosting provider who said that they tried multiple times and could not install PHP 5.6 as an Apache module. But I suspect it's possible and that they are just lazy. It's already installed as commandline
php -v
outputs:
PHP 5.6.1 (cli) (built: Oct 3 2023 04:21:44) Copyright (c) 1997-2014 The PHP Group Zend Engine v2.6.0, Copyright (c) 1998-2014 Zend Technologies
apache2 -v
outputs
Server version: Apache/2.4.29 (Ubuntu) Server built:
2023-03-08T17:34:33
Any ideas how to fix this? I need PHP 5.x because I'm running an old PHP site that was coded in 2006. I believe it was last working on PHP 5.2 or PHP 5.3. I have never tried to run it on PHP 5.6 but I suspect it would still work as long as it isn't PHP 7+. PHP 5.4-5.5 are also not an option because of problems with those versions.