#1 (permalink)  
Old 06-14-2009, 04:47 PM
Registered User
 
Join Date: Jun 2009
Posts: 3
Dysonsphere is on a distinguished road
Post Cpanel PHP.INI Editor

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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 06-14-2009, 04:57 PM
Spiral's Avatar
Registered User
 
Join Date: Jun 2005
Location: Area 51
Posts: 1,501
Spiral is on a distinguished road
Exclamation

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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 06-14-2009, 05:17 PM
Registered User
 
Join Date: Jun 2009
Posts: 3
Dysonsphere is on a distinguished road
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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 06-14-2009, 06:25 PM
Spiral's Avatar
Registered User
 
Join Date: Jun 2005
Location: Area 51
Posts: 1,501
Spiral is on a distinguished road
Lightbulb

Quote:
Originally Posted by Dysonsphere View Post
Yes I was talking about PHP4 and PHP5 The reason I wanted this is some scripts wont run on PHP5 without fixing.
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.

Quote:
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.
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.

Quote:
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...
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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 06-15-2009, 03:42 AM
Registered User
 
Join Date: Mar 2003
Posts: 205
flashweb
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.
__________________
HostOnNet.com
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 06-16-2009, 11:47 AM
cPanelDavidG's Avatar
cPanel Technical Sales
 
Join Date: Nov 2006
Location: Houston, TX
Posts: 7,995
cPanelDavidG is on a distinguished road
Quote:
Originally Posted by Dysonsphere View Post
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
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.
__________________
Want our technical analysts to login to your server to assist you? You can contact our technical analysts at: http://tickets.cPanel.net/submit
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 06-16-2009, 11:55 AM
Spiral's Avatar
Registered User
 
Join Date: Jun 2005
Location: Area 51
Posts: 1,501
Spiral is on a distinguished road
Quote:
Originally Posted by flashweb View Post
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.
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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8 (permalink)  
Old 06-16-2009, 12:28 PM
Registered User
 
Join Date: Jun 2009
Posts: 3
Dysonsphere is on a distinguished road
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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Tags
cpanel hosting , linux dedicated servers , php.ini

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
php.ini and override default php.ini areh cPanel and WHM Discussions 6 08-24-2009 06:45 PM
custom php.ini for cpanel Cristi4n cPanel and WHM Discussions 0 08-20-2008 11:59 AM
[ask] /usr/local/cpanel/3rdparty/etc/php.ini finly cPanel and WHM Discussions 4 05-30-2008 09:43 AM
/usr/local/cpanel/3rdparty/etc/php.ini ?! sehh cPanel and WHM Discussions 3 12-02-2007 02:28 PM
cpanel overwriting php.ini tifosi cPanel Newbies 5 06-27-2007 08:22 AM


All times are GMT -5. The time now is 11:19 AM.


Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
© cPanel Inc