Pages

Tuesday, February 5, 2013

Creating custom php.ini for needed users

If you have a site on your cPanel VPS that needs a custom php.ini file, you can set that up by following these steps:

1,Copy /usr/local/lib/php.ini to the site's Web root folder (public_html).
>cp /usr/local/lib/php.ini /home/USERNAME/public_html
2,Make sure the file is owned by their cPanel user
>chown USERNAME:USERNAME php.ini
3,Add the following to the site's ".htaccess" file
  SetEnv PHPRC /home/USERNAME/public_html/php.ini
or
   suPHP_conf /home/user/someplace/php.ini

Custom Values should be added in .htaccess in a format as shown in example below

php_value memory_limit 128M
php_value max_execution_time 3600
php_value post_max_size 5M
php_value upload_max_filesize 5M

No comments:

Post a Comment