PHP

    1. What is PHP? #

      PHP is an open source, dynamic scripting language that can be used as a front-end for a MySQL database.

    2. What extension should be used for PHP scripts? #

      PHP scripts need to have a .php extension.

    3. What version of PHP are you running? #

      All new accounts are currently setup with PHP 5.6, new updates are applied for security, and performance. Some updates are known to break outdated scripts, so be sure to keep you site updated.

      but this is controlled by our upstream provider Rackspace and is updated as new versions are released.

      If you are running an older version of PHP, you can upgrade through the control panel in the “Features” tab by selecting “Change Technology” under “Default Site Technologies”.

    4. What information and server paths are needed to run a PHP script? #

      PHP scripts need to have a .php extension.

      The list of current server side paths can be found in the control panel under Features > Server-side Paths.

      path to sendmail = /usr/sbin/sendmail

      path to the date program = /bin/date

      include path = .:/usr/share/pear:/usr/share/php

      You can see the current PHP environment using PHP info.

    5. Is PHP configured with Safe Mode disabled? #

      Yes, Safe Mode is disabled.

    6. How do you enable register_globals? #

      For security reasons, PHP configured with register_globals set to “Off” (this is PHP’s default setting). You can eable register_globals (at your own risk) by creating a .htaccess file in your public directory with the following:

      php_flag register_globals on

      A more secure option would be to reconfigure the script so that it does not require register_globals.

      Here’s The PHP Group’s documentation on why register_globals is off by default.

    7. Is PHP configured with allow_url_fopen enabled? #

      Yes, allow_url_fopen is enabled.

    8. Is PHP configured with magic_quotes_gpc turned on? #

      Yes, magic_quotes_gpc is enabled.

    9. Is Zend Optimzer available? #

      Yes, Zend Optimzer is available.

    10. Is PHP compiled with ImageMagick and the GD Graphics Library? #

      Yes, is PHP compiled with ImageMagick and the GD Graphics Library version 2.0.

    11. How do you enable PHP error logging? #

      You can enable PHP error logging by creating a .htaccess file in your public directory with the following:

      # enable PHP error logging
      php_flag log_errors on
      php_value error_log /mnt/stor1-wc1-dfw1/123456/123456/www.yourdomain.com/logs/php-error.log

      Replace yourdomain.com with your actual domain name, and the rest of the path with your correct server side path as found in your control panel under Features > Server-side Paths.

      Then create a blank file named php-error.log in the directory you specified and change the permissions to 777.

      Once enabled PHP error logs can be accessed via FTP in /www.yourdomain/logs/ or the file you specify as above.

      Logging is not enabled by default, so you’ll need to first turn it on in the control panel.

    12. What does ‘No Suitable Nodes’ error mean? #

      This a generic error served by the cloud hosting environment when a requested page is unable to be served. This could happen for a number of reasons, such as an out of memory error or a script timeout. There are reasonable timeouts limits set in order to ensure that there are enough available resources to serve the cloud. If these limits are exceeded, the error message appears.

      This error message can be mitigated by:

      1. Installing WP Super Cache — If you are running WordPress, this should prevent the error from appearing for normal, non-logged in users who will be served cached copies of the site. The plugin also adds the page generation time in an HTML comment which can be seen by viewing the source of any page. Look for this code near the bottom of viewed source page: <!– Dynamic page generated in 1.081 seconds. –>. The actual time you see will probably be much higher.
      2. Once you have a baseline page generation time number, you can start looking at optimizing your blog. Begin this by disabling installed plugins one at a time and loading the front page to see if any single plugin is responsible for the long page load times.
      3. Check the php error log for memory exceeded errors and other problems.
    13. A PHP script is not working, are you able to help install and troubleshoot it? #

      PHP script debugging is beyond the scope of the support that we provide. This is a web development issue and we do not offer any in-house web development/consulting services. We make sure that PHP is enabled for your website, PHP is working properly, that you are provided with the correct path information and we can even help point you in the right direction, but we do not have the resouces to debug, install or develop your scripts.

      Here are a few things to try when you are troubleshooting a PHP script:

      1. First of all, thoroughly read through the instructions that came with the script and also check the website where the script was downloaded for troubleshooting info and user forums.
      2. Check to see if the script was uploaded in the proper format (ASCII not binary).
      3. Verify that all the paths are correct, including your public directory path. Do not use the “www” part of your domain in your public directory path. See our PHP server paths section for more info.
      4. Check to see if all the file permissions are set correctly if permissions are even required by your script. File permissions can be set using a FTP program that allows permissions to be set on transfer.
      5. Check your error log file for any script errors that may have occured.
    14. How do you change the PHP maximum upload file size? #

      The default upload size is set to 2M. This can be increased by creating a .htaccess file in your public directory with the following:

      php_value upload_max_filesize ?M

      Then replace ? with the value you want to use.

    15. How do you change the PHP memory limit value? #

      The default memory limit is set to 8M. This can be increased by creating a .htaccess file in your public directory with the following:

      php_value memory_limit ?M

      Then replace ? with the value you want to use.

    16. How do you change the PHP post max size value? #

      The default post max size value is set to 16M. This can be increased by creating a .htaccess file in your public directory with the following:

      php_value post_max_size ?M

      Then replace ? with the value you want to use.

    17. How do you change the PHP maximum execution time? #

      The default maximum execution time is set to 30 seconds. This can be increased by creating a .htaccess file in your public directory with the following:

      php_value max_execution_time ?

      Then replace ? with the value you want to use.

      *Setting the max execution time to anything above 60 will default to the system default of 30 seconds. In which case you should setup a cron job to run the task instead.

    18. Why are my PHP sessions not working properly? #

      The path to sessions must be set manually in our Cloud infrastructure in order to work properly. You can specify the path by adding the following code to your .htaccess file, substituting the correct path for your site:

      php_value session.save_path /mnt/stor1-wc1-dfw1/123456/www.domain.com/web/sessions
      php_value session.save_handler files