0
votes

I am trying to implement basic functionality of the Stripe API, I get 500 Internal Server Error for some reason when I require the Stripe.php file that you have to require...When I comment the require out the error goes away but obviously I can not use the API then..

Basic require...shows error in the Modal Log

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

I checked the server error and it gave me this back

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

This all comes from just requiring the file..

2
A 500 error in PHP means go check the web server's error log. The error will be more detailed there. Always when developing or testing code, enable PHP's error display. At the top of your script: error_reporting(E_ALL); ini_set('display_errors', 1); and the fatal error will be printed to your screen. - Michael Berkowski
Your fatal error is that it can't find that file because the absolute path does not exist. - Ohgodwhy

2 Answers

0
votes

Is your 'Stripe.php' file really located in '/php' or is it in a folder called 'php' local to your code?

Current code:

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

I think the problem is this. You probably mean to use something relative to your code base. Like this:

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

I found out the answer I didn't have the mbstring enabled on my server...whooops