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.

Cpanel PHP.INI Editor

Discussion in 'General Discussion' started by Dysonsphere, Jun 14, 2009.

  1. Dysonsphere

    Dysonsphere Registered

    Joined:
    Jun 14, 2009
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    Hello,
    I am using Cpanel with Linux and would like to add an "Enhanced Script Library" icon in the Cpanel for the clients to be able to select which PHP Version to use for there domain and be able to edit the PHP.INI

    Can any body point me in the right direction?

    Thanks,
    Mike
     
  2. Spiral

    Spiral BANNED

    Joined:
    Jun 24, 2005
    Messages:
    2,023
    Likes Received:
    7
    Trophy Points:
    0
    Don't know how to implement this without custom coding it yourself.

    While it is definitely possible to run different PHP versions for each account
    and even different PHP configurations for each account, this requires
    modifications to the VirtualHost section of your Apache configuration
    and that is usually done manually for something like that although
    it is something that could at least theoretically be scripted.

    A much easier approach is to make both versions of PHP available to
    all clients and setup different filename extensions for each version.
    With this kind of configuration, you won't need any special scripting
    or manual configuration and could even do this from EasyApache.

    However ...

    I do have a question as to what you mean by "VERSIONS" exactly?

    Assuming you mean offering some clients "PHP4" and some "PHP5",
    it would be far better if you drop PHP4 entirely and just offer PHP5
    only as we are now long past the official death date of PHP4 and it is
    no longer supported and is not really supposed to be used anymore.
     
  3. Dysonsphere

    Dysonsphere Registered

    Joined:
    Jun 14, 2009
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    Php.ini

    Thanks for the feedback spiral

    Yes I was talking about PHP4 and PHP5 The reason I wanted this is some scripts wont run on PHP5 without fixing.

    Also would be a good troubleshooting tool when trying to upgrade the script to PHP5. Could keep switching back and forth to see the effects.

    The reason I wanted to have the Clients be able to modify the PHP.INI file is to reduce support calls. I know on Fatcow I could modify the file in Cpanel (I Think They use Cpanel?) with out having to open a ticket. And Waiting....And Waiting...

    Regards,
    Mike
     
  4. Spiral

    Spiral BANNED

    Joined:
    Jun 24, 2005
    Messages:
    2,023
    Likes Received:
    7
    Trophy Points:
    0
    Several years time was given to allow all script authors to release new
    versions compatible with PHP5 before PHP4 was ultimately declared dead.

    At this time, you really shouldn't have any scripts that don't work on PHP5
    as most everything out there has already long since been updated.

    If you have some archaic old script designed for PHP4 specifically which
    for whatever reason was never updated, chances are very good that it
    will work perfectly fine under PHP5 without any modifications as PHP5 is
    more than 98% fully backwards compatible with PHP4 and the functions
    and reserved names that have changed enough to require code changes
    are more rarely used and generally not present in most old PHP4 scripts.

    True but comes several years late as this should have already been done.

    Just as a side note, we officially discontinued support for PHP4 over
    five years ago at all my companies, hosted thousands of accounts,
    and never had a single complaint about any script not working properly.

    Most of the complaints you see out there about certain old scripts not
    working on PHP5 actually stemmed more from the hosting providers not
    knowing how to properly install PHP5 than from any actual real compatibility
    issue and though there were some scripts out there with compatibility issues,
    they were actually extremely rare. You wouldn't believe how many arguments
    I got in over the years with software authors who they themselves did not
    realize their own scripts worked 100% perfectly fine on PHP5 without any
    modifications whatsoever and time and time again, they would say their
    programs were incompatible and then have their foot in their mouth when
    I would show them first hand how wrong they were.

    Fortunately, much of that is all past history now. PHP4 is officially dead
    and no longer support and all scripts out there are supposed to be written
    at least minimum PHP5 standard now anyway. Those very few scripts out
    there that were never updated because perhaps development was stopped
    or the projects were abandoned most likely still work fine under PHP5 with
    no modification and if in the rare instance some modification were required,
    it would most likely be something very minimal and able to patch in seconds.

    Allowing clients access to PHP.INI may or may not reduce support calls but
    it will definitely open up a lot of new security headaches for you.

    If you must run both PHP4 and PHP5, I would suggest setting up to run
    under different extensions such as "filename.php4" for PHP4 and then
    use "filename.php" or "filename.php5" for normal PHP5 and just allow
    all accounts to use both PHP4 and PHP5. Those who want to be parsed
    by PHP4 would then only need to rename their script filenames.

    I would recommend running both as CGI modules under SuPHP but you
    could also run one as a CGI (again preferably with SuPHP) and the other
    as an Apache DSO module. However, you cannot run PHP4 and
    PHP5 simultaneously both as Apache modules -- at least one must be CGI
    unless you do some patching to the PHP source code a bit.
     
  5. flashweb

    flashweb Well-Known Member

    Joined:
    Mar 13, 2003
    Messages:
    243
    Likes Received:
    0
    Trophy Points:
    16
    cPanel Access Level:
    Root Administrator
    Dysonsphere, thanks for A :)

    As Spiral told, you won't find much problem in using your php scripts in PHP 5. When i upgraded my servers with php 4 to php 5, no clients complained about that. I have done upgrade for some client servers too, never had a problem, some times need to tuen on register_globals and adjust error_reporting.

    Only very few clients need custom php.ini, for them just copy php.ini to their folder. Disadvantage is they can do whatever they need, for example if you have some functions disabled on your server for security, user can enable them. They get full control can create security problem.
     
  6. cPanelDavidG

    cPanelDavidG Technical Product Specialist

    Joined:
    Nov 29, 2006
    Messages:
    11,279
    Likes Received:
    8
    Trophy Points:
    38
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    If you have installed PHP 4 and PHP 5 via EasyApache, your users should be able to go click on the PHP Configuration icon in their cPanel interface and select which version of PHP to use for their account. If you don't see this, feel welcome to let our technical analysts take a look at that for you: http://tickets.cPanel.net/submit.

    As for letting users edit their own PHP.ini via a GUI, that would be done by creating a cPanel Plug-in.
     
  7. Spiral

    Spiral BANNED

    Joined:
    Jun 24, 2005
    Messages:
    2,023
    Likes Received:
    7
    Trophy Points:
    0
    What you describe is the custom configuration for the old phpSuExec mode.

    This problem does not exist if you run your PHP as SuPHP!

    PHP overrides are restricted to PHP.INI file only and any custom PHP.INI
    files are specified in the HTTPD.CONF and their locations and the files
    themselves need not be user accessible.
     
  8. Dysonsphere

    Dysonsphere Registered

    Joined:
    Jun 14, 2009
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    Thanks

    Thanks for Everybody’s responses, I think I will head the advice of using PHP5 only and do not let the client edit their own PHP.INI for Security concerns.
    Thanks,
    Mike
     
Loading...

Share This Page