Hi all,
I develop a small api using slim framework and it worked successfully in local server.
and then I upload all the files on web server. It did not worked. Used web server [ Apache and PHP in ubuntu ]
For example:
$app->get('/', function (Request $request, Response $response)
{
$response->getBody()->write('Hello world!');
return $response;
});
This code worked successfully. When I enter 185.546.23.54/Folder_Name/public This will give correct output (Hello world!) [185.546.23.54 Just for example]
But, The below code got error.
$app->group('/users', function (Group $group)
{
$group->get('', ListUsersAction::class);
$group->get('/{id}', ViewUserAction::class);
});
When I enter 185.546.23.54/Folder_Name/public/users it will give the below error.
Error I got: [185.546.23.54/Folder_Name/public/users]
# Not Found
The requested URL was not found on this server.
Apache/2.4.41 (Ubuntu) Server at 185.546.23.54 Port 80
And Sometimes 185.546.23.54/Folder_Name/public this URL give correct output, sometime give error output.
Error I got : [185.546.23.54/Folder_Name/public]
{
"statusCode": 500,
"error": {
"type": "SERVER_ERROR",
"description": "ERROR: Module 'pgsql' already loaded on line 0 in file Unknown."
}
}
Any configuration Needed ? Any suggestion ?
Thanks