TestingDocs.com
Testing Questions
  • JBehave
  • Selenium
  • Maven
  • TestLink
  • Git
  • RAPTOR
  • Contact

How to fix Slim Application Error in TestLink

Tweet
Pin it

Document Contents

    • Overview
    • Error: Slim Application Error
  • Sample Trace
    • Indication
    • Error in Apache Error Log
    • Fix
    • Fix Validation in Postman

Overview

In this tutorial, we will learn the steps involved in fixing Slim Application Error while executing Rest API calls on a TestLink Instance. Many TestLink Rest API errors can be solved if you install the Slim framework on your Testlink instance.

https://www.testingdocs.com/install-slim-framework-on-windows/

Error: Slim Application Error

The application could not run because of the following error:

Details

Type: ErrorException
Code: 8
Message: Undefined index: PHP_AUTH_USER
File: /var/www/html/testlink/lib/api/rest/v2/tlRestApi.class.php
Line: 214

Sample Trace

#0 /var/www/html/testlink/lib/api/rest/v2/tlRestApi.class.php(214): Slim\Slim::handleErrors()
#1 [internal function]: tlRestApi->authenticate()
#2 /var/www/html/testlink/third_party/Slim/Router.php(168): call_user_func_array()
#3 /var/www/html/testlink/third_party/Slim/Slim.php(1222): Slim\Router->dispatch()
#4 /var/www/html/testlink/third_party/Slim/Middleware/Flash.php(86): Slim\Slim->call()
#5 /var/www/html/testlink/third_party/Slim/Middleware/MethodOverride.php(94): Slim\Middleware\Flash->call()
#6 /var/www/html/testlink/third_party/Slim/Middleware/PrettyExceptions.php(67): Slim\Middleware\MethodOverride->call()
#7 /var/www/html/testlink/third_party/Slim/Slim.php(1174): Slim\Middleware\PrettyExceptions->call()
#8 /var/www/html/testlink/lib/api/rest/v2/index.php(20): Slim\Slim->run()
#9 {main}

 

Screenshot

 

Slim Application Error

Indication

As the error trace indicates the there is an authentication problem with the rest API request.

tlRestApi->authenticate()

PHP_AUTH_USER

Error in Apache Error Log

Apache Error Log

Fix

Enable API key on the TestLink instance. ( https://www.testingdocs.com/testlink-api/ )

Pass the APIKEY and its value along with the API request.

This would fix the following error when we send an API request. It’s directly not possible to call the GET request that needs Authorization with a Web browser.  We can leverage API tools like Postman. (https://www.testingdocs.com/postman-api-tool/)

Fix Validation in Postman

Hit the API Endpoint:

http://<testlink_HOME>/lib/api/rest/v2/whoAmI

HTTP method as GET

Pass the APIKEY and its value that was generated in the TestLink web settings in the Authorization tab.

Send the API request.

Expected Result: Should be 200 OK Http Response

Postman Testlink Rest API call

Related Posts

400 Bad Request TestLink API

TestLink /

How to fix 400 Bad request error in TestLink API

TestLink Login Page Linux

TestLink /

How to fix TestLink Blank page error on Linux

TestLink Security warnings

TestLink /

How to fix security warnings on TestLink Instance

TestLink /

How to setup cron for TestLink DB backup?

Tag Cloud

Eclipse Git Java Programs Mathematics

Random Questions

  • How to connect to pluggable database (PDB) using SQL*Plus?
    Overview In this tutorial, we will learn the steps

    Read more

  • How to manually Update new Edge Browser on Windows 10
    Introduction In this tutorial, we will go through the

    Read more

  • How to setup JDK 15 environment in IDEs
    Overview In this tutorial, we will see the steps how

    Read more

Latest Tweets

Tweets by @TestingDocs

Back to Top

TestingDocs.com

  • Privacy Policy
  • Cookie Policy
  • JBehave
  • Selenium
  • Maven
  • TestLink
  • Git
  • RAPTOR
  • Contact
www.TestingDocs.com | All Rights Reserved