Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

usajack's avatar

Lumen error loading database in shared hosting

Hello,

I did this Lumen API example and test it on localhost with "php artisan serve" command. The database is into a shared hosting. Everything is working great on http://localhost:8000/ the database is loading and all the post are showing. The API is working if i check http://localhost:8000/api/comment/.

I cannot get the API working on a shared hosting. Is appearing only the index.php view empty page without loading the database posts which are on another shared hosting. This is the host: http://appz.tigrimigri.com/ If i try to loading http://appz.tigrimigri.com/api/comment/ will showing the errors. Than's mean the DB fail to load. I try to fix these in different ways but without success.

How i can to make it working? What i need to modify or install? The PHP hosting version are compatible with lumen's version!

0 likes
12 replies
jlrdw's avatar

Was dev windows? Linux is "case sensitive".

usajack's avatar

I did dev in windows and uploaded to hosting which is linux centos;

usajack's avatar

I don't know how to do that and where to make the changes.

jlrdw's avatar

Uh? a vs A

MyModel or mymodel works on windows, again linux is case sensitive.

Also check you env file for correct settings on the host.

usajack's avatar

This is the .env file

APP_ENV=local APP_KEY=i09wq52kSl0wi9FoulvDGoRtoF12UYb1 APP_DEBUG=true APP_LOG_LEVEL=debug

DB_CONNECTION=mysql DB_HOST=sql7.freemysqlhosting.net DB_PORT=3306 DB_DATABASE=sql7152940 DB_USERNAME=sql7152940 DB_PASSWORD=H4iHKfPk2V

BROADCAST_DRIVER=log CACHE_DRIVER=file SESSION_DRIVER=file QUEUE_DRIVER=sync

i don't find any case sensitive to modify.

jlrdw's avatar

What version of php are they running?

usajack's avatar

and this is the .htaccess file

<IfModule mod_negotiation.c>
    Options -MultiViews

</IfModule>

RewriteEngine On

# Redirect Trailing Slashes...
RewriteRule ^(.*)/$ /$1 [L,R=301]

# Handle Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]

structure

in public_html > lumenapi folder & index.php & .htaccess

jlrdw's avatar

Have you tryed adding a rewrite base like

RewriteBase /whatever your uri/

Goes after RewriteEngine On

Please or to participate in this conversation.