Slim Application Error(发生网站错误)

时间:2018-09-05 07:24:12

标签: php api slim

美好的一天!我总是收到此错误“(发生了网站错误。很抱歉给您带来暂时的不便)。”每次我尝试在邮递员中运行代码时。这是我的代码。

<?php
use \Psr\Http\Message\ServerRequestInterface as Request;
use \Psr\Http\Message\ResponseInterface as Response;

require '../vendor/autoload.php';
require '../includes/DBOperations.php';

$app = new \Slim\App;


$app->post('/createClient', function(Request $request, Response $response){

if(!haveEmptyParameters(array('lastname','firstname','midname','contactnum','emailadd','password'),$response)){

$request_data = $request->getParseBody();
$lastname = $request_data['lastname'];
$firstname = $request_data['firstname'];
$midname = $request_data['midname'];
$contactnum = $request_data['contactnum'];
$emailadd = $request_data['emailadd'];
$password = $request_data['password'];
$hash_password = password_hash($password, PASSWORD_DEFAULT);

$db = new DBOperations;

1 个答案:

答案 0 :(得分:2)

@Dale关于添加以下LOC的评论有助于:

$config = ['settings' => ['displayErrorDetails' => true]]; 
$app = new Slim\App($config);