Php4 / Php5

Discussion in 'Server Operation' started by sjau, Sep 26, 2007.

  1. sjau

    sjau Local Meanie Moderator

    Hello

    I need help for writing a .htaccess file.

    (1) My server is running PHP5 as apache2 module
    (2) I did also install PHP4 as cgi
    Both PHP versions suhoshin ones...

    (3) When I want to run PHP4 in a specific folder I use this .htaccess:
    Code:
    AddHandler php-script .php
    Action php-script /cgi-bin/php4 
    
    So, let's say I have a folder /var/www/webX/html/ that runs on PHP4 because of the .htaccess in there, how can I then make a subfolder of it to use PHP5 again (e.g. /var/www/webX/html/pwg/)?
     
  2. falko

    falko Super Moderator Howtoforge Staff

    I haven't tested this, but you could try to delete the .htaccess file and use something like

    Code:
    <DirectoryMatch "^/var/www/webX/html$">
      AddHandler php-script .php
      Action php-script /cgi-bin/php4 
    </DirectoryMatch>
    in the vhost configuration. The $ at the end of the regex should make sure that only /var/www/webX/html matches the regex.
     
  3. sjau

    sjau Local Meanie Moderator

    I can try that ;) thx falko
     
  4. falko

    falko Super Moderator Howtoforge Staff

    Please let me know if it worked. :)
     
  5. sjau

    sjau Local Meanie Moderator

    nope, it's using PHP5 :(
     
  6. falko

    falko Super Moderator Howtoforge Staff

    Can you try
    Code:
    <DirectoryMatch "^/var/www/webX/html[B][COLOR="Red"]/[/COLOR][/B]$">
    instead?
     

Share This Page