Y
Y
Yrij2013-11-29 17:29:55
Laravel
Yrij, 2013-11-29 17:29:55

Problem with running Laravel project on Windows7 (possibly slashes and/or autoload)?

Apache 2.4.7 - PHP 5.5.6 - MySQL 5.6 stack is installed and running on the machine.
Project updated by Composer, launched by artisan.
Each time localhost:8000 is accessed, an error like

PHP Fatal error:  Trait 'helpers\HelperTrait' not found in D:\project\app\models\Article.php on line 5

Those. all the files are in place, the autoloaders are correctly generated by the composer, but the project does not start. I tend to think that the problem is in the slashes and with the autoload functions of php itself.
Has anyone experienced something similar? In what direction to dig?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Damir Makhmutov, 2013-11-30
@doodoo

See how the composer autoloader works. The composer generates a class map in the vendor/composer folder (if I'm not mistaken). You can check the correctness of the paths there. Once I had a problem, with autoload too. But it was a little different, everything worked on my machine (win7), but not on the combat server (linux). I searched for a problem for a long time, until I started digging the paths where the composer searches for files. The decision turned out to be banal - windows case insensitive, and linux case sensitive. Those. my class load folder was called classes, and the namespace for all classes began with \Classes. The problem was solved by renaming the classes folder to Classes

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question