> ## Knowledge Base Index
> Fetch the complete knowledge base index at: https://kb.host4geeks.com/sitemap.xml
> Use this file to discover available pages before exploring further.
> Pure-Markdown content can be obtained by appending a '.md' suffix to the content URLs listed in the sitemap (without the trailing slash).

# php error:  Allowed memory size of x bytes exhausted

If you are getting an error like “**Allowed memory size of… in file /directory/folder/yourscript.php**“, then you can use an .[htaccess](https://host4geeks.com/knowledgebase/how-to-create-a-user-friendly-url-using-htaccess/) trick to resolve this problem. If this [error](https://host4geeks.com/knowledgebase/how-to-solve-500-internal-server-error/) does not go away even after you apply this .htaccess code, you should contact us and we will help you.

Place this code in your .[htaccess file](https://host4geeks.com/knowledgebase/how-to-edit-dothtaccess-file-in-the-cpanel-file-manager/) of your main domain and if this error persists even after you have used the code, enter it in a [directory](https://host4geeks.com/knowledgebase/how-to-create-or-delete-a-directory-using-filezilla/) where you are receiving an error, such as example.com/directory/folder/**.htaccess** and place the code in the /directory folder.

RLimitMem max