PHP

ID #378

How do I configure PHP?

Applies to: Grid System, Managed Servers, VPS

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.

Modwest VPS
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.


Last update: 2010-09-27 15:30
Author: FAQ Admin
Revision: 1.6

Digg it! Share on Facebook Print this record Send FAQ to a friend Show this as PDF file
Please rate this FAQ:

Average rating: 2.67 (6 Votes)

completely useless 1 2 3 4 5 most valuable

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:

http://support.modwest.com/content/5/1/en/can-i-have-all-html-pages-parsed-as-php.html
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