You are not logged in.

#1 2021-04-27 23:58:48

rustbuckett
Member
Registered: 2020-12-24
Posts: 1

Using both php (8.0.3) and php7 (7.4.16) with apache

The reason for this curiosity is kinda silly, but now it's become a minor obsession. I want to get DokuWiki working on my laptop using Apache without to downgrade PHP. There seems to be a way to get this to work using .htaccess and the the line

AddHandler application/x-httpd-php7 .php

but that alone doesn't do anything. I suspect that both versions of PHP and their respective modules must be loaded, but I haven't tracked down the right combination of config options to make it work. If I try to include both php_module.conf and php7_module.conf and/or both libphp.so and libphp7.so, httpd crashes. Has anyone here gotten something like this to work properly? I just want to use php 8.0.3 for everything except DokuWiki for which I'd like to use php7 (7.4.16).

Last edited by rustbuckett (2021-04-28 00:00:31)

Offline

#2 2021-04-28 00:03:25

virtualperson72
Member
Registered: 2019-09-17
Posts: 5

Re: Using both php (8.0.3) and php7 (7.4.16) with apache

Yea - two versions of the same module would be tough for one web browser.    An easy way to get this to work would be to run two web servers on different ports - one with PHP 7, the other with PHP 8.   You'd need two different config files, etc.

Offline

#3 2021-04-28 06:00:09

progandy
Member
Registered: 2012-05-17
Posts: 4,285

Re: Using both php (8.0.3) and php7 (7.4.16) with apache

Another option would be to run at least one php version with fcgi and php-fpm. Then configure it to be used in a specific virtual host (<VirtualHost>) or subdirectory (<Directory> / <DirectoryMatch>) only.
https://wiki.archlinux.org/index.php/Ap … proxy_fcgi

Last edited by progandy (2021-04-28 06:02:42)


| alias CUTF='LANG=en_XX.UTF-8@POSIX ' |

Offline

Board footer

Powered by FluxBB