The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

php5 and php4 at the same time is the same?

Discussion in 'General Discussion' started by bsasninja, Jan 15, 2008.

  1. bsasninja

    bsasninja Well-Known Member

    Joined:
    Sep 2, 2004
    Messages:
    528
    Likes Received:
    0
    Trophy Points:
    16
    I have both php 5 (as main) and php 4 running as cgi.
    When a user uploads a script written in php4, apache automatically detects that is php4 and let it run or do I have to specify via .htaccess when is a php4 script??

    Thanks
     
  2. ramprage

    ramprage Well-Known Member

    Joined:
    Jul 21, 2002
    Messages:
    667
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Canada
    If the script is meant for PHP 4 specifically and PHP 5 is the default, the user then must manually specify that 4 runs the script otherwise the default will run it.
     
  3. SuperBaby

    SuperBaby Well-Known Member

    Joined:
    Nov 27, 2003
    Messages:
    331
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Thailand
    cPanel Access Level:
    Website Owner
    Twitter:
    How to tell the script to run under PHP4 instead of the default PHP5?
     
  4. mohit

    mohit Well-Known Member

    Joined:
    Jul 12, 2005
    Messages:
    553
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Sticky On Internet
    use htaccess to declare which php version should be used to parse php files under that a/c.
     
  5. bsasninja

    bsasninja Well-Known Member

    Joined:
    Sep 2, 2004
    Messages:
    528
    Likes Received:
    0
    Trophy Points:
    16
    yeah but php4 and php5 extensions are the same (.php)

    How the .htaccess should be??

    Thanks
     
  6. MattDees

    MattDees cPanel Product Owner
    Staff Member

    Joined:
    Apr 29, 2005
    Messages:
    417
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    You will want to create the following directives in the .htaccess, the first one basically tells a script of ours not to edit this out of the way:


    # Use PHP5 as default
    AddHandler application/x-httpd-php5 .php


    .php4 and .php5 are always parsed by their respective version of php.
     
Loading...
Similar Threads - php5 php4 same
  1. durangod
    Replies:
    2
    Views:
    218

Share This Page