What classes cannot be loaded? Give us more specific examples. What PHP version are you running?
thomastkim said:
What classes cannot be loaded? Give us more specific examples. What PHP version are you running?
I'm running PHP 5.5.6
And Classes are my personal library
the classes do include
namespace App\LibDH;
and there's a
use App\LibDH\D;
where it's being used.
It does run well on my localhost though.
https://www.dropbox.com/s/j4edjnjwptyzu2m/class.not.found.png
astroanu said:
probably your composer needs a composer dump-autoload again.
I just tried. And it didn't work.
https://www.dropbox.com/s/j4edjnjwptyzu2m/class.not.found.png?dl=0
tkprocat said:
Try php artisan clear-compiled
Sadly, that doesn't work either. :(
astroanu said:
- do you have a class file by the name D in App\LibDH folder?
- open vendor\vendor\composer\autoload_classmap.php and see if your class is there. Maybe it's misspelled, or miss-namspaced.
- I'm guessing it's a class you added yourself, you need to define the path on your composer.json under autoload.classmap section
YES
NO
I didn't know that.
Does the PSR-4 setting not cover it? I kept reading that it should.
Why does it work on my localhost then? (I'm checking the localhost version of my code and it's not in there)
And what do I do after I add it to composer.json?
Do I run composer update
Thanks! :)
You're running PHP 5.5.6. Laravel 5.1 requires PHP >= 5.5.9.
Check all the requirements here:
Sorry, marked my own post as the solution when I meant to mark @astroanu
But in any case, now I have a routing problem ... the classes are included, but the same route on different servers serve up different views.
On my localhost, it serves the correct view. On the remote host, even tho I @extends('layout.master') it shows my 'test.parser' view somehow along with the 'welcome' view.
I'm ... so confused how this could happen. :P
I told you what to look at. You don't need to define the path in composer.json. psr4 does cover it.
The Laravel docs state the requirements, and you stated that your server doesn't meet it. That's step 1 before you do anything else.
thomastkim said:
You're running PHP 5.5.6. Laravel 5.1 requires PHP >= 5.5.9.
Check all the requirements here:
My mistake. I am running 5.5.9
Well I managed to set up my own LAMP environment and WAMP environments fine for years. But it's been a few years since I touched Linux as I was using a Mac.
But on the possibility something changed, I'm also on an Ubuntu 14.04 build on a 4 core arm based VPS. Do I need to do anything in particular via apt-get that I might have missed?
I wanted to update this thread, because I found the actual solution at laracasts
Some of you who replied had the right idea and I did spend the past few days digging into how to clear my apache2 cache and even go so far as to cache nothing. Alas, all was in vain. The commands you provided in the thread,
composer update
and
php clear-complied
didn't do the trick when moving servers.
The correct answer is:
php artisan cache:clear
hope this helps others trying to move between servers!
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community