Issues with custom API

First I will describe the issue I was having. I did find an answer which is listed below.

I am creating a custom API for SuiteCRM. When I attempt to run the new API from {CRM Home}/custom/service/v4_1_custom I receive an ‘HTTP ERROR 500’. There are no errors in the error_log file or the SuiteCRM.log file.

I have followed the method in the following two url’s https://fayebsg.com/2013/05/extending-the-sugarcrm-api-updating-dropdowns/ https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_10.0/Integration/Web_Services/Legacy_API/Extending_Web_Services/

registry.php

<?php require_once('service/v4_1/registry.php'); class registry_v4_1_custom extends registry_v4_1 { protected function registerFunction() { parent::registerFunction(); $this->serviceClass->registerFunction('test', array(), array()); } } SugarWebServicesImplv4_1_custom.php <?php if(!defined('sugarEntry'))define('sugarEntry', true); require_once('service/v4_1/SugarWebServiceImplv4_1.php'); class SugarWebServiceImplv4_1_custom extends SugarWebServiceImplv4_1 { /** * @return string */ public function test() { LoggerManager::getLogger()->warn('SugerWebServiceImplv4_1_custom test()'); return ("Test Worked"); } // test } // SugarWebServiceImplv4_1_custom I found the answer to this issue. In the file {SuiteCRM}/include/entryPoint.php there are many files that are included thru require_once. In this list of require_once files, there were 4 files that were set as require not require_once. These were classes and therefore could not be included a second time. I changed these to require_once and the HTTP Error 500 went away and the custom APIs started working. I am new to this forum so I was not sure where to post this to maybe have the source code modified for the file include/entryPoint.php.