HostMonster Web Hosting Help

Configuring the PHP Environment With php.ini

Summary

How do I change the PHP environment for my site with php.ini?

Generating a new php.ini file:

  1. Login to your HostMonster cPanel.
  2. Click on the PHP Config icon located under "Software/Services" Software / Services
  3. Choose the version of php you will be using"
    • PHP 5.2 All files with the extension .php will be handled by the PHP 5.2 engine.
      Legacy PHP with security updates. Compatible with most environments.
    • PHP 5.2 (Single php.ini) Same as PHP 5.2, but all subdirectories will use ~/public_html/php.ini
    • PHP 5.2 (FastCGI) All files with the extension .php will be handled by PHP 5.2 FastCGI processes.
      FastCGI for PHP makes all your PHP applications run through mod_fastcgi instead of mod_suphp. This eliminates the overhead of loading the PHP interpreter on every hit. Since it is always in memory ready for the next hit, the responses will be generated faster.
    • PHP 5.3 All files with the extension .php will be handled by the PHP 5.3 engine.
      Most reliable and compatible version of PHP.
    • PHP 5.3 (Single php.ini) Same as PHP 5.3, but all subdirectories will use ~/public_html/php.ini
    • PHP 5.4 All files with the extension .php will be handled by the PHP 5.4 engine.
      Latest version of PHP.
    • PHP 5.4 (Single php.ini) Same as PHP 5.4, but all subdirectories will use ~/public_html/php.ini
    • PHP 5.4 (FastCGI) All files with the extension .php will be handled by PHP 5.4 FastCGI processes.
      FastCGI for PHP makes all your PHP applications run through mod_fastcgi instead of mod_suphp. This eliminates the overhead of loading the PHP interpreter on every hit. Since it is always in memory ready for the next hit, the responses will be generated faster.
  4. Choose any extensions you might need for your scripts
  5. Click the "Save Changes" button.

If you have any further questions about configuring the php.ini file, there are extensive descriptions within the file itself. You may also find more help at: http://www.php.net/docs.php

Changing the PHP type used for your account:

  1. Login to your cPanel
  2. Click on the PHP Config icon located under "Software/Services"
  3. Select the type of php version you wish to use, click "save changes"

  • Standard PHP (Default)

    By default all accounts use standard PHP. With standard PHP selected, a php script will use the server's master php.ini configuration file if the script's directory does not contain a php.ini file. Each hosting account initially has a copy of the php.ini file in the public_html directory. You may make any changes to this file and the modification will take precedent over the master file. With standard PHP selected in the cPanel, you will need to copy the modified php.ini file into all subdirectories containing php files which are to use the custom php settings.

    Different folders can have different php.ini files containing different php settings. If you need to use different php settings for two different scripts, you can place them each in their own folder and with their own php.ini file.

  • PHP Single php.ini

    To avoid copying the same php.ini file to each and every directory containing php files, you may select PHP Single php.ini. This option changes the php handler defined in ~/public_html/.htaccess to indicate that all subfolders use the same php.ini found in public_html/.

    The .htaccess php handler is recursive through all subdirectories unless a subdirectory has a .htaccess file also defining a php handler.

  • PHP FastCGI

    Using the PHP FastCGI option makes all your PHP applications run through mod_fcgid instead of mod_suphp. FastCGI uses only one php.ini file located in the public_html directory. For more detailed information about PHP FastCGI including benefits and potential problems, Click Here

For information about configuring php for an addon domain please see: PHP Configuration for Addon Domain.

Knowledgebase Article 253,755 views bookmark tags: configuration php server (updated 255 days ago)


Was this resource helpful?

Did this resolve your issue?


Please add any other comments or suggestions about this content:





Recommended Help Content

PHP vs PHP single php.ini vs PHP with FastCGI (updated 699 days ago)
Knowledgebase Article 108,924 views tags: configuration php server

How do I enable PHP 5 for my PHP applications? How do I change to PHP FastCGI? How do I use a single php.ini file? (updated 226 days ago)
Knowledgebase Article 129,155 views tags: config php

What can I do to increase my Site Security while hosting with HostMonster? (updated 283 days ago)
Knowledgebase Article 154,682 views tags: antivirus basic hacked keyloggers malware php security site

Related Help Content

How can I adjust the php settings specifically for an Addon Domain? (updated 637 days ago)
Knowledgebase Article 88,048 views tags: domain php

How do I configure Dreamweaver MX for PHP and MySQL? (updated 1637 days ago)
Knowledgebase Article 62,100 views tags: php

Why do I keep getting "Please enable cookies to post on this site." when I try to login to my PHP-Nuke website? (updated 1650 days ago)
Knowledgebase Article 47,669 views tags: nuke php

This article will outline which PHP PEAR Packages are installed and how you can install additional PHP PEAR Packages. (updated 186 days ago)
Knowledgebase Article 52,627 views tags: package pear php

500 Internal Server Error when installing via the MOJO Marketplace installer. (updated 283 days ago)
Knowledgebase Article 69,680 views tags: cpanel errors htaccess panel php script simpel

Among the various free FTP programs available to download on the internet for Mac OSX, Windows, or Linux, we recommend Filezilla. It can be downloaded free of charge from http://www.filezilla-project (updated 893 days ago)
Getting Started Article 245,343 views tags: ftp manager server site username

In the newer versions of PHP, they have included a new directive to control and handle remote includes. We disable this option, by default, which may affect some of your PHP scripts. (updated 1620 days ago)
Knowledgebase Article 50,616 views tags: php remote url

If suddenly when you go to your page, you get nothing on the page. You can still get HTML to display, just not PHP. To serve HTML pages to browsers, we don't associate the Apache processes with your 2 (updated 1667 days ago)
Knowledgebase Article 51,008 views tags: page php