Setting PHP options: Difference between revisions

From ULYSSIS documentation
(Created page with "Just like PHP errors, you can set PHP options you would normally set in php.ini using .htaccess. You just add the option preceded by php_flag and follow by the value: php_va...")
 
No edit summary
 
(5 intermediate revisions by 2 users not shown)
Line 1: Line 1:
Just like PHP errors, you can set PHP options you would normally set in php.ini using .htaccess.
You can set PHP options you would normally set in <code>php.ini</code> in <code>.user.ini</code>.


You just add the option preceded by php_flag and follow by the value:
For example, to increase the maximum filesize of uploads, create a <code>.user.ini</code> file (for example: <code>~/www/.user.ini</code>)
  php_value upload_max_filesize 20M
  upload_max_filesize = 20M
  php_value post_max_size 25M
  post_max_size = 25M ; post_max_size needs to be larger than upload_max_size
php_value memory_limit 32M


You can of course also use the [[http://be2.php.net/manual/en/function.ini-set.php|ini_set]] function.
It is also possible to use the [http://be2.php.net/manual/en/function.ini-set.php ini_set] function, however this does not support all options.
 
[[Category:Webserver]]

Latest revision as of 22:30, 8 July 2020

You can set PHP options you would normally set in php.ini in .user.ini.

For example, to increase the maximum filesize of uploads, create a .user.ini file (for example: ~/www/.user.ini)

upload_max_filesize = 20M
post_max_size = 25M ; post_max_size needs to be larger than upload_max_size

It is also possible to use the ini_set function, however this does not support all options.