Why does my SimpleRisk Backup fail during Upgrade?
With the release of SimpleRisk version 20200305-001 we have crossed a barrier in application size of 128MB. By default PHP in most builds has a memory_limit of 128MB. In this short faq we will cover updating your php.ini so when the application tries to backup the app files the system is successful.
First, we need to locate your `php.ini` file, which is essential for configuring PHP settings on your server. The location of this file can vary based on the version of Linux you are using. Below are the common paths where you might find the `php.ini` file. Please replace the "X" with your specific PHP version number to navigate to the correct directory:
- `/etc/php.ini`
- `/etc/php/phpX.X/php.ini`
- `/etc/php/php.ini`
Once you have identified and opened the `php.ini` file using your preferred file editor (for example, `nano`, `vi`, or `vim`), you will need to search for the `memory_limit` configuration setting. In `vi`, you can do this by typing `/memory_limit` and pressing Enter. It is important to set the memory limit carefully; avoid setting it close to the total RAM allocated for your server to prevent performance issues.
If you're uncertain about the right value to use, a safe starting point is to set the memory limit to 256MB. If you feel confident and your applications require more resources, you could increase it to 512MB. Keep in mind that the configuration requires a specific format for the size identifier. Here are some examples of valid configurations that you can use, all of which are acceptable:
- `memory_limit=256M` (This sets the limit to 256 megabytes.)
- `memory_limit=256000K` (This sets the limit to 256,000 kilobytes.)
- `memory_limit=268435456` (This sets the limit to 268,435,456 bytes, which is equivalent to 256 megabytes.)
After making the necessary changes in the `php.ini` file, make sure to save your edits. The next step is to restart the Apache server for the changes to take effect. Depending on the Linux distribution you are using, the command to restart Apache may differ. Below are the commands that you can use:
- `systemctl restart apache2` (for systems that use systemd)
- `systemctl restart httpd` (for systems that use systemd)
- `service apache2 restart` (for older systems using the service command)
- `service httpd restart` (for older systems using the service command)
Once you have executed the appropriate command for your system, the changes you made to the `memory_limit` will now be applied, completing the necessary adjustments for your PHP configuration.
Summary
You have now updated your PHP memory_limit to allow your SimpleRisk backup to go through. If you are still having problems with the backup phase of the update please review your apache error log “/var/log/apache2/error.log” in most cases and send the contents to support@simplerisk.com and we will be happy to assist you.