将Wordpress迁移到Google Cloud时出现500错误 [英] 500 Error when Migrating Wordpress to Google Cloud

查看:197
本文介绍了将Wordpress迁移到Google Cloud时出现500错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

昨天我花了我的星期天(差不多)将他们的Wordpress安装迁移到Google Cloud,他们的wordpress安装教程。我还没有意识到我需要帮助,在测试提交订阅表单时,我遇到了500个错误: http://v-sons.appspot.com/wtf/#subscribe

Yesterday I spent my Sunday (almost) migrating my Wordpress install to Google Cloud following their wordpress setup tutorial. I've not come to the point that I need help, I've got caught up by 500 errors when test submitting the subscribe form: http://v-sons.appspot.com/wtf/#subscribe

作为GCE的新手,我不会真的知道它是如何工作的,但是当我迁移字体和视频时,我设法解决了一些其他的404错误,因为我需要在app.yaml中包含文件类型。我补充道:

Being new to GCE I don't really know how it works, but I managed to work out some other 404 errors when I migrated fonts and videos over because I needed to include the filetypes in the app.yaml. I added:

- url: /wp-content/(.*\.(eot|svg|ttf|woff))$
  static_files: wordpress/wp-content/\1
  upload: wordpress/wp-content/.*\.(eot|svg|ttf|woff)$
  application_readable: true

- url: /wp-content/(.*\.(mp4|ogv|webm))$
  static_files: wordpress/wp-content/\1
  upload: wordpress/wp-content/.*\.(mp4|ogv|webm)$
  application_readable: true

返回subscribe.php脚本。它绝对有效,因为它仍然在旧服务器上运行,因为这里的网站的实时版本 - https://vsons.co .uk

Back to the subscribe.php script. It definitely works because it is still running on the old server as the live version of the site over here - https://vsons.co.uk

正如我所提到的,我并不完全理解Google对其他文件所做的事情,但在app.yaml中它似乎设置了上传到静态。由于subscribe.php是一个脚本,我想知道它是否需要在yaml中设置为一个。例如

As I mentioned, I don't fully understand what Google is doing with the other files, but in the app.yaml it seems to set the upload to static. As subscribe.php is a script I wondered whether it needs to set as one in the yaml. e.g.

- url: wp-content/themes/vrn/.*
  script: subscribe.php

在app.yaml中也没有提及php,所以fileformat并没有被定义为除 runtime:php 。话虽如此,显然WP是建立在PHP和其他一切似乎加载罚款。如果有人能够阐明为什么我会看到500错误,并且GoogleApp Engine Launcher可能会用我的代码来完成这些任务,这些代码将帮助我走出困境!

There is also no mention of php in the app.yaml, so the fileformat hasn't been defined apart from at runtime: php. Having said that, obviously wp is built in php and everything else seems to be loading fine. If anyone could shed some light on why I'm seeing the 500 error and what GoogleApp Engine Launcher might be doing with my code that'd help me out no end!

我希望这个问题已经够彻底了!

I hope the question is thorough enough!

推荐答案

作为任何遇到同样问题的人的更新。我使用了日志(谢谢@Shaunak)来解决问题出在 curl_init()函数,而Google App Engine不支持它,所以我去了寻找替代品。

As an update to anyone experiencing the same problem. I used the logs (thanks @Shaunak) to work out that the problem was with the curl_init() function, and that Google App Engine doesn't support it, so I went in search of an alternative.

感谢解决方案发布在另一个线程上 - 用PHP中的urlfetch替换CURL ,我发现 url_fetch()是Google的等价物,但是没有编写这种代码的经验,这将是困难的。更进一步,然而@ user3275​​764把我的注意力吸引到了这个令人敬畏的图书馆: https://github.com/azayarni/ purl ,它基本上允许我使用我现有的代码而不会有任何问题,它只需要一个include。

Thanks to a solution posted on another thread - Replacing CURL with urlfetch in PHP, I was able to find that url_fetch() was the Google equivalent, however with no experience of writing this sort of code it was going to be difficult. Further down the thread however, @user3275764 drew my attention to this awesome library: https://github.com/azayarni/purl which essentially allowed me to use my existing code without any further problems, it just needed an include.

我相信这可能是相当常见的但我感到非常惊讶,我无法解决这个问题,但感谢您提供的所有意见和帮助!

I'm sure this is probably quite a commonly faced problem with App Engine, so I'm surprised I couldn't work it out, but thanks for all your comments and help along the way!

Rufus

这篇关于将Wordpress迁移到Google Cloud时出现500错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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