admin管理员组文章数量:1326447
Hey guys :) I have to following case. I was given a WP site for "fixing". The website is huge in size. It's around 3GB and the DB is around 350MB. Most of the DB size is coming from postmeta table that is around 200MB. So I want to migrate the site on my localhost and try to reduce the DB size and to implement a custom function. Since the size of the site is huge, Duplicator is not working so I had to manually migrate it by downloading the files via FTP and using phpMyAdmin I exported the database. I'm using WAMP on my PC, so I copied the files to my wamp64/www folder, created a new database and imported the copy of the database, I edited the wp_config.php file, I changed the site url from the wp_options table and also using wp_config, I deleted the .htaccess file and after all of this, when I try to load the site using "http://localhost/mySite" or simply "localhost/mySite", the site is not loading and instead I'm prompted to download a file called "download" (no file extension) that contains the same code as the index.php. The /wp-admin directory is also not accessible.. Renamed all plugins and active themes by adding "old" so it will deactivate them, but still no luck.. I'm out of ideas here honestly.. I reached page 7 from the Google results and still no fix of the problem.. :( Any ideas, please? :) Thanks!
Here is the content of the file it downloads:
<?php
/**
* Front to the WordPress application. This file doesn't do anything, but loads
* wp-blog-header.php which does and tells WordPress to load the theme.
*
* @package WordPress
*/
/**
* Tells WordPress to load the WordPress theme and output it.
*
* @var bool
*/
define( 'WP_USE_THEMES', true );
/** Loads the WordPress Environment and Template */
require __DIR__ . '/wp-blog-header.php';
Hey guys :) I have to following case. I was given a WP site for "fixing". The website is huge in size. It's around 3GB and the DB is around 350MB. Most of the DB size is coming from postmeta table that is around 200MB. So I want to migrate the site on my localhost and try to reduce the DB size and to implement a custom function. Since the size of the site is huge, Duplicator is not working so I had to manually migrate it by downloading the files via FTP and using phpMyAdmin I exported the database. I'm using WAMP on my PC, so I copied the files to my wamp64/www folder, created a new database and imported the copy of the database, I edited the wp_config.php file, I changed the site url from the wp_options table and also using wp_config, I deleted the .htaccess file and after all of this, when I try to load the site using "http://localhost/mySite" or simply "localhost/mySite", the site is not loading and instead I'm prompted to download a file called "download" (no file extension) that contains the same code as the index.php. The /wp-admin directory is also not accessible.. Renamed all plugins and active themes by adding "old" so it will deactivate them, but still no luck.. I'm out of ideas here honestly.. I reached page 7 from the Google results and still no fix of the problem.. :( Any ideas, please? :) Thanks!
Here is the content of the file it downloads:
<?php
/**
* Front to the WordPress application. This file doesn't do anything, but loads
* wp-blog-header.php which does and tells WordPress to load the theme.
*
* @package WordPress
*/
/**
* Tells WordPress to load the WordPress theme and output it.
*
* @var bool
*/
define( 'WP_USE_THEMES', true );
/** Loads the WordPress Environment and Template */
require __DIR__ . '/wp-blog-header.php';
Share
Improve this question
asked Aug 3, 2020 at 7:40
tsvetko.krastevtsvetko.krastev
11 bronze badge
5
- 1 I don't know WAMP but it looks like Apache isn't running PHP. Can you check the configuration for that, or maybe restore some of the .htaccess, or try and get a simple PHP example working? – Rup Commented Aug 3, 2020 at 7:46
- Hey, thanks for the answer. I created a phpinfo.php file and without the .htaccess file it loads just fine. EDIT: Here is the phpinfo.php file that I load: pastebin/MbAaqAcG EDIT 2: Here is the .htaccess file: pastebin/uxuMiMBL – tsvetko.krastev Commented Aug 3, 2020 at 8:05
- I would use the default wordpress .htaccess wordpress/support/article/htaccess but edit it since you are running inside a folder called 'mySite' replace / with /mySite in both spots – bjornredemption Commented Aug 3, 2020 at 9:12
- Hey, tanks for the answer. Tried replacing the .htaccess with the default one by WP, but still the same problem :( EDIT: Also tried to switch the PHP version to 7.2, because on my WAMP it was 7.3, but still no fix.. It was pretty desperate move, honestly.. :( – tsvetko.krastev Commented Aug 3, 2020 at 11:04
- Could your problem be similar to this: wordpress.stackexchange/a/285806/17295 – Craig Pearson Commented Aug 11, 2020 at 15:56
1 Answer
Reset to default 1As in this question and answer, and because of your huge .htaccess file it's like you have a .htaccess directive that's causing your apache to not process that file or understand its type.
As mentioned by @Rup, using the default Wordpress .htaccess, and checking other directories for rogue .htaccess files will likely resolve this issue.
If it doesn't, you need to check how apache and this particular vhost are configured as it's likely you've got a rogue .htaccess file or directive causing apache to not be able to process PHP
本文标签: databaseProblem migrating to localhost
版权声明:本文标题:database - Problem migrating to localhost 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742212643a2433997.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论