PHP : Allowed memory size of bytes exhausted : WordPress

If you are trying to develop some website on shared hosting using wordpress, there are high chances you will encounter following error sometime,

Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 49152 bytes) in "/path/filename.php" on line "linenumber"

This error is mainly due to PHP memory limitations, we get by default for the shared hosting servers.

Solution : We need to increase the PHP memory limitations by changing the php.ini file. For this you will need an access to /public_html folder of your shared hosting. If you have an FTP access to /public_html folder in your hosting,

  • Check if you have phpinfo.php and php.ini files in /public_html folder, if those are there then you will just need to make sure those two files contain the following lines. You can edit those files as mentioned in next step.
  • If you don’t have phpinfo.php & php.ini files, we need to create those two files and upload to /public_html using FTP.
Related :   fix yocto QA Issue : " was already stripped, this will prevent future debugging ! "

Create phpinfo.php [ Note: we used vim editor on ubuntu, you can use any other editor on any other OS like windows as you are comfortable ]

$ vim phpinfo.php

Save the file with above changes.

Create php.ini

$ vim php.ini
max_execution_time 600
memory_limit 128M
post_max_size 32M
upload_max_filesize 32M

Save php.ini with above changes and upload both files to /public_html/ location in your server. and Try refreshing your browser where you have seen this error. There are possibility that you may need to Kill PHP Process if you have access to cPanel, if error still persist, or wait for some time to let the changes takes effect by your hosting service provider and try again. This Works !


Subscribe with Valid Email Id to receive updates in Inbox. ( Secured by Google FeedBurner )


Leave a Comment

Android Android Applications Android Build system Android Commands Application Libraries Application Stack / User Interface Bash / Shell Scripts Bluetooth driver Cloud Technologies Commands and Packages Compilation Content Management System Core Kernel C Programs Development & Build Development, Debugging and Performance Tools Development Environment Setup Django & REST Api Errors & Failures Git Hardware Platforms HTML JAVA Programs Linux, OS Concepts and Networking Linux Device Drivers Linux Host, Ubuntu, SysAdmin Linux Kernel Linux Networking Middleware Libraries, HAL Multimedia Audio, Video, Images NDK / Middleware / HAL OS Concepts PHP Programming Languages Scripting and Automation Search Engine Optimisation ( SEO ) Social Media Source Code Management ( SCM ) System Administration, Security Testing and Debugging Uncategorized Web design and development Website Hosting Wordpress Yocto / Bitbake / Openembedded