0

I have a server and host multiple clients websites there as vhosts. My Lamp-version is very outdated from 2008 and for a new project and want to have a newer one without changing my old websites, because they will break on update of the newer php-version. Is it posisible to configure a vhost on that system with another Lamp-version or a newer php-version?

System: Debian

Webserver: Apache 2

  • This might be helpfull: it's an answer on askubuntu about running 2 versions of php I wrote a bit ago, the method used should be portable to debian: http://askubuntu.com/a/250187/11120 – Nanne Jul 15 '13 at 12:13

1 Answers1

1

You can't, since the PHP module handles the "application/x-httpd-php" mime type, and if you have two modules loaded, both of them would handle the same mime type. Probably the first to load wins. Module loading is done once upon staring the Apache instance, so you can't configure VirtualHosts to have an other module for PHP loaded.

You can do it with configuring your web server to use CGI, and running the PHP code as CGI script, you can have different interpreters for different type of PHP files. For this, you have to name the "CGI" PHP files to something else so that the original handler wouldn't recognize them.

However, you should really consider upgrading your server. A webserver from 2008 is a relic, and the PHP version you use probably has tons of bugs / security holes fixed long ago. If the old websites needs to be changed, so be it. This price for security doesn't seem too high.

Lacek
  • 7,233
  • 24
  • 28
  • not completely true: you don't need to rename the files, you can define a different handler in the vhosts settings I presume? – Nanne Jul 15 '13 at 12:14
  • does it mean, it is possible or it is not? – Sebastian Viereck Jul 15 '13 at 18:01
  • **@Nanne**: No, you can't do this, because you can't redefine the mapping already active for the x-httpd-php mime type. At least when I tried, Apache silently ignored the CGI mapping. **slaver113**: Theoretically it is possible. However, in my opinion, it is a pain to do this, not optimal, and prone to errors. Your best bet is to upgrade your server. – Lacek Jul 16 '13 at 08:18