Laravel database appearing as not configured? - php

So I decided to setup an Openshift server with Laravel. I ran into some complications and posted this question
How to configure Laravel 5.2 on Openshift?
I go back to it and realized I messed up a lot of stuff setting it up and really the problem was within the .env file. Now it seems like everything else is working except for my databases.
What I have been doing to test Laravel on Openshift is using the make:auth command, so I can test migrations and stuff like that. However, I do feel like I have setup database configurations properly, because when I ran migrations through the cli everything was setup properly (users and password_resets table showed up in the mysql database) no errors through there. Now when I try to register a user using the register page I get this error:
I've tried editing the database.php file, .env configurations, google, but I just can't find a fix. Maybe the solution is staring me in the eyes, but I'm blinder than a bat. Any help would be very much appreciated. I can provide any information needed.

You should set and check environment variables for database on web console.
Or you can follow the lucho2d7/openshift-quickstart-laravel5.2.

Related

Quick Admin Panel | Unable to locate a class or view for component (only when live)

I am trying to get a Laravel 8 project up and running on Hostinger's shared hosting. I realize I'm already complicating things but have successfully set things up besides the components. I am using Povilas' Quick Admin Panel (Livewire ver), and it's this that requires components that are only 'missing' when on production server. Everything runs smoothly on localhost.
I've read that this may be caused by namespace issues - the environment may have case sensitivity (if so, how can I work around?). Other posts explained how each component should be visible in Http\View\Components as well as in resources\views\components. I've also read something on the existence of default/packaged components but can not find documentation on these individual ones.
I am looking for components 'x-application-logo', 'x-dropdown', 'x-dropdown-link', 'x-responsive-nav-link', and more. I do not see ANY of these in my local files, yet it all works fine in a local environment.
Yes, I've seen very many similar questions asked. However, in all of those cases, the askers were able to visually locate their component files, or were using self-declared components...
Has anyone working with Quick Admin Panel had similar issues?
I've attempted:
php artisan cache:clear, config:clear, view:clear,
php artisan optimize,
composer dump-autoload,
recompiling with npm then reuploading files,
composer install (and composer2 install)
I ended up installing a fresh instance of Jetstream to copy over its source files. After a few tweaks I got something to work without errors... As I've come to find out, the entire admin panel that I was working with had wiped itself, and for some reason started requiring an instance of Jetstream?? I have no recollection of touching any sort of configuration regarding this, so either there's a carbon monoxide leak in my home, or Hostinger is deciding to automatically mess with my Laravel files for one reason or another. Thankfully I have a proper local version of my project, which I will use to reattempt.

Can I update a single file of Laravel project when it's hosted and live?

I have a Laravel application. It's hosted and people are using it. Actually it's live now. But there's a little issue on images. Some images are not displayed correctly. So I need to fix that. Only some HTML parts and it's done by Blade templating engine. I have access to server and I can edit that files online and fix that issue.
Is that can be a problem ? Do we need to compile or something like that ?
Yes you can edit that file. But make sure you have take a proper backup of the code on your local system and after updating the file on server update your local copy of that code as well.
And after update run the following command through terminal:
php artisan config:cache
This command remove the existing cache and the changes are reflected immediately.

I can't generate migration file with make:migration command in Laravel

This happened to me a couple of months ago. It might have happened in the process of a composer update, but I'm far from sure on that one. I've even updated my project to Laravel 5.3 and it still I can not get make:migration to work through Artisan. No the project it updated to 5.4 and it still do not work.
I've checked out this thread and I have the exact same problem. The symptoms were exactly the same, however the OPs solutions did not work for me.
I get no error or result in the terminal when running make:migrate.
I can generate any other file through Artisan it seems.
I tried to create a new model and pass the -m along with it. Didn't work.
I've checked permissions (and even changed migration folder), but didn't
help.
If I create my own migration-file the rest of the process through artisan works fine (migrate, DB-manipulation etc).
I've tried with different terminals and computers.
Since project were upgraded and even reinstalled I fear it has
nothing to do with the deep kernal. However maybe some sort of conflict from the higher level.
And in the last phase of my quest I tried to figure out what user interacting elements that can possibly effect the make:migration. Nothing worked.
I searched the web without any solution, then I gave up on that project and started to make my own migration files. However I now got some new hope when I saw that other thread.
After some troubleshooting I finaly managed to figure out the problem.
I narrowed it down to have something to do with the config/app.php-file.
Seems I in this project had typed in:
'timezone' => 'UTC+2'
This made creation of migration-files come to a halt without error messages. And it effected only the creation of migration-files (at least what I noticed).
I changed it to 'UTC' and it worked liked a charm again.
Note: the 'UTC+2' worked in the application and I never saw any other indications of errors regarding the rest of the app.php-file, or in the application in general.
Solution: When I instead used the parameters from this site it all worked perfectly again.

Laravel: TokenMismatchException

I know about this exception but I can't fix this issue.
Things that you need to know:
I'm using PHP 5.6 FPM, Nginx, MariaDB;
I'm using Laravel 5.1.44;
My app is working on server and have no issues;
I'm in a new pc with docker. I lost my previous env and it was not installed using docker;
I'm trying to use docker. I tested a lot of containers for a Lemp stack and none of them is working(for this project);
Tested in home and at work(both using docker). Not working;
Now I'm using https://github.com/LaraDock/laradock;
I downloaded a login test project from github and it works.
I don't know, but it looks like a session issue cause when I disable csrf middleware, I try to login and the browser sends me back but it doesn't render an alert that uses session;
But if I use "Session::put('test', 'bla')" and "Session::all()", 'test' is there.
I got this error in all forms;
I have csrf field in all forms;
I tried to change "session.save_path" in "php.ini" and it also does not work.
And I don't know what to do. It's an issue that I can't fix :/
Any help? Something that I could try? Thank you!
EDIT #1
Right now I installed Nginx and PHP FPM using the same version that is in my docker containers and it's working. I installed them in my host machine without docker.
It's not something that I like to do but it works and I can continue to dev my project.
This issue is not fixed yet cause I still can not run my project in a docker container :/
EDIT #2
Before post this question here I tested redis and it also was not working.
Today, I read your replies and I tried with database and it works.
Then I changed to file and it also works now(I did a chmod 777 in storage folder). But yesterday I did this(chmod storage) too, it's weird. And something strange that I notice is that when I reboot my pc, I always have to do a chmod in storage folder to my app works.
But now, I have this "Redirecting to zzzzz.com/aaa" when I have a redirect. Could be a space before a PHP open tag but is something that is not happening in my host machine(as I said in EDIT #1).
I'll try to fix this. Thank you guys!

Laravel not showing the new changes

Any idea on this? I am currently using Laravel 4.2.
We have an existing web application already running in live. Something needs to be changed so I downloaded all the files from live server to my localhost via ftp and do the update in there. Everything is working fine in localhost but when I tried to upload(ftp) the select files (that were only updated- a blade file, a controller and a model), and and test the live site, the changes aren't showing. Checked the html elements thru browser dev tools and indeed it's just the old version. The id that I newly added in the div isn't there.
I checked in the filemanager if the files were successfully updated and it's there.
I am done doing the following:
cleared my browser cache, cleared files in /app/storage/views. What else to do?
Is updating the files thru FTP for laravel not good? Honestly I am just a newbie to this framework so your explicit explanation would be appreciated. Thanks!
Laravel compiles all files before they are deployed most times. If the files are not recompiled on the server, then it's gonna keep running the old setup. if you have terminaal access, runningphp artisan clear-compiled may fix your problem. I may be wrong but this is what i see from where i'm sitting.

Categories