Php

From Kb

Jump to: navigation, search

PHP allows for changing settings in several different ways. (How to change configuration settings)

Changing PHP Settings Inline

ini_set('display_errors', 1); // 1
error_reporting(E_ALL); // E_ALL ^ E_NOTICE
ini_set('upload_max_filesize', '100M');
ini_set('post_max_size', '100M');


Changing PHP Settings with .htaccess

Create a file named .htaccess and place it in your web root (usually "/home/adminusername/www/yoursitename.com"). Here is an example of some entries for that file:

php_value upload_max_filesize 25M
php_value post_max_size 25M


Extensions on a BSH VPS/MPS

On VPS/MPS products, PHP extension file is located here:

/usr/local/php5/etc/extensions.ini


Changing php.ini values on a BSH Signature Server

  • Place a file with the name "php.ini" in the "~/www/" directory
  • Specify overriding directives just like a normal php.ini file (e.g. memory_limit = 16M)


Troubleshooting

  • If included files are not being included and you get an error that they are not accessible, make sure that you are not running in safe mode.