{"id":3355,"date":"2020-02-08T08:19:24","date_gmt":"2020-02-08T08:19:24","guid":{"rendered":"https:\/\/www.testingdocs.com\/questions\/?p=3355"},"modified":"2024-11-29T13:25:36","modified_gmt":"2024-11-29T13:25:36","slug":"how-to-fix-slim-application-error-in-testlink","status":"publish","type":"post","link":"https:\/\/www.testingdocs.com\/questions\/how-to-fix-slim-application-error-in-testlink\/","title":{"rendered":"How to fix Slim Application Error in TestLink"},"content":{"rendered":"<h2>How to fix Slim Application Error in TestLink<\/h2>\n<p>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.<\/p>\n<h3>Error: Slim Application Error<\/h3>\n<p>The application could not run because of the following error:<\/p>\n<p>Details<\/p>\n<div><strong>Type:<\/strong> ErrorException<\/div>\n<div><strong>Code:<\/strong> 8<\/div>\n<div><strong>Message:<\/strong> Undefined index: PHP_AUTH_USER<\/div>\n<div><strong>File:<\/strong> \/var\/www\/html\/testlink\/lib\/api\/rest\/v2\/tlRestApi.class.php<\/div>\n<div><strong>Line:<\/strong> 214<\/div>\n<h2>Sample Trace<\/h2>\n<pre>#0 \/var\/www\/html\/testlink\/lib\/api\/rest\/v2\/tlRestApi.class.php(214): \r\nSlim\\Slim::handleErrors()\r\n#1 [internal function]: tlRestApi-&gt;authenticate()\r\n#2 \/var\/www\/html\/testlink\/third_party\/Slim\/Router.php(168): \r\ncall_user_func_array()\r\n#3 \/var\/www\/html\/testlink\/third_party\/Slim\/Slim.php(1222): \r\nSlim\\Router-&gt;dispatch()\r\n#4 \/var\/www\/html\/testlink\/third_party\/Slim\/Middleware\/Flash.php(86):\r\n Slim\\Slim-&gt;call()\r\n#5 \/var\/www\/html\/testlink\/third_party\/Slim\/Middleware\/MethodOverride.php(94):\r\n Slim\\Middleware\\Flash-&gt;call()\r\n#6 \/var\/www\/html\/testlink\/third_party\/Slim\/Middleware\/PrettyExceptions.php(67):\r\n Slim\\Middleware\\MethodOverride-&gt;call()\r\n#7 \/var\/www\/html\/testlink\/third_party\/Slim\/Slim.php(1174): \r\nSlim\\Middleware\\PrettyExceptions-&gt;call()\r\n#8 \/var\/www\/html\/testlink\/lib\/api\/rest\/v2\/index.php(20): Slim\\Slim-&gt;run()\r\n#9 {main}<\/pre>\n<p>&nbsp;<\/p>\n<p><strong>Screenshot<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3363\" src=\"https:\/\/www.testingdocs.com\/questions\/wp-content\/uploads\/Slim-Application-Error.png\" alt=\"Slim Application Error\" width=\"1920\" height=\"1080\" title=\"\" srcset=\"https:\/\/www.testingdocs.com\/questions\/wp-content\/uploads\/Slim-Application-Error.png 1920w, https:\/\/www.testingdocs.com\/questions\/wp-content\/uploads\/Slim-Application-Error-300x169.png 300w, https:\/\/www.testingdocs.com\/questions\/wp-content\/uploads\/Slim-Application-Error-1024x576.png 1024w, https:\/\/www.testingdocs.com\/questions\/wp-content\/uploads\/Slim-Application-Error-768x432.png 768w, https:\/\/www.testingdocs.com\/questions\/wp-content\/uploads\/Slim-Application-Error-1536x864.png 1536w\" sizes=\"auto, (max-width: 1920px) 100vw, 1920px\" \/><\/p>\n<h3><\/h3>\n<h3>Indication<\/h3>\n<p>As the error trace indicates the there is an authentication problem with the rest API request.<\/p>\n<p>tlRestApi-&gt;authenticate()<\/p>\n<p><strong>PHP_AUTH_USER<\/strong><\/p>\n<h3>Fix<\/h3>\n<p>Enable the API key on the TestLink instance.<\/p>\n<p>Pass the APIKEY and its value along with the API request.<\/p>\n<p>This would fix the following error when we send an API request. It&#8217;s directly not possible to call the GET request that needs Authorization with a Web browser.\u00a0 We can leverage API tools like <strong>Postman. <\/strong><\/p>\n<h3>Fix Validation in Postman<\/h3>\n<p>Hit the API Endpoint:<\/p>\n<p>http:\/\/&lt;testlink_HOME&gt;\/lib\/api\/rest\/v2\/whoAmI<\/p>\n<p>HTTP method as<strong> GET<\/strong><\/p>\n<p>Pass the <strong>APIKEY<\/strong> and its value that was generated in the TestLink web settings in the <strong>Authorization<\/strong> tab.<\/p>\n<p>Send the API request.<\/p>\n<p>Expected Result: Should be <strong>200 OK<\/strong> Http Response<\/p>\n","protected":false},"excerpt":{"rendered":"<p>How to fix Slim Application Error in TestLink 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. Error: Slim Application Error The application [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[42],"tags":[212],"class_list":["post-3355","post","type-post","status-publish","format-standard","hentry","category-testlink","tag-testlink","has-post-title","has-post-date","has-post-category","has-post-tag","has-post-comment","has-post-author",""],"_links":{"self":[{"href":"https:\/\/www.testingdocs.com\/questions\/wp-json\/wp\/v2\/posts\/3355","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.testingdocs.com\/questions\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.testingdocs.com\/questions\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.testingdocs.com\/questions\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.testingdocs.com\/questions\/wp-json\/wp\/v2\/comments?post=3355"}],"version-history":[{"count":11,"href":"https:\/\/www.testingdocs.com\/questions\/wp-json\/wp\/v2\/posts\/3355\/revisions"}],"predecessor-version":[{"id":26204,"href":"https:\/\/www.testingdocs.com\/questions\/wp-json\/wp\/v2\/posts\/3355\/revisions\/26204"}],"wp:attachment":[{"href":"https:\/\/www.testingdocs.com\/questions\/wp-json\/wp\/v2\/media?parent=3355"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.testingdocs.com\/questions\/wp-json\/wp\/v2\/categories?post=3355"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.testingdocs.com\/questions\/wp-json\/wp\/v2\/tags?post=3355"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}