PHP: Mehrere Versionen auf einem Rechner

(Kommentare: 0)

Problem: Verschiedene PHP-Versionen bzw. verschiedene Apache-Webserver parallel auf meinem Rechner laufen lassen für unterschiedliche Websites mit unterschiedlichen PHP-Versionen.

Also: Windows XP Rechner, Apache 1.3, PHP 4 und 5. Möchte auf localhost mit verschiedenen Ports sagen wir 2 Webserver laufen lassen, der eine mit PHP 4, der andere mit PHP 5. Denn: Historische Gründe, hatte noch einige ältere Websites zu pflegen und laufen zu lassen, die halt nur mit PHP 4 gingen.

Habe dafür PHP 4 (siehe auch PHP: Alte PHP-Versionen) und PHP 5 als ZIP-File heruntergeladen und "installiert" (ausgepackt) unter C:\Programme.

Am besten hat es dann am Ende funktioniert, PHP 4 als Modul einzubinden und PHP 5 als CGI-Variante.

Erstes Projekt bzw. erste Apache-Instanz (Port 84) mit PHP 4:


C:\Projekt_1\httpd.conf, Ausschnitt:

# Add to the end of the LoadModule section
# Don't forget to copy this file from the sapi directory!!!!!!!!!!!!!!!!!!!!!
LoadModule php4_module C:/Programme/PHP422/php4apache.dll

# ...

# Add to the end of the AddModule section
AddModule mod_php4.c

# ...
AddType application/x-httpd-php .php

# ...
Port 84



Start-Skript: C:\Projekt_1\apache_start.bat

set PHPRC=C:\Programme\PHP422
set PATH=%PATH%;C:\Programme\PHP422;C:\Programme\PHP422\extensions;C:\Programme\PHP422\dlls
C:\Programme\Apache\Apache.exe -d "C:\Programme\Apache"   -f "C:\Projekt_1\httpd.conf" -k start


Zweites Projekt bzw. zweite Apache-Instanz (Port 85) mit PHP 5:


C:\Projekt_2\httpd.conf, Ausschnitt:
# ...
ScriptAlias /php/ "C:/Programme/PHP528/"
AddType application/x-httpd-php .php
Action application/x-httpd-php "/php/php.exe"

# ...
Port 85


Start-Skript: C:\Projekt_2\apache_start.bat

set PATH=%PATH%;C:\Programme\PHP528;C:\Programme\PHP528\ext
set PHPRC=C:/Programme/PHP528
C:\Programme\Apache\Apache.exe -d "C:\Programme\Apache"   -f "C:\Projekt_2\httpd.conf" -k start

So, damit hat's bei mir funktioniert.

 

Zurück

Kommentare

Einen Kommentar schreiben


Bitte geben Sie den Code ein, den Sie im Bild sehen.