PHP

A.                 PHP

1.                  Setting PHP parameters

  • §Can be done at multiple points
  1. oTo change the memory limit for one specific script, include a line such as this at the top of the script: ini_set("memory_limit","12M");
  2. oMake this a permanent change for all PHP scripts running on the server by adding a line such as this to the server’s php.ini file: memory_limit = 12M
  3. oA private php.ini file in your web server root directory will override corresponding PHP configuration directives in the global php.ini configuration file. So, on most web hosting services, you can add a text file named php.ini in your web site root directory, with this single line to the file: memory_limit = 64M
  4. oYou can also set in your htaccess file(s) - so can have different allocations for different scripts / areas, etc. To do this, put something similar to this in the relevant htaccess file: php_value memory_limit 128M