php composer dump-autoload returns error

When you open a route after doing work on your Laravel 4 application, you have to clear the autoload. If when you run:

php composer dump-autoload

…it returns error:

could not open input file: composer.

Then this is what I did to get around it:

  1. I was using xampp and localhost on Windows 7 so I opened a command prompt in Windows, not Xampp and went to the Laravel application directory with cd desktop/xampp/appname, then I found that php composer dump-autoload returns an error still, but the following command without php in front of it works: composer dump-autoload returns error
  2. Try opening your route again now and it should work.

I think the reason for this is the location of the php installation that composer uses, so that’s your tip if you want to investigate further. For example instead of php, you may need  a complete path. Just guessing from something I remember reading folks, so don’t hold me to this. If anyone wants to comment on it that would be helpful.

 

 

One Reply to “php composer dump-autoload returns error”

Leave a Reply

Your email address will not be published. Required fields are marked *