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.

php version

Discussion in 'General Discussion' started by cheitac, Nov 8, 2011.

  1. cheitac

    cheitac Member

    Joined:
    Jun 13, 2011
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    1
    Hi all!

    I have installed both php4 and php5 on my cpanel. Default is php5, but there are some users, who uses php4. how can i collect which users uses php4 and which php5?


    Thanks!
     
  2. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    Normally, you will end up with the user either naming their files .php4 to use PHP 4 (if PHP 4 is not the default handler and PHP 5 is the default handler), or the PHP 4 users will put an AddType into an .htaccess file on their account.

    You could do a find for php4 named files as well as a find for AddType within .htaccess files.
     
  3. cheitac

    cheitac Member

    Joined:
    Jun 13, 2011
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    1
    its helpfull when users uses .htaccess, but there are many users who has not ./htaccess. on servers default handler is php5. is there some configuration files where stored information about that? for example in apache virtualhosts there are both but there is no information which is default.

    thanks!
     
  4. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    If you aren't certain which you have as the default PHP handler, you can see it in WHM > Apache Configuration > PHP and SuExec Configuration area for the default PHP handler. The reason you need to know if PHP 4 or PHP 5 is set as the default is that if it is PHP 4 that is default, then it would be php5 for the filename the user would use and the AddType would be for PHP 5 in the .htaccess files.

    Since users can use both PHP 4 and PHP 5 on an account in different files depending on the file extension name, there is definitely no way to tell by any user configuration file that cPanel itself has to show a list of users using what PHP (4 or 5). You'd have to do it the way I mentioned, which is a find command for php4 or php5 extension names for files and for AddType in the .htaccess files.
     
  5. storminternet

    storminternet Well-Known Member

    Joined:
    Nov 2, 2011
    Messages:
    462
    Likes Received:
    0
    Trophy Points:
    16
    cPanel Access Level:
    Root Administrator
    If you are not sure which is the default php version on server then just create file, phpinfo.php with the following code from file manager or upload it through ftp into public_html folder of the site.


    You will come to know default php version on server when you access URL http://sitename/phpinfo.php
     
  6. cheitac

    cheitac Member

    Joined:
    Jun 13, 2011
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    1
    Thanks it was very helpful for me. :)
     
Loading...

Share This Page