Support

Site Restoration

#32052 Kickstart fails on restore

Posted in ‘Site restoration’
This is a public ticket

Everybody will be able to see its contents. Do not include usernames, passwords or any other sensitive information.

Environment Information

PHP version
n/a
CMS Type
Other
CMS Version
n/a
Backup Tool Version
n/a
Kickstart version
n/a

Latest post by sneadm on Thursday, 28 November 2019 07:34 CST

sneadm
Attempt to restore site to localhost (MAMP) Full installation and DB update successful. When I go back to hit cleanup on kickstart.php there is no response. From that point onwards, any attempt to execute php code on that domain is treated like I'm downloading the file, not executing it. It looks like all the files are intact, including .htaccess. Installation directory is still present so not sure if clean up executed.

nicholas
Akeeba Staff
Manager
Your problem is not with Kickstart, it's with the .htaccess file. When you run Kickstart it extracts .htaccess as htaccess.bak for reasons that will be obvious when you finish reading this reply of mine. When you click on Clean Up at the end of the restoration this file is renamed back to .htaccess.

The .htaccess files contain a lot of directives which control how the server will process the requests sent to it. Some of these directives are host- or even server-specific. One of them is the Handler family of directives i.e. AddHandler, SetHandler and RemoveHandler. These directives tell Apache, your web server, what to do when it encounters a file with a specific extension / file type. Typically, these are used to tell Apache to use a specific PHP version for all .php files. The way these directives work is server-specific.

Your live site probably had AddHandler directives to tell Apache to use a specific PHP version. MAMP also uses AddHandler directives when you have set it up to use multiple PHP versions. However, your live server's AddHandler directives and MAMP's AddHandler directives are incompatible. MAMP sees the AddHAndler directive in your .htaccess file that was suitable for your live server and has no idea what you mean. So it falls back to its default behavior which is to serve everything as plain text unless explicitly configured otherwise.

This is why we do not extract the .htaccess file under its proper name. Doing so would cause the extraction to fail in the middle of the process, as soon as the .htaccess file with invalid directives for the current server is extracted. But we do have to rename the file back to .htaccess at the end because it also contains other useful directives such as those required to enable Permalinks in WordPress.

There are two ways to handle it.

Edit your .htaccess, remove any AddHandler lines. This is typically enough for most sites. However, if there are other directives which are not compatible with your MAMP server you will once again get errors trying to access the restored site.

The alternative is renaming your .htaccess file to htaccess.live. Then go to wp-config and edit your permalink settings. Set them to something different that what you have and save. Then edit them back to their original value and save again. This tells WordPress to regenerate the .htaccess file. This is great but it will also remove any .htaccess code possibly added by third party plugins (caching and security plugins usually need to do that).

Since there is no objectively correct method for handling .htaccess files on restoration we try to do a minimal amount of work on them and let you fix things like AddHandler manually.

Nicholas K. Dionysopoulos

Lead Developer and Director

🇬🇷Greek: native 🇬🇧English: excellent 🇫🇷French: basic • 🕐 My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

sneadm
Perfect. There was an Addhandler in the htaccess.bak. Removing the line before hitting cleanup fixed the problem.
Thank-you!

Support Information

Working hours: We are open Monday to Friday, 9am to 7pm Cyprus timezone (EET / EEST). Support is provided by the same developers writing the software, all of which live in Europe. You can still file tickets outside of our working hours, but we cannot respond to them until we're back at the office.

Support policy: We would like to kindly inform you that when using our support you have already agreed to the Support Policy which is part of our Terms of Service. Thank you for your understanding and for helping us help you!