Title: PHP and WP memory limits
Last modified: October 31, 2017

---

# PHP and WP memory limits

 *  Resolved [Bloke](https://wordpress.org/support/users/bloke/)
 * (@bloke)
 * [8 years, 6 months ago](https://wordpress.org/support/topic/php-and-wp-memory-limits/)
 * This maybe a PHP issue I am not sure. I have a WP plugin that uploads file attachments.
   If I exceed the memory or file size would it still post the files? I am searching
   all over in my code to see why it won’t load more than 5 attachments. I have 
   debug turned on and I don’t get any errors. I assumed that if it exceeded the
   limit, it would not post any attachments and fail. It always posts no more than
   5 files.

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

 *  [Jacob Peattie](https://wordpress.org/support/users/jakept/)
 * (@jakept)
 * [8 years, 6 months ago](https://wordpress.org/support/topic/php-and-wp-memory-limits/#post-9637258)
 * Is this a plugin you developed? Or one you’re trying to use?
 *  Thread Starter [Bloke](https://wordpress.org/support/users/bloke/)
 * (@bloke)
 * [8 years, 6 months ago](https://wordpress.org/support/topic/php-and-wp-memory-limits/#post-9637282)
 * Its one that was developed by someone and I have edited it. I know the classes
   that upload the files. There are no reference to file upload size etc. No limit
   to amount of files. I was curious if a query to upload say 10 files but the memory
   was exceeded wouldn’t it fail completely? It always limits to 5 files.
 *  Thread Starter [Bloke](https://wordpress.org/support/users/bloke/)
 * (@bloke)
 * [8 years, 6 months ago](https://wordpress.org/support/topic/php-and-wp-memory-limits/#post-9638499)
 * I got it figured out. I hard coded the number of files and it worked. So then
   I changed this:
 *     ```
       for($i=0; $i<count($_FILES); $i++)
   
       to this:
   
       for($i=0; $i<=count($_FILES); $i++) 
       ```
   

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

The topic ‘PHP and WP memory limits’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 3 replies
 * 2 participants
 * Last reply from: [Bloke](https://wordpress.org/support/users/bloke/)
 * Last activity: [8 years, 6 months ago](https://wordpress.org/support/topic/php-and-wp-memory-limits/#post-9638499)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
