Different PHP Version for a VirtualHost

Alles, was den Apache betrifft, kann hier besprochen werden.

Different PHP Version for a VirtualHost

Postby ubrog » 15. October 2010 18:51

Hi,
I have a client who needs hosting for an old cms version that needs PHP 4.x.x. I know they will have to upgrade eventually, but I need to keep the site up in the meantime. I have managed to compile and install php 4.4.9 as a cgi and I try to configure Apache to use this version for this virtual host only.

The problem is, it just won't work. I've read a lot about AddHandler and AddType and tried to apply it in the VirtualHost config as well as in a .htaccess file without success.
This is my configuration:

Code: Select all
<VirtualHost 12:34:56:78:80>
    ServerName www.domain.com

    DocumentRoot /home/user/public_html
    ErrorLog /home/user/log/error.log
    CustomLog /home/user/log/access.log combined

    <Directory /home/user/public_html>
            Options -Indexes FollowSymLinks MultiViews
            AllowOverride All
            Order allow,deny
            Allow from All
     </Directory>

    DirectoryIndex index.html index.php

    ScriptAlias /php4cgi/ "/var/www/php4/"
    <directory "/var/www/php4">
        AllowOverride None
        Options +ExecCGI +FollowSymLinks
        Order allow,deny
        Allow from all
    </directory>

    Action php4-cgi /php4cgi/php
    AddType php4cgi .php
    AddHandler php4cgi .php

</VirtualHost>


Can someone help me with this?

Also:
  • I tried to apply AddType/AddHandler to the extension .php4 and that worked. But I don't think I can rename all of the php files and all the references. I don't know why it doesnt work with .php
  • I also tried using RemoveHandler and RemoveType with no luck.

Edit: Antworten auf Deutsch sind auch willkommen :-)
ubrog
 
Posts: 3
Joined: 15. October 2010 18:26

Re: Different PHP Version for a VirtualHost

Postby Nobbie » 15. October 2010 19:33

>This is my configuration:

Nein, das ist es nicht. Du hast NIEMALS die IP 12.34.56.78 für den VirtualHost konfiguriert.
Nobbie
 
Posts: 13183
Joined: 09. March 2008 13:04

Re: Different PHP Version for a VirtualHost

Postby ubrog » 15. October 2010 19:50

Nobbie wrote:Nein, das ist es nicht. Du hast NIEMALS die IP 12.34.56.78 für den VirtualHost konfiguriert.


Gut kombiniert, Watson! Und die Domain ist auch nicht http://www.domain.com. Aber die relevanten Angaben stimmen. Noch eine Idee zum eigentlichen Problem?
ubrog
 
Posts: 3
Joined: 15. October 2010 18:26

Re: Different PHP Version for a VirtualHost

Postby Nobbie » 15. October 2010 22:02

ubrog wrote:Aber die relevanten Angaben stimmen. Noch eine Idee zum eigentlichen Problem?


Genau das ist das Problem: wahrscheinlich sind die VirtualHost falsch definiert, weswegen es nicht funktioniert. Aber die entscheidende Stelle hast Du verfälscht. Aber wenn Du so genau weißt, dass es "nicht relevant" ist, dann findest Du den Fehler sicherlich auch alleine, egal wie lange Du an der falschen Stelle suchst.

Überheblichkeit passt schlecht zu Hilflosigkeit.
Nobbie
 
Posts: 13183
Joined: 09. March 2008 13:04

Re: Different PHP Version for a VirtualHost

Postby ubrog » 15. October 2010 22:37

Nobbie wrote:Überheblichkeit passt schlecht zu Hilflosigkeit.


Das sollte nicht überheblich klingen, aber deine Anwtwort war überhaupt nicht Hilfreich. Ich frage ja nicht, wie ich die VirtualHosts konfigurieren muss. Die funktionieren blendend (Und wenn du konkrete Fragen dazu hast, beantworte ich die gerne). Es geht einzig um die Einstellungen für das Handling der .php-Dateien. Ich bin natürlich auch gerne bereit, weitere Daten zu liefern, wenn sie der Lösung des Problems dienen. Aber weshalb meine Domain und IP etwas mit meinem Problem zu tun haben sollten, müsstest du mir erst erklären. Aber egal, vielleicht hat ja jemand anders noch eine Ahnung wie man das Problem angehen könnte.
ubrog
 
Posts: 3
Joined: 15. October 2010 18:26

Re: Different PHP Version for a VirtualHost

Postby Nobbie » 16. October 2010 10:10

Woher weisst Du, dass die VirtualHost "blendend" funktionieren? Ich sehe leider nur einen einzigen, mit einer unvollständigen Definition.

P.S.: Und beschreibe mal die Fehlersituation genauer. "It just dont works" ist unbrauchbar. Du versuchst offensichtlich, PHP im CGI Mode zu installieren (hast Du das Modul dafür deaktiviert?). Und zeige uns bitte die komplette VirtualHost Definition, inkl. richtiger IPs. Was diese seltsame Geheimhaltung von IPs bedeutet, die Du im Web-Alltag jedem in der ganzen Welt zeigst, nur hier denen nicht, die Dir helfen sollen, versteht eh niemand.
Nobbie
 
Posts: 13183
Joined: 09. March 2008 13:04


Return to Apache

Who is online

Users browsing this forum: No registered users and 20 guests