Moving a site to a new server
-
I developed a site locally on my computer.
When it was done, I
- exported the database to a sql file,
- created a new database on the web server
- imported the sql file
- copied all files (including .env, etc) to the web server
The Front end works no problem, but I can't seem to get to the backend. I get a 500 error when it redirects from
/backend
to/auth/login
.What have I missed?
Thanks in advance to anyone that can help.
-
Hello, @qualitycoder.
You should check for apache/nginx logs as 500 errors are coming from misconfigured settings.
Usually, it's because of different settings on rewrite rules and such.Thanks.
-
I looked in the laravel.log file (
/storage/logs/laravel.log
).
It's saying it can't find the partials.notifications view, but I see it right there in the AdminLTE Theme folder.[2017-06-16 07:18:02] local.ERROR: InvalidArgumentException: View [partials.notifications] not found. in /[removed]/www/vendor/laravel/framework/src/Illuminate/View/FileViewFinder.php:137
- [site name]
- Themes
- Adminlte
- views
- partials
- notifications.blade.php
- partials
- views
- Adminlte
- Themes
I actually get a whole slew of error messages. The top of the file is the missing partials.notifications view file. The last in the file is
[2017-06-16 07:18:02] local.ERROR: Symfony\Component\Debug\Exception\FatalErrorException: Uncaught InvalidArgumentException: View [errors.500] not found. in /[removed]/www/vendor/laravel/framework/src/Illuminate/View/FileViewFinder.php:137
- [site name]
-
And do those file exist ?
-
-
Hm that's strange. Maybe it's not trying to get into the adminlte theme ?
Something must have gone wrong when moving servers.
How exactly did you perform this ?
-
- I built it locally
- I exported the database to a sql file
- I created the new database on the server
- I ran the sql file on the server
- I ftp'd the files up to their location
- I checked the front end, and it worked
- I checked the back end, and it does not work
- I cleared out the
storage/framework/cache
,storage/framework/sessions
, andstorage/framework/views
directories, hoping that would help. - I came here looking for help
-
In those steps it looks you like forgot to copy (create) over the .env file.
-
-
I can't tell what you forgot with the info you're providing.
Maybe try the procedure again ?
-
I kind of figured it out.
For some reason, the
/en/auth/login
is trying to use the custom front-end theme, and not the adminLT theme.I copied the
notifications.blade.php
and the entireerrors
theme directory over to my custom theme directory, and it showed a page. Didn't have the login form, but at least I'm starting to show a little progress.It didn't do this on my local box, but once it transferred to the server, it wants the auth/login to be part of the custom theme. Weird.
-
Hm the login views are always in the frontend theme (flatfly by default). So if you have a custom theme, it should always contain those views.
-
I copied the layouts/account.blade.php file to the custom theme layouts directory, and now the form shows up, but after logging in, it redirects me to a blank custom theme page (the custom theme is shown with no content). It doesn't show the back end with the adminlte theme.
-
It shows a blank page when going to
/backend
?
-
no, after copying the account.blade.php page over, it redirects to
/en/auth/login
and shows the login form.Once I log in, it redirects me to a blank custom theme page, not the backend. The url is
/en
, not/backend
.After that, I can type in
/backend
again, and it will take me there, but it doesn't take me there on its own.
-
That's normal.
-
When I use the Flatly theme, after typing in /backend, and being redirected to /en/auth/login, I log in, and it redirects me to /backend.
With a custom theme, after typing in /backend, and being redirected to /en/auth/login, I log in, and it redirects me to /en. I have to go back to the url bar and type in /backend again.
This is normal?
-
No, check your setup as the redirect is using
redirect()->intended()
. Seems like your issue is fixed then.