How can I edit php.ini on the (gs) Grid-Service?
Details:
Each (gs) Grid-Service has it's own editable php.ini. This makes it possible for administrators to change php values independent of our default php values.
As a courtesy we have provided a sample php.ini file in:
/home/#####/etc/php.ini.sample
where '#####' is substituted by your actual site number. You can edit this file via the File Manager, FTP, or SSH.
From the File Manager:
- Login to the AccountCenter and then your WebControl for your (gs) at (Domains > domain.com.
- Click File Manager.
- Click the folder "etc"
- Edit the file "php.ini.sample"
NOTE:
You should copy the entire contents of this file into a text document just in case an error is made.
By changing the filename from "php.ini.sample" to "php.ini" you will be making your changes live.
You may un-comment specific lines in order to change your php environment by deleting the ';' at the beginning of any lines. Below are some common examples:
To turn on register_globals: uncomment ; register_globals = true
To increase the POST size: uncomment ; post_max_size = 20M
To increase php execution time: uncomment ; max_execution_time = 300
You can change other variables as well by adding additional lines to your php.ini. Some examples are:
upload_max_filesize = 20M
include_path = (.:/usr/local/php-4.x.x-x/share/pear/:/path/to/new/includes)
safe_mode = on ; (default is off for your domains)
disable_functions = mail ; Disables use of php mail function
NOTE:
If you make a mistake, you can simply remove the line you added or comment it out with a ';' character at the beginning of the line.. To verify your changes, Click the PHP ini link under PHP Settings in your WebControl.
FAQs
Do I need to restart my service for the changes to take effect?
No, in fact there is no way or need for customers to restart the (gs) Grid-Service. Any changes you make within your php.ini will be effective immediately.
Is there any way to use a different php.ini in each domain/folder on the (gs)?
Not with a php.ini. The php.ini is designed to set global settings for your account. You can make changes on a per domain basis via a .htaccess file. More info on this can be found at http://www.askapache.com/htaccess/php-htaccess-tips-and-tricks.html
Revisions:
04-20-2009: Added disable_functions = mail as example.
02-16-2009: Added second FAQ question. Thanks to Dan K for the comment.
01-28-2009: Added FAQs
Fields marked with an asterisk(*) are required. Comment on this article