SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Evangelist ikeo's Avatar
    Join Date
    Oct 2004
    Location
    Austin Texas
    Posts
    591
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Running PHP 4 as a module and PHP 5 as fcgi?

    I am having a small problem getting this set up to run properly.

    I have this in apache for PHP4

    LoadModule php4_module "c:\php\sapi\php4apache2.dll"
    AddType application/x-httpd-php .php .phtml .html
    PHPIniDir "C:/php"
    and then this for PHP5

    Listen 83
    <Virtualhost _default_:83>
    ServerName localhost
    DirectoryIndex index.html index.html.var index.php index.cfm
    ErrorLog logs/error_php5.log
    <Location />
    <Limit CONNECT>
    Order allow,deny
    Allow from all
    </Limit>
    </Location>
    DocumentRoot "C:\Program Files\Apache Group\Apache2\htdocs_php5"
    DefaultType text/html
    ScriptAlias /cgi-bin/ "C:/php5/"
    Action php5-script /cgi-bin/php-cgi.exe
    AddType application/x-httpd-php .php .phtml .html
    Action application/x-httpd-php "/cgi-bin/php-cgi.exe"
    </Virtualhost>
    The problem is that when I connect at both
    http://localhost and http://localhost:83/
    The PHP 4 module is used.

    If I change the settings for php4 to
    ScriptAlias /php/ "c:/php/"
    AddType application/x-httpd-php .php .phtml .html
    Action application/x-httpd-php "/php/php.exe"
    Then it works (that is what I'm running right now).
    Does anyone see what I might be doing wrong.

    PS: If this has to be moved then let me know too ... I wasn't sure where to post it so I chose here, figuring a lot of you guys might be trying to do the same thing.

  2. #2
    SitePoint Zealot
    Join Date
    Jul 2004
    Location
    The Netherlands
    Posts
    170
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    With WAMP5 and its PHP4 add-on you can easily switch between the two.

  3. #3
    SitePoint Evangelist ikeo's Avatar
    Join Date
    Oct 2004
    Location
    Austin Texas
    Posts
    591
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks michel but, I want to figure out how to do it via Apache (httpd.conf) if possible.
    I already have both PHP 4 and 5 running as fast cgis. I just want to run Php4 as a module and php 5 as fast cgi.

  4. #4
    SitePoint Zealot
    Join Date
    Aug 2006
    Location
    Poland
    Posts
    108
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I run php5 as module and php4 as cgi
    Default is php5 module, but for certain virtualhost I can do the followin

    <VirtualHost 127.0.0.1:80>

    AddType application/x-httpd-php4 .php
    Action application/x-httpd-php4 /cgi-bin/php4

    And that enforces php4 for the given site.

    So, you can do the similar thing (but installing php4 as module and enforcing php5 cgi where needed)

  5. #5
    SitePoint Evangelist
    Join Date
    Mar 2005
    Posts
    421
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This article from devzone.zend might be of interest?

  6. #6
    SitePoint Evangelist ikeo's Avatar
    Join Date
    Oct 2004
    Location
    Austin Texas
    Posts
    591
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Muchos Gracias skinny ... thanks to all that contributed!
    It took me about 2 hours (mostly because I'm an idiot and am sleep deprived)
    but I got it to work ... thank you so much.
    Even better ... I found (from the article) how to rename my urls so that I just go to http://php5/ to access my php5 executable ... really nice!
    Last edited by ikeo; Dec 20, 2006 at 06:20.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •