【问题标题】:Getting 500 Internal Server Error with Stripe使用 Stripe 获取 500 内部服务器错误
【发布时间】:2014-09-24 01:27:53
【问题描述】:

我正在尝试实现 Stripe API 的基本功能,当我需要您必须需要的 Stripe.php 文件时,由于某种原因出现 500 Internal Server Error...当我注释掉需要时,错误消失了但显然我不能使用API​​ ..

基本要求...在模态日志中显示错误

require_once('/php/Stripe.php');

我检查了服务器错误,它给了我这个

Fatal error: Uncaught exception 'Exception' with message 'Stripe needs the Multibyte String PHP extension.' in /php/Stripe.php:13 Stack trace: #0 /home/stripepost.php(4): require_once() #1 {main} thrown in /php/Stripe.php on line 13

这一切都来自只需要文件..

【问题讨论】:

  • PHP 中的 500 错误意味着去检查 Web 服务器的错误日志。错误将在那里更详细。始终在开发或测试代码时启用 PHP 的错误显示。在脚本的顶部:error_reporting(E_ALL); ini_set('display_errors', 1);,致命错误将打印到您的屏幕上。
  • 你的致命错误是找不到那个文件,因为绝对路径不存在。

标签: php stripe-payments


【解决方案1】:

您的“Stripe.php”文件是否真的位于“/php”中,还是位于代码本地名为“php”的文件夹中?

当前代码:

require_once('/php/Stripe.php');

我认为问题是这样的。您可能的意思是使用与您的代码库相关的东西。像这样:

require_once('./php/Stripe.php');

【讨论】:

    【解决方案2】:

    我发现我的服务器上没有启用 mbstring 的答案...哎呀

    【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2015-07-13
    • 1970-01-01
    • 1970-01-01
    • 2018-11-03
    • 2014-10-07
    • 2016-09-25
    • 1970-01-01
    • 2015-05-02
    相关资源
    最近更新 更多