Production Server and Local Server get different result - laravel

I build API project using Laravel 8, and I put my project on Git. My production server using Ubuntu Apache. I use only 1 database, and it's use on my local and production server.
I have weird problem since yesterday and make me confused. So, I push the latest commit to my Server from Local Server. Everything went well. But when I try to run my API via Postman, the results from my Local and Production server are different.
I checked manually in the files I pushed from local, everything is exactly same.
I try git status, everything OK. git pull are up to date. Here i attach the screenshoot.
Since i use laravel, i try to clear cache with php artisan cache:clear and it doesn't work.
Here i attach my Postman result:
As you can see, the result are different. I believe, there is no error with my code, It's work well on my Local server.
I try to contact my server provider, but didn't get any solution.
Anyway, this is Header from Prod Server
I'll appreciate all the answer from this thread. Thank you

Are you working on same branch in local and server? check your git branches in both.

Thank you for the answer and comment.
I already solve this problem. The problem pure from my production file and server.
first i try to restart my docker, and then run php artisan config:clear.

Related

Critical Caching issue in Laravel Application (AWS Server)

I am facing a critical issue in my application, it is developed in Laravel and Angular. The issue is I am getting the old email templates on live site and on local server I am getting the latest updated one. The process to deloy the code is automatic, I just to commit the code in BitBucket and after that Bitbucket Pipleline push the code to AWS server directly.
I have already run the cache cammands for Laravel and restarted the jobs but still i am getting the same issue. If anyone have expirienced the same issue or have knowledge of the same to resolve, Please guide!
I think you can try one of the following ways to overcome the issue, I faced a similar issue and resolved it by following ways -
Try deleting the cache files manually from Laravel from storage/framework/views
Upload the code directly into AWS for particular module without using the pipeline way
restart your server
This will surely resolve your issue!
Since you are using Laravel and angular application deployed on AWS,
I assume that bit bucket is pushing code and build commands are fired on every push
there are few things which can help you.
Try to build the angular side on every push, since angular builds hashes all the files in the dist folder
Try to delete the Laravel cached files which are stored in storage/framework/views
Check that on that your server is pointing to the right project folder
If any of the points from 1 or 2 works you can automate the process by passing CLI command after every push,
Point 1 and 2 are achievable by passing CLI commands.

Template doesnot exist when running on heroku but exists when running locally

I just created my first heroku app and pushed my code through it onto heroku. While testing it however, it showed that one of the templates didnot exist when it infact does when I test it from my laptop directly on the local server. Please do guide if you have any ideas!(ps.: I am using Windows hence please do keep take that into consideration when helping out!)

Artisan command affecting wrong database

I have two laravel apps, the first is used as a Server Management System (SMS) that creates a host on the server. When this host is created it does a git clone to bring in the second laravel app that is used as a CMS for that host.
What I am trying to do is create a plugin within the SMS so that you can just select a check box and it will install the CMS for you when you create a new host. I have most of the code in place and I am testing locally and everything works grand until at the end when I try to install the migrations, when I try to run;
'php artisan cms:update'.
I also tried;
'php artisan migrate'.
What ends up happening is that rather the command being run against the CMS database, it is affecting the SMS's database adding a couple of tables and breaking the SMS database. I have done a 'pwd' and checked to make sure I am in the correct directory;
'/Directory/Directory/host/cms'
As it makes more sense for someone to read all of the code rather than snippets here is a link to the plugin:
CODE LINK
So to clarify what I need is to be able to test the plugin locally so I need the migrations to install into the correct database, and make sure the CMS works before I push to production. If anyone could shed some light on why the migrations is affecting the SMS rather than the CMS it would be greatly appreciated.

Migrations in production Laravel

I'm working on a personal website, and i try to find a solution to a problem and any help would be welcome.
I work with Github because I'm working from several places (work, home...), and I'm wondering about migrations when I transfer my application in production. Locally, I don't have any problem, I do my migrations, and run artisan migrate, but then when i put this online, I HAVE to log in to my server, run the migration from the command-line, and then edit the migrations file online again.
I know this is not the good solution to do this, it's really not good for long term usage and bigger applications than mine.
And little other question, what would you advise me to use to push automatically my master branch from git to my server, I have heard about Heroku, is it easy to get working with it ?
Thank you
If you are using Laravel 5 you can take advantage of Envoy. It is exactly what you want. You can set tasks for many servers (basically you can write any commands you want like updating from git or running migrations). Taylor wrote the documentation very good, so you can get started very easy.
A quick example for SSH in a server, update form git and run migrations:
#servers(['web' => '192.168.1.1'])
#task('deploy', ['on' => 'web'])
cd site
git pull origin {{ $branch }}
php artisan migrate
#endtask
For Laravel 4, you also have Envoy task runner.

Joomla 3 backend log in issue

I built my site on my local machine on MAMP and I migrated the finished site to my remote server. I used Akeeba Backup and Kickstart and installed before making the final back up and then setting it up on the remote server.
However after doing so, I am no longer able to login to my admin. The passwords have not changed and the only thing I get is a yellow pop up message above the login box that says "Warning".
I reset my passwords several times but no success. The site works without a hitch so I don't think something went wrong on the migration but that wouldn't explain why I no longer can't log into my local instance.
I am a little perplexed. I am not sure if there is a bug with Akeeba Kickstart 3.9.
Most probably your remote server has the newer PHP version. The reason is that new PHP version generates the MD5 in a different way.
I also had the same issue once ... please try the following steps...
in you DB's Joomla user table
Backup the password'hash of your desired user.
Now go to this site and get the new MD5 hash of your password.
INSERT the new MD5 hash into DB.
Now try logging in again.
I found my issue even though my local MAMP was using PHP 5.3 and my remote server PHP 5.6 the actual problem was that for some reason the Joomla User plug in was disabled during the migration which caused me not being able to log in.
I went into my DB and set the flag from '0' to '1' and it resolved the issue. I am not sure how the parameter was changed but it was the culprit.

Resources