How do I configure PHP?
Modwest Grid System
On the Modwest grid system, you have considerable flexibility with regards to the configuration of your PHP installation. For example, you can:
- Enable new PHP extensions (such as gd, mcrypt, imap, xmlrpc, or imagick)
- Adjust PHP file upload settings
- Adjust PHP error reporting/logging
- Update your PHP scripts' memory limits
On the Modwest grid system, PHP runs as a CGI. There is a default php.ini file which is in effect for all new accounts. If you need to enable PHP extensions or change PHP options in your account, you may wish to have your own php.ini which overrides the defaults.
To be recognized, an account-specific php.ini should reside in the /conf folder within your Modwest home directory. If one is already there, SSH into your account and edit it using a command line editor (such as vi, nano, or emacs), or download it via FTP/SCP, make changes locally, and re-upload it to the /conf folder.
If there is not a php.ini file in the /conf folder, you will need to create one first. You can build it from scratch using only the directives you know you need, or start by making a copy of the default php.ini file, which is usually located under the /etc/php5/cgi/ folder.
If the account was created before 2009, it is also possible that the php.ini file is located at /etc/php.ini (if you are running PHP4) or /etc/php5/php.ini (if you are running PHP5).
Copy the appropriate php.ini file to your /conf folder and make your changes there. They will take effect immediately.
Alternatively, you may also make configuration changes to your php.ini via the PHP configurator located in the Onsite Control Panel .
Modwest Managed Servers
On our managed servers, PHP generally runs as an Apache module. As such, many PHP directives may be added to an .htaccess file anywhere in an account and take effect immediately This is described in detail on the PHP website. Alternately, we can update PHP configurations server-wide upon request. If you are a managed server customer and run into any trouble, please contact us and we will be happy to assist.
On our customer-managed VPS accounts, there are several options. PHP may generally be configured by editing /etc/php.ini or /etc/php5/apache2/php.ini and restarting Apache, or creating a custom vhost.conf file in the conf/ folder specific to a domain. Consult the Parallels knowledge base for current details.
31681/0%Last update: 2010-09-27 15:30
Author: FAQ Admin
You can comment this FAQ
Comment of Anonymous:
In all hosting contexts, you can use the ini_set() function to modify many configurations. See http://www.php.net/manual/en/function.ini-set.php for more detail.
Added at: 2009-06-15 10:25
Comment of GHS:
If you want PHP embedded in HTML pages to work at all, you must have an .htaccess file set up in the enclosing directory. See this:
Added at: 2010-05-31 13:51
Comment of Ed C.:
My php.ini file was not located in /conf directly, but instead /conf/php5
Added at: 2011-02-20 15:25