altering php values / options
Author: admin admin Reference Number: AA-00253 Views: 33703 Created: 2011-09-11 10:56 Last Updated: 2025-08-11 15:08 0 Rating/ Voters

On premium hosting you can alter php settings using various methods 

How to Change PHP Options on a cPanel Server with CloudLinux

Overview

This guide explains how to modify PHP options on a cPanel server running CloudLinux. CloudLinux provides multiple methods to configure PHP settings, including PHP Selector for end-users and server-wide configurations for administrators.

Prerequisites

  • cPanel/WHM access
  • CloudLinux OS installed
  • PHP Selector enabled in CloudLinux
  • Appropriate user permissions (end-user or root/administrator)

Method 1: Using PHP Selector (For End Users)

PHP Selector allows hosting customers to select PHP versions and configure PHP options through their cPanel interface.

Step 1: Access PHP Selector in cPanel

  1. Log into your cPanel account
  2. Navigate to the Software section
  3. Click on Select PHP Version

Step 2: Select PHP Version

  1. From the dropdown menu, select your desired PHP version
  2. Click Set as current to apply the version

Step 3: Configure PHP Options

  1. Click on the Options tab
  2. Modify the following common PHP settings as needed:
    • memory_limit - Maximum memory a script can consume
    • max_execution_time - Maximum time a script can run
    • upload_max_filesize - Maximum file upload size
    • post_max_size - Maximum POST data size
    • max_input_time - Maximum input parsing time
    • max_input_vars - Maximum number of input variables
  3. Changes are saved automatically when you modify values

Step 4: Managing PHP Extensions

  1. Click on the Extensions tab
  2. Check or uncheck extensions as needed
  3. Common extensions include:
    • mysqli
    • pdo_mysql
    • gd
    • curl
    • mbstring
    • zip
    • xml

Method 2: Using .htaccess File

Users can also override certain PHP settings using .htaccess access files

You can create a .htaccess file using your file manager (or add to it if it already exists) 

examples are :

    php_value memory_limit 256M
    php_value max_execution_time 300
    php_value upload_max_filesize 64M
    php_value post_max_size 64M

Method 3: Using php.ini file 

Users can also override certain PHP settings using a php.ini file, upload the file into the folder you want to apply the changes to 

    memory_limit = 256M
    max_execution_time = 300
    upload_max_filesize = 64M
    post_max_size = 64M

Common PHP Options Reference

DirectiveDescriptionDefaultRecommended
memory_limitMaximum memory per script128M256M-512M
max_execution_timeMaximum script execution time3060-300
upload_max_filesizeMaximum upload file size2M32M-128M
post_max_sizeMaximum POST data size8M32M-128M
max_input_timeMaximum input parsing time6060-300
max_input_varsMaximum input variables10002000-5000
display_errorsShow errors on screenOffOff (production)
error_reportingError reporting levelE_ALL & ~E_DEPRECATEDE_ALL & ~E_DEPRECATED
date.timezoneDefault timezoneSystemYour timezone
session.gc_maxlifetimeSession lifetime14401440-7200
Attachments
php.ini 38 Kb Download File
Quick Jump Menu