In the scenario whereby you need to change the value of php.ini, but you don’t have direct access to /usr/local/lib/php.ini, you have another options to change it using .htaccess

Where to put your .htaccess file? You should put it in the folder that is same level with your webpage index file.

On top of your .htaccess, include the lines below:

AllowOverride Options
AllowOverride All

There are two main values been used in php.ini setting, numbers or string. we can setting up php_flag for the string type values (mostly On and Off) and php_value for the numbers values. Example to set in .htaccess:

php_flag display_errors On
php_flag display_errors Off
php_value post_max_size 32M
php_value memory_limit 64M
Was this article helpful?
Thank you!