#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2003
    Posts
    105
    Rep Power
    11

    Multiple php versions on a single iis 7 (diff web apps)


    hi all

    i am trying to run two different versions of php on my windows 2008 r2 server with iis7. phew. haha

    my primary one is already setup as 5.3.0 but i also need to run 5.2.x for some legacy app we need.

    i installed two directories of php one c:\php\ and c:\php 5.2\ and setup the handler for .php files in IIS to point to the right php-cgi.exe file.

    it seems to work (like phpinfo works and shows the correct version) but when i open a command prompt at c:\php 5.2\ and type php -v i get lots of problems with the extensions and mysql for example isn't loading the modules.

    for some reason php 5.2 is wrongly loading the php.ini file for 5.3.0. where is this set? how can i get it to use the php.ini file that is located in c:\php 5.2.x\php.ini file?

    Code:
    Loaded Configuration File 	C:\PHP\php.ini
    thanks for any help!
  2. #2
  3. No Profile Picture
    Grumpier old Moderator
    Devshed Supreme Being (6500+ posts)

    Join Date
    Jun 2003
    Posts
    14,440
    Rep Power
    4539
    I have no idea how or if you can run two different php versions. You'll obviously need to use different file extensions if it's even possible. I thought v5.3 was backwards compatible with v5.2?
    ======
    Doug G
    ======
    Bartender to Rene Descartes "have another beer?" Descartes: "I think not" and he vanished.
    --Alfred Bester
  4. #3
  5. Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Mar 2004
    Location
    Kostolac, Serbia
    Posts
    855
    Rep Power
    1391
    On standard Apache configurations in order to use two different versions of PHP simply creating separate server handlers for each of them would solve the problem but to be honest I am not sure if something similar would be possible on IIS (got a bit rusty on it lately )
    Originally Posted by Doug G
    I thought v5.3 was backwards compatible with v5.2?
    Well for the most part 5.3 is compatible with previous versions of PHP but there are some major changes that came with PHP v5.3, mostly regarding the configuration of the PHP environment, which make for some headaches when it comes to code written for prior PHP versions. I.e. some optional (but often used) PHP runtime configuration options like magic quotes and register globals are not part of PHP 5.3 anymore etc. Generally therefore PHP 5.3 is considered to be more of an early PHP 6.0 edition that part of the PHP 5.x gamma
    PHP Code:
    <?php
    abstract class Ignorance extends Stupidity implements Unavoidable 
         public static 
    $humiliation

         private function 
    __construct(){
            
    parent::__destruct();
         }; 

    ?>
  6. #4
  7. No Profile Picture
    Grumpier old Moderator
    Devshed Supreme Being (6500+ posts)

    Join Date
    Jun 2003
    Posts
    14,440
    Rep Power
    4539
    Thanks for the info holodoc

    Kind of wandering OT, by separate handlers in apache does that mean using different file extensions and setting each extension to map to a different php executable? If so, you can also map file extensions to different binaries in IIS, which would be similar.

    I'm assuming there needs to be some mechanism to instruct the web server which version of php to use for the requested page.
    ======
    Doug G
    ======
    Bartender to Rene Descartes "have another beer?" Descartes: "I think not" and he vanished.
    --Alfred Bester

IMN logo majestic logo threadwatch logo seochat tools logo