Title: PHP script not using memory allowance properly
Last modified: August 21, 2016

---

# PHP script not using memory allowance properly

 *  [alinaderzad](https://wordpress.org/support/users/alinaderzad/)
 * (@alinaderzad)
 * [11 years, 11 months ago](https://wordpress.org/support/topic/php-script-not-using-memory-allowance-properly/)
 * I’ve had several different people work on screencomment.com and an error has 
   appeared. the entire site vanishes and instead this error message appears:
 * Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate
   35 bytes) in /home/content/96/7854096/html/site/wp-includes/wp-db.php on line
   1938
 * I’ve spoken to the host (godaddy) and they increased the memory, yet the problem
   keeps appearing. They said someone needs to troubleshoot the php script because
   it’s not using the php memory properly.
 * Does anyone have any advice? I have no background in coding, I’m not a developer.
   
   Please help thanks

Viewing 14 replies - 1 through 14 (of 14 total)

 *  [Craig Ralston](https://wordpress.org/support/users/craig-ralston/)
 * (@craig-ralston)
 * [11 years, 11 months ago](https://wordpress.org/support/topic/php-script-not-using-memory-allowance-properly/#post-5029119)
 * Try adding this to your wp-config.php
 * `define('WP_MEMORY_LIMIT', '96M');`
 *  Thread Starter [alinaderzad](https://wordpress.org/support/users/alinaderzad/)
 * (@alinaderzad)
 * [11 years, 11 months ago](https://wordpress.org/support/topic/php-script-not-using-memory-allowance-properly/#post-5029122)
 * how do i access this?
    is it in wordpress? or is it in the server?
 *  [Craig Ralston](https://wordpress.org/support/users/craig-ralston/)
 * (@craig-ralston)
 * [11 years, 11 months ago](https://wordpress.org/support/topic/php-script-not-using-memory-allowance-properly/#post-5029125)
 * It would be on the server in the root of the WordPress installation. You can 
   access it via FTP, cPanel file manager, etc.
 *  Thread Starter [alinaderzad](https://wordpress.org/support/users/alinaderzad/)
 * (@alinaderzad)
 * [11 years, 11 months ago](https://wordpress.org/support/topic/php-script-not-using-memory-allowance-properly/#post-5029131)
 * I found the file but how do I edit it?
    and where would I place this code?
 *  [Craig Ralston](https://wordpress.org/support/users/craig-ralston/)
 * (@craig-ralston)
 * [11 years, 11 months ago](https://wordpress.org/support/topic/php-script-not-using-memory-allowance-properly/#post-5029143)
 * > I found the file but how do I edit it?
 * Depends on what you are using to view the file. Typically, you’d want to download
   the file locally, make your changes in something like Notepad++ or whatever your
   preferred text editor is then upload it back.
 * > and where would I place this code?
 * Add that line above the `/* That's all, stop editing! Happy blogging. */`
 * **Note: **Make sure it’s outside of any `/* */`. There will also be other define
   functions in your wp-config.php you can use as a placement guide.
 *  Thread Starter [alinaderzad](https://wordpress.org/support/users/alinaderzad/)
 * (@alinaderzad)
 * [11 years, 11 months ago](https://wordpress.org/support/topic/php-script-not-using-memory-allowance-properly/#post-5029146)
 * ok
    now before I do any of this, is there anyway to back up the wp-config file?
   how do I do that? (i’m in mac) just drag the file onto the desktop to copy it,
   and that would be like backing it up, right?
 * if anything goes wrong, I can just drop that backed up file back into the server?
 * please confirm
 *  [Craig Ralston](https://wordpress.org/support/users/craig-ralston/)
 * (@craig-ralston)
 * [11 years, 11 months ago](https://wordpress.org/support/topic/php-script-not-using-memory-allowance-properly/#post-5029147)
 * Yes, totally, always back up. Just download it locally, make a copy that you 
   can upload back to if need be.
 *  Thread Starter [alinaderzad](https://wordpress.org/support/users/alinaderzad/)
 * (@alinaderzad)
 * [11 years, 11 months ago](https://wordpress.org/support/topic/php-script-not-using-memory-allowance-properly/#post-5029148)
 * ok, thanks
 *  Thread Starter [alinaderzad](https://wordpress.org/support/users/alinaderzad/)
 * (@alinaderzad)
 * [11 years, 11 months ago](https://wordpress.org/support/topic/php-script-not-using-memory-allowance-properly/#post-5029154)
 * one last question (for now)
    if an error does occur, merely uploading the backed
   up file back to server will reverse the error I possibly will make? errors aren’t
   gonna occur in other areas as a result? please confirm
 *  Thread Starter [alinaderzad](https://wordpress.org/support/users/alinaderzad/)
 * (@alinaderzad)
 * [11 years, 11 months ago](https://wordpress.org/support/topic/php-script-not-using-memory-allowance-properly/#post-5029155)
 * ok, it’s done
    thanks again
 *  [Donald](https://wordpress.org/support/users/donald-p/)
 * (@donald-p)
 * [11 years, 9 months ago](https://wordpress.org/support/topic/php-script-not-using-memory-allowance-properly/#post-5029341)
 * Hi alinaderzad,
 * I have the same exact problems exact line and same hosting. Did you solve the
   issue?
 * Donald
 *  [Donald](https://wordpress.org/support/users/donald-p/)
 * (@donald-p)
 * [11 years, 9 months ago](https://wordpress.org/support/topic/php-script-not-using-memory-allowance-properly/#post-5029342)
 * Hi Craig Ralston,
 * is there a reason why the memory limit should set to 96 Mb?
    Is this setting 
   related with the memory limit that a plug-in or function can use? Thanks in advance,
   Donald
 *  [InclusiveHost-John](https://wordpress.org/support/users/inclusivehost-john/)
 * (@inclusivehost-john)
 * [11 years, 9 months ago](https://wordpress.org/support/topic/php-script-not-using-memory-allowance-properly/#post-5029343)
 * Hi Donald.
 * The above explanation of 96MB doesn’t make a lot of sense considering the error
   was:
 * “134217728 bytes”
 * Which is 134MB. So setting a 96MB limit when they are already using ~130MB would
   likely not help.
 * >> Is this setting related with the memory limit that a plug-in or function can
   use?
 * It depends. You may also contact your host to define a custom php.ini file with
   memory_limit=128M (or whatever your site requires).
 *  [Donald](https://wordpress.org/support/users/donald-p/)
 * (@donald-p)
 * [11 years, 9 months ago](https://wordpress.org/support/topic/php-script-not-using-memory-allowance-properly/#post-5029344)
 * Hi John,
 * thanks for the info.
    I would like to reply here about my problem but I suppose
   I will create a mess cross posting so if you like to read my post and the issue
   I am having you are more than welcome: [http://wordpress.org/support/topic/fatal-error-allowed-memory-in-wp-dbphp-1?replies=5](http://wordpress.org/support/topic/fatal-error-allowed-memory-in-wp-dbphp-1?replies=5)
 * Regards
    Donald

Viewing 14 replies - 1 through 14 (of 14 total)

The topic ‘PHP script not using memory allowance properly’ is closed to new replies.

## Tags

 * [php](https://wordpress.org/support/topic-tag/php/)
 * [script](https://wordpress.org/support/topic-tag/script/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 14 replies
 * 4 participants
 * Last reply from: [Donald](https://wordpress.org/support/users/donald-p/)
 * Last activity: [11 years, 9 months ago](https://wordpress.org/support/topic/php-script-not-using-memory-allowance-properly/#post-5029344)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
