简体   繁体   English

将Wordpress网站从MAMP移至WAMP

[英]Moving Wordpress site from MAMP to WAMP

I have developed my Wordpress website locally using MAMP on a Mac. 我在Mac上使用MAMP在本地开发了Wordpress网站。 I now would like to transfer the site to a Windows 7 computer where I have installed WAMPServer (to continue to be developed locally). 我现在想将该站点转移到已安装WAMPServer的Windows 7计算机上(以继续在本地进行开发)。

This is what I have tried: 这是我尝试过的:

  • Exported the wordpress database to a .sql file using phpAdmin 使用phpAdmin将wordpress数据库导出到.sql文件
  • Made a copy of my entire Wordpress installation (named wordpressFiles, located in the htdocs file that was installed by default with mamp) 制作了整个Wordpress安装的副本(名为wordpressFiles,位于htdocs文件中,默认情况下已使用mamp安装)
  • Imported the wordpress to the new computer using phpAdmin 使用phpAdmin将wordpress导入新计算机
  • Copied the wordpress installation files into the www folder created by default with WAMP Server (named wordpressFiles) 将wordpress安装文件复制到WAMP Server默认创建的www文件夹中(名为wordpressFiles)
  • Using phpAdmin, under wp_options I have changed my siteurl and home from 使用phpAdmin,在wp_options下,我从 http://localhost:8888/wordpressfiles to http:// localhost:8888 / wordpressfiles http://localhost/wordpressfiles HTTP://本地主机/ wordpressfiles
  • I have enabled the Apache rewrite_module and restarted servers 我已启用Apache rewrite_module并重新启动服务器
  • Using a text editor I added the following lines and changed the third to: 我使用文本编辑器添加了以下几行,并将第三行更改为:

After starting all WampServer services, and opening phpAdmin, I see my wordpress folder under Projects. 启动所有WampServer服务并打开phpAdmin之后,我在Projects下看到了我的wordpress文件夹。 When clicking on it, however, I get an HTTP 500 internal error message. 但是,单击它时,我收到一条HTTP 500内部错误消息。

In wp-config.php, the MySQL settings are defined as such (I'm wondering if something is wrong here): 在wp-config.php中,MySQL设置是这样定义的(我想知道这里是否有问题):

define('DB_NAME', 'wordpress');
define('DB_USER', 'root');
define('DB_PASSWORD', 'root');
define('DB_HOST', 'localhost');
define('DB_CHARSET', 'utf8');
define('DB_COLLATE', '');

In phpAdmin on my mac, the server name is localhost while on my Windows machine, the server name is mysql wampserver. 在我的Mac上的phpAdmin中,服务器名称为localhost,而在Windows计算机上,服务器名称为mysql wampserver。 Perhaps this is an issue? 也许这是一个问题? If it is, nor changing to define('DB_HOST', 'mysql wampserver') nor define('DB_HOST', '127.0.0.1') nor define('DB_HOST', '127.0.0.1 via TCP/IP') fixed the issue. 如果是这样,也不要更改define('DB_HOST','mysql wampserver')或define('DB_HOST','127.0.0.1')或define('DB_HOST','127.0.0.1 via TCP / IP')修复了问题。

Other thoughts: does this have anything to do with the .htaccess file? 其他想法:这与.htaccess文件有关系吗? Some forums and posts have told me to remove this temporarily, but it turns out I don't have an .htaccess file in my www root folder. 一些论坛和帖子告诉我暂时删除它,但事实证明,我的www根文件夹中没有.htaccess文件。

You can delete your .htacess file without any worries, this will regenerate itself when you change your permalink settings. 您可以毫无后顾之忧地删除.htacess文件,当您更改永久链接设置时,它会重新生成。

When you change your database settings be sure to change everything, as their may be plugins or theme dependant on certain paths being correct. 更改数据库设置时,请确保更改所有内容,因为它们可能是取决于某些正确路径的插件或主题。

So instead of just changing it in your phpMyadmin, run the following query: 因此,运行以下查询,而不只是在phpMyadmin中进行更改:

UPDATE cs_options SET option_value = replace(option_value, 'localhost:8888/paperfreeweb', 'weloveweb.co.za/paperfreeweb') WHERE option_name = 'home' OR option_name = 'siteurl';
UPDATE cs_posts SET guid = replace(guid, 'localhost:8888/paperfreeweb', 'weloveweb.co.za/paperfreeweb);
UPDATE cs_posts SET post_content = replace(post_content, 'localhost:8888/paperfreeweb', 'weloveweb.co.za/paperfreeweb')

Where localhost:8888/paperfreeweb is the old url and weloveweb.co.za/paperfreeweb is the new url. 其中localhost:8888 / paperfreeweb是旧的URL,而weloveweb.co.za/paperfreeweb是新的URL。

If this does not work, rename your plugins directory to plugins1 and create an empty plugin directory, this is to check if it might be plugins which are the issue and also move your theme folder out of the themes directory so that it defaults to the wordpress theme, to check if the theme is your issue. 如果这不起作用,请将您的plugins目录重命名为plugins1并创建一个空的plugin目录,这将检查是否是问题的插件,并将您的主题文件夹移出themes目录,以使其默认为wordpress主题,以检查主题是否是您的问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM