将 WordPress 站点迁移到本地主机 [英] Migrating a WordPress site to localhost

查看:34
本文介绍了将 WordPress 站点迁移到本地主机的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚按照以下指南手动将 WordPress 站点迁移到本地主机:http://www.wpbeginner.com/wp-tutorials/how-to-move-live-wordpress-site-to-local-server/

I have just followed the following guide on manually migrating a WordPress site to localhost: http://www.wpbeginner.com/wp-tutorials/how-to-move-live-wordpress-site-to-local-server/

我已遵循所有步骤:下载文件使用 FTP,导出数据库,导入到本地主机数据库,更改 url 链接到本地​​主机并最终更新 wp-config.php

I have followed all of the steps: downloading files using FTP, exporting database, importing to localhost database, changing url links to localhost and finally updating wp-config.php

我在我的两个网站上尝试过这个,但遇到了不同的问题:

I tried this on two of my sites and came across different problems:

  1. Safari 无法连接到服务器"错误消息
  2. 屏幕上显示以下文字:

  1. 'Safari cannot connect to the server' error message
  2. The following text displayed on the screen:

<?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( dirname( __FILE__ ) . '/wp-blog-header.php' );

此错误消息的图片

谁能建议我如何显示我的网站?

Can anyone advise as to how I can make my website display?

推荐答案

您的服务器似乎没有将 .php 文件视为 PHP.相反,它只是以纯文本形式提供 .php 文件.我对 MAMP 不够熟悉,无法说明如何解决此问题,但可能会添加 不起作用,"tag">mamp 标签将有助于为人们带来更多知识.

It looks like your server is not treating the .php files as PHP. Rather, it is simply serving the .php files in plaintext. I'm not familiar enough with MAMP to say how to fix this, but perhaps adding the mamp tag would help bring in people with more knowledge if Atlas_Gondal's answer doesn't work.

(我认为这更适合作为评论,我是新用户,我的代表太低,无法评论.☹️)

(I think this would be more appropriate as a comment, I'm a new user and my rep is too low to comment. ☹️)

这篇关于将 WordPress 站点迁移到本地主机的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆