Mobile example failing to load in live server. HTTP ERROR 500


#1

Server unable to handle page request. HTTP ERROR 500. I have successfully setup your mobile.php example which came with the paynow api on xamp server but its failing to display in an online server giving me the above error. Can anyone help. Looking forward


#2

Hi @cobsis. At what point do you get the error? Is it when you try to load the website or when you are on the payment page?
Also, turn on error logging and share the exact error.


#3

Thanks for your reply. I am getting the error on the payment page. you can check here. Looking forward


#4

I have however installed CURL extension in the server and its now showing the page but its not initiating the transaction


#5

Hi @cobsis, You are getting a 500 error on form submit. Please turn on error logging and check your error logs to see what causes the error.
Please note again that when you are testing, you can only used a prescribed set of numbers with their corresponding status found here


#6

hi Adrian,

I have removed other pages and left the default pages from paynow api only and this is the error i have logged,

[05-Apr-2019 15:08:49 Europe/London] PHP Fatal error: require_once(): Failed opening required ‘/autoloader.php’ (include_path=’.:/opt/alt/php56/usr/share/pear:/opt/alt/php56/usr/share/php’) in /home/cobpayco/public_html/mobile.php on line 3


#7

This means that PHP cannot find your autoloader.php file. If you downloaded the sdk from github or gitlab directly your structure should be as follws:

$ ls
index.php
mobile.php
paynow-php-sdk/

Then in your mobile.php file, the require_once should be like:

require_once 'paynow-php-sdk/autoloader.php';

The folder paynow-php-sdk should have the sdk files and look like this:

$ ls
examples/
src/
tests/
autoloader.php
composer.json

Please make sure you reference the autoloader correctly relative to where your mobile.php file is for PHP to find this file and run the SDK.