I have recently installed magento 1.9.2 and all was going well so I decided to use the backup tool in the system options.
Well now my site and admin page are down and I have no idea how to get them back up. My pages show a '500 INTERNAL SERVER ERROR" message.
I had this problem once before in older version and I renamed maintenance.flag file to .bak and site went back up.
However in this version I do not see a maintenance.flag file anywhere so I do not know what to do.
Can anyone please help? I just put 5 hours of work onto site and want me work back. All the work was adding categories and products so I didn't do anything to any settings or files.
This is most likely due to the Magento backup tool resetting your file permissions to the default 666 for files and 777 for directories, which can cause issues in some hosting environments (666 and 777 are insecure permissions which is not recommended but Magento has it as default ).
You will need to reset your file permissions. This is normally 644 for all files and 755 for all directories.
I wouldn't suggest using Magento's built-in backup tool but if you still want to use it and want to avoid this issue, there's an interim solution to fix the issue.
Important Note: This is a manual hack which may cause issues if you have done any customization to your Magento store and it will be overwritten during a Magento upgrade.
In your Magento directory, copy this file:-
Open the file File.php and look for this line:-
public function open($mode = \'w+\', $chmod = 0666)
Replace it with this line:-
public function open($mode = \'w+\', $chmod = 0644)
Save the file and the next Magento backup will reset all file permissions to 644 instead of 666.
If I run magento on my local (MAMP PRO) server I have no problem using the internal Magento backup, but on my live-server I do have this problem.
is the same on both.
When I look at the permissions on my local MAMP they are indeed 0666 instead of 0644 on the live server.
Since my technical knowledge of servers is not super could/would you explain to me what I can tell my host to prevent this problem? Or do I simply edit the file?
@henk64: This is not really a "problem" with the server environment.
If your hosting provider doesn't allow anything more than 644 for files and 755 for directories (in which case they most likely run SuPHP or SuExec), you should be happy that they are actually taking security seriously.
The problem is Magento's code will auto default to 666 for files after a backup, which are very insecure file permissions and should never be used unless absolutely neccesary.
The workaround I stated in my previous post will change this behavior of Magento so after each backup, the files will be set to 644 instead.
I don't see the file folders you are supposed to move the File.php file to. On my installation they don't exist. Am I supposed to add them?