XILO Community Forum

Support 0845 034 6444 • Sales 0800 084 2421

Go Back   XILO Community Forum > Customer Support > Support Queries > cPanel Resellers - PHPsuexec and register_global changes.
Support Queries This forum should be used to contact XILO's support team should you have any problems with your account.

Closed Thread
 
LinkBack Thread Tools Display Modes
  (#1 (permalink)) Old
XILO Staff
Matt is on a distinguished road
 
Matt's Avatar
 
Posts: 687
Join Date: Nov 2005
Default cPanel Resellers - PHPsuexec and register_global changes. - 10/05/2006, 12:51 AM

Dear Reseller Customers,

Over the last few months, we have been evaluating PHPsuexec which has many security benefits.

Currently, when a PHP script is called via your web browser it is executed by the webserver user nobody and not the user account where the script actually resides.

This is also a problem for many content management systems such as Mambo/Joomla! and also some gallery software such as "gallery" and coppermine as the files are written by the "nobody" user which can then not be edited or removed via your normal FTP account. (We do receive many tickets regarding this issue; asking us to delete files).


What changes may need to be made on your site.
If you use any php_flag directives in a .htaccess file, you will need to move these into a file named php.ini to allow the override to work correctly.

The directive we see used the most is register_globals. Below, we will detail the change needed for any site requiring this to be on.

In your .htaccess file you would have listed;
php_flag register_globals on

This would then be replaced with the following in php.ini;
register_globals=on


Possible Error Messages
Internal Server Error 500 is generally caused by files with permissions that are set incorrectly.

As the owner is running the script instead of the web server user, folders with 777 permissions are no longer permitted and will cause this error to occur. Setting to 755 should resolve the issue.

The maximum permissions you can assign to a file under PHPsuexec are 644 and for folders is 755.

Inline with this upgrade, register_globals will be disabled globally to also help with security. This is already the case on a number of servers but for those sites that require this function to be on, please follow the above instructions on creating a php.ini file to set this.


We plan to start these upgrades in the following order of servers to start with.

kilo - 14th May 2006 - Complete
asteroid - 14th May 2006 - Complete
delta - 17th May 2006 - Complete
alpha - 30th May 2006 - Complete
bravo - 31st May 2006 - Complete
foxtrot - 4th June 2006 - Complete
charlie - 4th June 2006 - Complete


We have a number of scripts that will fix most common problems, however, there is always the chance that we may miss one or two less standard sites.

The first change will take place in the early hours of this weekend (sunday) on the kilo server only.

Please use this thread if you have any questions regarding the technical aspects of your site or for any further information.

---
Added after initial post.

Zend
If you need to have Zend Optimizer support, you should add the following to php.ini if you have any problems with it not showing the encrypted files.

Code:
[Zend]
zend_optimizer.optimization_level=15
zend_extension_manager.optimizer=/usr/local/Zend/lib/Optimizer-3.0.0
zend_extension_manager.optimizer_ts=/usr/local/Zend/lib/Optimizer_TS-3.0.0
zend_optimizer.version=3.0.0


zend_extension=/usr/local/Zend/lib/ZendExtensionManager.so
zend_extension_ts=/usr/local/Zend/lib/ZendExtensionManager_TS.so


XILO Communications Ltd.
Internet Hosting and Online Services
w: http://www.xilo.net/
h:
http://my.xilo.net/
t: +44 (0) 845 034 6444
f: +44 (0) 845 034 6555
  (#2 (permalink)) Old
Reseller
arrivist is on a distinguished road
 
Posts: 6
Join Date: Feb 2006
Location: Bedfordshire
Default Re: cPanel Resellers - PHPsuexec and register_global changes. - 11/05/2006, 9:46 PM

Can you clear up a couple of points?

1. Are you going to update the permissions for php files/folders when you install the PHPsuexec software or do we need to do it?

2. Is there any way we can test a php.ini before the switchover? I have had problems with php session files being created as 'nobody' so I have set up a custom session handler that uses mysql to store my session data. Obviously I need to make sure the transition is seamless otherwise I may lose session info, and consequently custom.

3. Do you know if you can use the php.ini files in a hierarchical manner as you can with .htaccess. For example, I set the following flags in my root .htaccess file:
>> php_flag display_errors off
>> php_value error_reporting 7

If I have problems with a script in a subdirectory, I just add a .htaccess file to the subdirectory with:
>> php_flag display_errors on
and I get full error reporting in that directory ONLY. It is very useful to be able to affect php functionality on a directory by directory basis.

4. Most developers do not use PHPsuexec when creating packages, and consequently any php packages we install from external sources may have incompatible permissions. From my understanding, PHPsuexec will REFUSE to run any scripts that are world writable, and this may cause problems for the uninitiated when external packages are installed. Are you going to provide any tools to 'correct' the permissions so that they are compatible with the PHPsuexec software?

5. Lastly, do you send out emails warning of such changes? (I can't find any mention of a mailing list in my account settings). I only happened across this news because I was browsing the forums, however had I not spotted it this change could have caused real problems with my sites. May I suggest that if you do not have a newsletter in place, that you consider creating one. I for one would prefer to be contacted and pre-warned of such changes.

Sorry for the rant ....
Richard
  (#3 (permalink)) Old
Techie & Moderator
Kieran is on a distinguished road
 
Kieran's Avatar
 
Posts: 769
Join Date: Apr 2006
Location: Swindon, UK
Default Re: cPanel Resellers - PHPsuexec and register_global changes. - 11/05/2006, 10:39 PM

I have been on a server with PHPsuexec on it before and quite like it so am in favour of the change - there is nothing more annoying that not being able to delete a file in your own space because it was written by php. As the changes will make php run as the user, will this mean files previously created by php will now not be writable by php again? If so, can it be arranged to chown everything currently owned by nobody in public_html to the user?

That aside, can we have precise dates/times for the installation of PHPsuexec on each server? I ask because changing to 755 on directories that need to be writable early will cause CMS/upload scripts to fail, and likewise doing it too late will cause failures/500 errors. Neither of which is desirable, especially for busy sites.

Thanks
  (#4 (permalink)) Old
Tom Tom is offline
XILO Staff
Tom is on a distinguished road
 
Tom's Avatar
 
Posts: 172
Join Date: Nov 2005
Default Re: cPanel Resellers - PHPsuexec and register_global changes. - 12/05/2006, 1:18 PM

Quote:
Originally Posted by arrivist
1. Are you going to update the permissions for php files/folders when you install the PHPsuexec software or do we need to do it?
Yes. There is a cPanel script that should resolve 99% of incorrect file permissions and ownerships.

Quote:
Originally Posted by arrivist
2. Is there any way we can test a php.ini before the switchover? I have had problems with php session files being created as 'nobody' so I have set up a custom session handler that uses mysql to store my session data. Obviously I need to make sure the transition is seamless otherwise I may lose session info, and consequently custom.
No This is one downside. Until we compile in phpsuexec, Apache/PHP does not look for it.

However, sessions in a mysql DB - should not be affected. If you can, once we release dates for your server, send us a mail - we will check your site after completion.

Quote:
Originally Posted by arrivist
3. Do you know if you can use the php.ini files in a hierarchical manner as you can with .htaccess. For example, I set the following flags in my root .htaccess file:
>> php_flag display_errors off
>> php_value error_reporting 7

If I have problems with a script in a subdirectory, I just add a .htaccess file to the subdirectory with:
>> php_flag display_errors on
and I get full error reporting in that directory ONLY. It is very useful to be able to affect php functionality on a directory by directory basis.
I'll be honest and say I don't know and have not tried. If you want to have a play with some phpsuexec enabled space - drop us a line.

I will try and find out the answer in the interim however.

Quote:
Originally Posted by arrivist
4. Most developers do not use PHPsuexec when creating packages, and consequently any php packages we install from external sources may have incompatible permissions. From my understanding, PHPsuexec will REFUSE to run any scripts that are world writable, and this may cause problems for the uninitiated when external packages are installed. Are you going to provide any tools to 'correct' the permissions so that they are compatible with the PHPsuexec software?
When you install packages via Fantastico or FTP uploads, all files will be owned by you. Most packages (the ones i've seen), will advise to set to 777 but if that does not work set to 755 - which does the same thing under phpsuexec.

We'll only correct the permissions on initial change over. After then, any scripts you install will need to be manually set - but as a general rule, anything that requires 777 should be set to 755.

Quote:
Originally Posted by arrivist
5. Lastly, do you send out emails warning of such changes? (I can't find any mention of a mailing list in my account settings). I only happened across this news because I was browsing the forums, however had I not spotted it this change could have caused real problems with my sites. May I suggest that if you do not have a newsletter in place, that you consider creating one. I for one would prefer to be contacted and pre-warned of such changes.
We did once run a monthly news email but we had a number of customers that did not want to receive it - so we decided to stop it.

The forums are the official place for news and should be checked regularly. However, we'll see what we can do to setup a mailing list, opt-in only where we duplicate the messages posted here - would that be better for you?

Tom


XILO Communications Ltd.
Internet Hosting and Online Services
w: http://www.xilo.net/
h: http://my.xilo.net/
t: +44 (0) 845 034 6444
f: +44 (0) 845 034 6555
  (#5 (permalink)) Old
Tom Tom is offline
XILO Staff
Tom is on a distinguished road
 
Tom's Avatar
 
Posts: 172
Join Date: Nov 2005
Default Re: cPanel Resellers - PHPsuexec and register_global changes. - 12/05/2006, 1:22 PM

Quote:
Originally Posted by Kieran
I have been on a server with PHPsuexec on it before and quite like it so am in favour of the change - there is nothing more annoying that not being able to delete a file in your own space because it was written by php. As the changes will make php run as the user, will this mean files previously created by php will now not be writable by php again? If so, can it be arranged to chown everything currently owned by nobody in public_html to the user?
Yes. There is a cPanel script that we will run the fix most permission and ownership problems.

Quote:
Originally Posted by Kieran
That aside, can we have precise dates/times for the installation of PHPsuexec on each server? I ask because changing to 755 on directories that need to be writable early will cause CMS/upload scripts to fail, and likewise doing it too late will cause failures/500 errors. Neither of which is desirable, especially for busy sites.
These will be added to the original post shortly.

Tom


XILO Communications Ltd.
Internet Hosting and Online Services
w: http://www.xilo.net/
h: http://my.xilo.net/
t: +44 (0) 845 034 6444
f: +44 (0) 845 034 6555
  (#6 (permalink)) Old
Reseller
arrivist is on a distinguished road
 
Posts: 6
Join Date: Feb 2006
Location: Bedfordshire
Default Re: cPanel Resellers - PHPsuexec and register_global changes. - 13/05/2006, 8:04 AM

Quote:
We did once run a monthly news email but we had a number of customers that did not want to receive it - so we decided to stop it.

The forums are the official place for news and should be checked regularly. However, we'll see what we can do to setup a mailing list, opt-in only where we duplicate the messages posted here - would that be better for you?

Tom
I think an opt-in newsletter would be ideal. I must admit that I don't check the forums as often as I should, and if I receive an email I've no excuse!

Richard
  (#7 (permalink)) Old
Techie & Moderator
Kieran is on a distinguished road
 
Kieran's Avatar
 
Posts: 769
Join Date: Apr 2006
Location: Swindon, UK
Default Re: cPanel Resellers - PHPsuexec and register_global changes. - 13/05/2006, 9:07 AM

arrivist, you can subscribe to different forums and you recieve an e-mail if a new thread has been posted in the last 24 hours.
  (#8 (permalink)) Old
User
risingfree is on a distinguished road
 
Posts: 69
Join Date: Dec 2005
Location: Scotland
Default Re: cPanel Resellers - PHPsuexec and register_global changes. - 15/05/2006, 11:11 AM

Hi,
I think I've got to grips with what is needed here but I've got a bit of a thick head this morning
Should the php.ini file, if needed, go into or above the public directory or does this exist somewhere already?
  (#9 (permalink)) Old
Techie & Moderator
Kieran is on a distinguished road
 
Kieran's Avatar
 
Posts: 769
Join Date: Apr 2006
Location: Swindon, UK
Default Re: cPanel Resellers - PHPsuexec and register_global changes. - 15/05/2006, 1:22 PM

A useful guide on where to place and how to use a php.ini file with your website is available on this link here: http://www.kics.bc.ca/faq/phpini.html

This link comments on doing things from a shell. Ignore this bit and create files locally, upload via ftp and then chmod as appropriate. Note that the php.ini file it details is just an example, yours will have to reflect what you want to achieve
  (#10 (permalink)) Old
User
risingfree is on a distinguished road
 
Posts: 69
Join Date: Dec 2005
Location: Scotland
Default Re: cPanel Resellers - PHPsuexec and register_global changes. - 15/05/2006, 2:03 PM

Cheers Kieran,
I'll have a read of that later
Closed Thread


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Attention : Resellers Matt Support Queries 100 11/06/2008 7:23 PM
Resellers cunning Support Queries 8 21/08/2004 9:49 AM


Powered by vBulletin | XHTML | © Copyright 2003-2008 XILO Communications Ltd. All rights reserved. E&OE