1
I have a system developed recently in PHP7 on Windows, and, I decided to migrate to Debian9. At the moment everything works, but the autoload (psr-4) located in vendor is having problems when requesting the classes, returning error 500 in the browser.
I executed tail -f /var/log/apache2/error.log
and he returns PHP Fatal error: require(): Failed opening required 'Src/Core/Router.class.php' (include_path='.:/usr/share/php') in /var/www/html/project/vendor/autoload.php on line 16
.
I have tried to use absolute as well as relative path, but none works.
Testing
When executing is_writable or is_readable it also returns the error.
I created an index.php in root (/var/www/html/) and included the index.html file within the project and it worked; so I discarded permissions, which are: Folder (755) / files (644).
In the same file index.php I checked if Router.class.php exists and it returns true. But if you do in autoload returns false.
I have always worked with Debian and this problem had never occurred.
References
https://stackoverflow.com/questions/45569941/php-require-causing-http-500-error?rq=1
https://www.vivaolinux.com.br/topico/PHP/HTTP-500-INTERNAL-SERVER-ERROR-1
I actually used "error 500" as a reference, it is easier if someone researches for the same problems; about case-senstive, in autoload I handle it.
– Alexander
@Tutoxtutorials Error 500 is Generico, it is an internal error of failure of the software of interpretation or dependency, I only explained this to specify better how to seek the problems, returning to the subject that matters, see the edition of the answer, try to give details to confirm, I think it’s something silly, a typo probably.
– Guilherme Nascimento
All classes were created by me, I do not use third party lib, because the project is not so big. I will update the question with more details.
– Alexander
@Tutoxtutorials like I said, without looking at Composer.json and the folder structure I have no way nor have idea what you did friend, after all only you have access to your Composer.json and folders, if you inform these important details then yes I will be able to help you.
– Guilherme Nascimento
I was able to solve it this way: when defining autoload, Poser was like Src/Core/ and when requesting it was using strtolower. In the end it was just a typo of the paths. Thanks.
– Alexander
@Tutoxtutorials how good it worked, case-sensitive we have to take care ;)
– Guilherme Nascimento