Posted a question about an error I was getting the over day about Memory exceed when handling an image resize.
Managed to solve the problem with a local php.ini file and setting
[PHP]
upload_max_filesize = 5M
post_max_size = 5M
memory_limit = 64M
Now I realised I have a whole new problem 🙂
If I access a php file in the directoy with my custom local php.ini, it will override the original and
remove all my $_SESSION’s
If I remove the local php.ini, it doesnt remove my sessions but then the image resize gives me a memory limit exceed error.
Any ideas? Can i set a php.ini (local) to just override the 3 parameters I want?
Thanks in advance,
P.s. tried setting it through CPANEL on tweak php.ini but those values seemed to be ignored.
Result
Had to contact tech support and they had to manually update my ini files.
If you have full control over your server, on most linux distros there is a conf.d directory which is loaded after all of the default php configuration, so you can override things. On ubuntu for example, that is
/etc/php5/conf.d/, there you can create a file ‘my.ini’ (name doesn’t matter as long as it ends in .ini) which will be automatically included.If you don’t have access to the entire server, there are several ways of altering those without overwriting everything:
ini_set('option', 'value');in your php scriptIf you’re going for the .htaccess route, here is an example, just append to end of your .htaccess file: