How may I increase my PHP memory limit? php.ini having no effect

Avatar
  • Answered
Hello,

I need to increase my php memory limit from 256M to 512M to fix file upload error in Moodle:

'Allowed memory size of 268435456 bytes exhausted (tried to allocate 421170864 bytes)'

However, increasing the amount in my php.ini in public_html is having no effect. It still says 256M for PHP info in both Moodle and Cpanel. It seems the solution might be similar to this person's:

https://www.inmotionhosting.com/support/community-support/cpanel/how-can-i-increase-php-memory-limit

Can someone help me out? Thank you!
Avatar
Arn
Hello RJmoser,

Apologies, I thought this answwer was posted earlier. I am unable to check your files since you're on a VPS. If you can please make sure to add the following line in your .HTACCESS file:

#Set recursive php.ini:

suPHP_ConfigPath /home/username/pathtophpini
Replace this in all associated .htaccess files - make sure you replace in the information for the path specified above.

This is needed in order to apply your PHP.INI file changes to all the directories under the top level php.ini file.

Try this first please and then let us know if he issue continues.

If you have any further questions, please contact technical support or leave a comment at the bottom of the page.

Regards,

Arnel C.