I get error message when to runing SLIM 3 microframework project that is working very well on my local-host Apache.
index.php is in ‘public’ folder from the root whereas .htaccess:
I checked your site. For starters, your .htaccess rules are fine. No need to change those.
When I check the root, I also get the “Page Not Found” error. Looking at the code, that makes sense, because no route is defined for /. When I check https://employees.darlar.infinityfreeapp.com/employees, I get the Slim Application Error.
This means that Slim has crashed, and you need to find out why. Slim has a setting you can turn on to display detailed errors, which you can configure like so: System Error Handler - Slim Framework
I did this for your site, and found the model class could not be found. The reason for this is that our servers, like almost all hosting servers, run on Linux, which means files and directories are case sensitive. In your code, you’re referencing a namespace Depiction, but the folder that contains these classes is called depiction. If you developed your site on Windows or MacOS, this will work, but on a live server it will not.
To fix this, the only thing you can do is to pay careful attention to file and directory names and make sure their casing matches. So if you’re using class autoloading on a directory, all subdirectories must match the namespace names exactly.
THANK YOU very much!
Now it partially works.
I mean my JS and CSS, in contrast to localhost, do not work on the server, so some important functionalities are not in place. I have ‘css’ and ‘js’ folders in ‘public’ folder i.e. where I have index.php. My view files (*.php) are in ‘htdocs/app/templates’ folder. Perhaps you might also help on this issue? I checked and there is no more problem on the letters (capital or not) for these files/folders.
That article is outdated, anyway it would apply on premium hosting only, as you can’t edit your php.ini file in free hosting. Glad to hear you found the option in the control panel and were able to sort it out.