Title: Database Backups Fail
Last modified: August 22, 2016

---

# Database Backups Fail

 *  Resolved [Charles Savage](https://wordpress.org/support/users/csavage/)
 * (@csavage)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/database-backups-fail/)
 * See previous thread at [https://wordpress.org/support/topic/database-backups-not-being-made](https://wordpress.org/support/topic/database-backups-not-being-made).
 * When the _Create DB Backup Now_ button is clicked, the next page is blank, and
   no ZIP or SQL file appears in the wp-content/plugins/all-in-one-wp-security-and-
   firewall/backups directory. The same is true for scheduled backups as well.
 * The problem appears to be a lack of memory related to PHP, but none of the usual
   controls is changing that.
 * A typical entry from the Apache error log upon requesting a manual backup in 
   AIOWPS is as follows:
 * > “PHP Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to
   > allocate 72879700 bytes) in /var/www/html/wp-content/plugins/all-in-one-wp-
   > security-and-firewall/classes/wp-security-backup.php on line 67”
 * Setting global memory_limit in php.ini and other PHP config files has been tried.
   I can successfully increase the amount of memory shown by PHP info, but the above
   message stays exactly the same, and the memory size is stated as 268435456 bytes
   each time. None of the global PHP settings tried so far has made any change in
   that error message.
 * Settings in Apache conf files have also been checked, but no memory limits were
   found there.
 * I have tried using grep to find any text files that refer to a memory limit, 
   without success in changing this symptom (db backup fails with the above error
   message in Apache error log).
 * Something somewhere is setting a limit of 256 MB. Where could that be? Is there
   a PHP memory setting anywhere in AIOWPS? Someplace else?
 * – Charlie
 * [https://wordpress.org/plugins/all-in-one-wp-security-and-firewall/](https://wordpress.org/plugins/all-in-one-wp-security-and-firewall/)

Viewing 15 replies - 1 through 15 (of 17 total)

1 [2](https://wordpress.org/support/topic/database-backups-fail/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/database-backups-fail/page/2/?output_format=md)

 *  Plugin Contributor [mbrsolution](https://wordpress.org/support/users/mbrsolution/)
 * (@mbrsolution)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/database-backups-fail/#post-5639529)
 * Hi Charlie please read the following [URL ](http://codex.wordpress.org/Editing_wp-config.php)
   in regards to memory and I am sure your issue will go away.
 * Another option you can carry out is to deactivate all your other plugins except
   this one and see if the memory issue is till triggered.
 * Regards
 *  Thread Starter [Charles Savage](https://wordpress.org/support/users/csavage/)
 * (@csavage)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/database-backups-fail/#post-5639545)
 * Thank you. I changed define( ‘WP_MEMORY_LIMIT’, ’96M’ ) to define( ‘WP_MEMORY_LIMIT’,‘
   384M’ ) in wp-config.php, then restarted the Apache2 service. The symptoms remain
   the same — no backup and the memory size stated in the Apache error remains unchanged.
 * PHP Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate
   70255224 bytes) in /var/www/html/wp-content/plugins/all-in-one-wp-security-and-
   firewall/classes/wp-security-backup.php on line 67
 * – Charlie
 *  Plugin Contributor [mbrsolution](https://wordpress.org/support/users/mbrsolution/)
 * (@mbrsolution)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/database-backups-fail/#post-5639546)
 * Thank you Charlie for reporting back. One of the plugin developers will investigate
   this further.
 * Thank you
 *  Thread Starter [Charles Savage](https://wordpress.org/support/users/csavage/)
 * (@csavage)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/database-backups-fail/#post-5639652)
 * Any news on this? I did try several more things to change the allocated memory.
   None so far has changed the size of memory stated in the error message “Allowed
   memory size of 268435456 bytes exhausted…”
 * – Charlie
 *  Plugin Contributor [wpsolutions](https://wordpress.org/support/users/wpsolutions/)
 * (@wpsolutions)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/database-backups-fail/#post-5639655)
 * Your server’s PHP memory_limit is too low for the DB backup operation and the
   change you made obviously has not been recognised by your server.
    Talk to your
   host provider and show them the log and ask them to increase the PHP “**memory_limit**”
   value so that this issue does not recur. They should be able to help you.
 *  Thread Starter [Charles Savage](https://wordpress.org/support/users/csavage/)
 * (@csavage)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/database-backups-fail/#post-5639656)
 * I am the host provider; it is my server.
 * In /etc/php5/apache2/php.ini
    memory_limit = 384M
 * In /etc/php5/cli/php.ini
    memory_limit = 384M
 * Reported by php –info | grep memory
    memory_limit => 384M => 384M opcache.memory_consumption
   => 64 => 64 opcache.preferred_memory_model => no value => no value opcache.protect_memory
   => 0 => 0
 * These were changed from a default value of 128M. I have tied as high as 512M.
   The changes here do not alter the figure of memory size of 268435456 bytes.
 * Is there some place else where this limit might be stated?
 * – Charlie
 *  Plugin Contributor [wpsolutions](https://wordpress.org/support/users/wpsolutions/)
 * (@wpsolutions)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/database-backups-fail/#post-5639658)
 * Have you tried troubleshooting the various possible causes for the memory_limit
   change not apparently taking effect?
 * This might help as a start:
    [http://stackoverflow.com/questions/10000944/php-memory-limit-not-taking-effect-in-normal-php-scripts](http://stackoverflow.com/questions/10000944/php-memory-limit-not-taking-effect-in-normal-php-scripts)
 * Do you have other .htaccess or config files somewhere in another directory where
   you may be specifying the memory_limit value?
 *  Thread Starter [Charles Savage](https://wordpress.org/support/users/csavage/)
 * (@csavage)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/database-backups-fail/#post-5639659)
 * Good suggestion. I will pursue those ideas. Will let you know what I get.
 * – Charlie
 *  Thread Starter [Charles Savage](https://wordpress.org/support/users/csavage/)
 * (@csavage)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/database-backups-fail/#post-5639681)
 * Okay I think we have some progress. When I click on the _Create DB Backup Now_
   button, I no longer get a blank page. I get a visible page that says, DB Backup
   failed. Please check the permissions of the backup directory.
 * Adding the line…
 * `define( 'WP_MAX_MEMORY_LIMIT', '384M' );`
 * …to file /var/www/html/wp-config.php seems to have changed things. What apparently
   was needed was WP_MAX_MEMORY_LIMIT, not WP_MEMORY_LIMIT. The WP_MAX_MEMORY_LIMIT
   constant specifically defines the maximum memory limit available when in the 
   administration back-end.
 * That the page now says something rather just stops dead is an improvement.
 * As for the message _Please check the permissions of the backup directory_, the
   backup directory is /var/www/html/wp-content/plugins/all-in-one-wp-security-and-
   firewall/backups, is that correct?
 * The AIOWPS/backups directory has the same ownership settings as the rest of the
   web site. And file attributes are 777. What else could it need? Or is this not
   the correct directory path?
 * The Apache error log event associated with this permissions failure is:
 * > PHP Warning: mkdir(): Permission denied in /var/www/html/wp-content/plugins/
   > all-in-one-wp-security-and-firewall/classes/wp-security-utility-file.php on
   > line 386
 * Mkdir()? Is it trying to make a new directory?
 * – Charlie
 *  Plugin Contributor [mbrsolution](https://wordpress.org/support/users/mbrsolution/)
 * (@mbrsolution)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/database-backups-fail/#post-5639682)
 * Hi, try and change folder permissions to **0755**
 *  Thread Starter [Charles Savage](https://wordpress.org/support/users/csavage/)
 * (@csavage)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/database-backups-fail/#post-5639683)
 * I still get _DB Backup failed. Please check the permissions of the backup directory._
 * The folder ../wp-content/plugins/all-in-one-wp-security-and-firewall/backups 
   and its sub-files was set to 755. Apache was restarted, then _Create DB Backup
   Now_ tried again. At least it is doing something now but I do get the above message
   and this is the Apache error log:
 * PHP Warning: mkdir(): Permission denied in /var/www/html/wp-content/plugins/all-
   in-one-wp-security-and-firewall/classes/wp-security-utility-file.php on line 
   386
 * Should I try deleting the /backups folder and let AIOWPS remake it?
 * – Charlie
 *  Plugin Contributor [mbrsolution](https://wordpress.org/support/users/mbrsolution/)
 * (@mbrsolution)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/database-backups-fail/#post-5639684)
 * Yes [@charlie](https://wordpress.org/support/users/charlie/) that is a great 
   idea. I guess it would not hurt.
 * Regards
 *  Thread Starter [Charles Savage](https://wordpress.org/support/users/csavage/)
 * (@csavage)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/database-backups-fail/#post-5639685)
 * Darn! That did not work. I deleted just the /backups directory, then tried making
   a Backup Now. Same _DB Backup failed. Please check the permissions of the backup
   directory._
 * I then created the backups directory again and checked that it was inheriting
   its permissions from above. Tried Backup Now again and still got _DB Backup failed.
   Please check the permissions of the backup directory._
 * Where is the folder path controlled? I get the impression that AIOWPS is trying
   to make a directory someplace else.
 * – Charlie
 *  Plugin Contributor [mbrsolution](https://wordpress.org/support/users/mbrsolution/)
 * (@mbrsolution)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/database-backups-fail/#post-5639690)
 * Hi, this is the name of the backup folder created by AIOWPS.
 * **aiowps_backups**
 * And this is the path…
    ** /yourwebsite/wp-content/aiowps_backups/
 *  Thread Starter [Charles Savage](https://wordpress.org/support/users/csavage/)
 * (@csavage)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/database-backups-fail/#post-5639698)
 * Perfect! Database backups now work.
 * I manually created directory **/var/www/html/wp-content/aiowps_backups**, with
   the same permissions and ownerships as the rest of the site, then clicked the
   _Create DB Backup Now_ button. The routine ran without failure and did produce
   a zipped backup file.
 * The other, previous, change was to set a high enough value for **WP_MAX_MEMORY_LIMIT**
   in wp-config.php, ahead of the line that invokes wp-settings.php.
 * Thanks very much for your help.
 * – Charlie

Viewing 15 replies - 1 through 15 (of 17 total)

1 [2](https://wordpress.org/support/topic/database-backups-fail/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/database-backups-fail/page/2/?output_format=md)

The topic ‘Database Backups Fail’ is closed to new replies.

 * ![](https://ps.w.org/all-in-one-wp-security-and-firewall/assets/icon-256x256.
   png?rev=2798307)
 * [All-In-One Security (AIOS) – Security and Firewall](https://wordpress.org/plugins/all-in-one-wp-security-and-firewall/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/all-in-one-wp-security-and-firewall/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/all-in-one-wp-security-and-firewall/)
 * [Active Topics](https://wordpress.org/support/plugin/all-in-one-wp-security-and-firewall/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/all-in-one-wp-security-and-firewall/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/all-in-one-wp-security-and-firewall/reviews/)

## Tags

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

 * 17 replies
 * 3 participants
 * Last reply from: [Charles Savage](https://wordpress.org/support/users/csavage/)
 * Last activity: [11 years, 4 months ago](https://wordpress.org/support/topic/database-backups-fail/page/2/#post-5639700)
 * Status: resolved