Results 1 to 5 of 5
  1. #1
    Join Date
    May 2009
    Posts
    186
    Plugin Contributions
    0

    Default PHP vs PHP single php.ini vs PHP with FastCGI - Which option should I Choose?

    Upgrading to PHP 5.4. However, BlueHost offers 3 options for PHP.
    Upgrade to either PHP 5.4 or PHP 5.4 (single php.ini) or PHP 5.4 (FastCGI)
    Which option should I choose for best Zen-Cart v1.5.4 compatibility/performance?

    Option 1. PHP 5.4
    All files with the extension .php will be handled by the PHP 5.4 engine.
    Latest version of PHP.
    Note: Source Guardian and Zend Guard Loader not currently supported.

    Option 2. PHP 5.4 (Single php.ini)
    Same as PHP 5.4, but all subdirectories will use ~/public_html/php.ini

    Option 3. 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.

    If you are using a custom php.ini file that references PHP modules that are not available with PHP 5.4, your site may not work. Either remove the custom php.ini file (which will cause the server to use the default php.ini file for PHP 5.4), or create a php.ini file that is compatible with PHP 5.4.

    If you are experiencing slowness in your site and you are using one of the FastCGI options, then you will want to change to another option as this can cause slowness in sites if not properly coded for using FastCGI.

    Additional extensions available for Installation
    Http
    Magick Wand
    Mail Parse
    OAuth
    OCI8
    Upload Progress
    IonCube
    SourceGuardian
    Notice: Be aware that this only modifies your ~/public_html/php.ini file. If you apply these changes, please confirm that your other php.ini files are up-to-date for the appropriate version of PHP you're using. We highly suggest using the "Single php.ini" option for your desired version of PHP, to ensure that the proper php.ini is being applied for your site's software. If you choose to use PHP 5.4, you'll want to make sure your crons use "/usr/php/54/usr/bin/php" instead, as otherwise it will use PHP 5.2.
    Your current ~/public_html/php.ini will be backed up.

    Option 1. 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. You can install the default php.ini file to your public_html folder using the "PHP Config" option in your cPanel. 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.

    Note: 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

    Option 2. 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/.
    Note: The .htaccess php handler is recursive through all subdirectories unless a subdirectory has a .htaccess file also defining a php handler.
    PHP FastCGI

    Option3. 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.

    Option 3. FastCGI for PHP

    FastCGI for PHP makes all your PHP applications persistant. There is no per-request startup and initialization overhead. This makes possible the development of applications that would otherwise be impractical within the CGI paradigm (e.g. a huge PHP script or an application that requires a connection to one or more databases).

    Benefits:
    PHP scripts will run faster. The PHP interpreter is loaded into memory rather than calling from storage for every hit, having the ability to improve performance of your scripted site.
    The load on the Server Resources can be lessened with the use of FastCGI. Since the server does not have to load the PHP interpreter for each hit, you will be able to accommodate a higher traffic site without exceeding your CPU quota. We recommend testing your site with and without FastCGI
    No modifications to your existing code are required for most sites, however, some sites will need code modifications.

    Potential Problems:
    You will only have one php.ini file available for all subdirectories (/home/USERNAME/public_html/php.ini). This is necessary to help optimize the website code as much as possible. If you need multiple php.ini files to accommodate different scripting needs, you can disable FastCGI for PHP on any of your subdirectories while leaving the rest of the account enabled for performance.
    There can be a few minutes delay in any updates you make to your PHP environment (ie, php.ini changes). Since your php.ini is loaded into memory for greater speed, every hit does not re-read it from storage.

  2. #2
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: PHP vs PHP single php.ini vs PHP with FastCGI - Which option should I Choose?

    Zen Cart can work with any of those options. I'd recommend the first one, due to its simplicity.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  3. #3
    Join Date
    Jan 2007
    Location
    Australia
    Posts
    6,167
    Plugin Contributions
    7

    Default Re: PHP vs PHP single php.ini vs PHP with FastCGI - Which option should I Choose?

    More often than not the end user doesn't get a choice in this, but since you do:

    I would probably opt for FastCGI (Option#3) as my 1st choice. (with caveats)

    Option#1 is best for a 'hands off' approach - it is sure to work without problem, out of the box, and no future maintenance is needed.

    Option#2 if/when I find a need for site-specific tweaks. This is quite rare, and off the top of my head I can't think of any specific example of where I've needed this (other than for testing/development type purposes).

    Cheers
    RodG

  4. #4
    Join Date
    May 2009
    Posts
    186
    Plugin Contributions
    0

    Default Re: PHP vs PHP single php.ini vs PHP with FastCGI - Which option should I Choose?

    DrByte & RodG thanks so much! I'm trying the FastCGI option. So far so good :)
    However, simplicity is definitely a virtue and unspecified caveats sound scary.
    Anything I should be on the alert for?
    Are there specific situations where the FastCGI option is ill-advised?

  5. #5
    Join Date
    Jan 2007
    Location
    Australia
    Posts
    6,167
    Plugin Contributions
    7

    Default Re: PHP vs PHP single php.ini vs PHP with FastCGI - Which option should I Choose?

    Quote Originally Posted by Zean View Post
    Are there specific situations where the FastCGI option is ill-advised?
    Offhand I can't think of any. Just keep a close eye on the error logs, because this is where any problems will be reported.

    The main reason I mentioned the caveats is because of the comment in your original post, namely
    "No modifications to your existing code are required for most sites, however, some sites will need code modifications"

    DrByte probably recommended the 1st option because when it comes to new users and/or new installations he (correctly) plays it safe.

    Cheers
    RodG

 

 

Similar Threads

  1. v154 application/x-httpd-php html_header.php PHP script text
    By Parafanaylya in forum General Questions
    Replies: 3
    Last Post: 29 Aug 2015, 03:06 PM
  2. XAMPP and PHP cURL in php.ini
    By Jack28 in forum General Questions
    Replies: 2
    Last Post: 21 Dec 2009, 02:46 AM
  3. Which PHP version should I install to be used with my Zen cart
    By Marlake in forum Installing on a Windows Server
    Replies: 6
    Last Post: 26 Mar 2008, 02:33 PM
  4. Linking Page_2.php, Page_3.php, Page_4.php In Footer
    By gws76 in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 1 May 2007, 10:59 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR