Laravel: TokenMismatchException - php

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!

Related

Localhost not working with fresh installation of Symfony

I know there is a thread on it ("Symfony fresh installation is not working on my localhost") but the solution didnt helped me.
I'm new to Symfony and I tried to create my first project. I installed a fresh copy of Symfony and then tried to start the server but I can't access localhost:8000, its loading forever and nothing happens.
My folder :
Screen installation
I ran this command :
php bin/console server:run
It says everything is okay and I can now access it.
Command Result
..but when I try to access it, the tab is loading forever.
Tab loading forever
Server status
I already tried to start the server on another port php bin/console server:start *:8080 for example, but same problem happen. Am I doing something wrong ? Thanks for helping and sorry for my bad english.
Quick Reply,
Thanks to people answering this thread.
I found the solution. I removed my antivirus protection and now its working perfectly. I recently installed Avast and I tried to removed it and seems to be the problem. Sorry for bothering.

My laravel project start page is not opening

I have install Laravel in my pc using composer.
I used gitbash and started xampp control server
First I've changed my directory.
Then I've ran a command composer create-project laravel/laravel project_1. After the command had run, it installed laravel and all necessary file and key was successfully set.
Then I again changed my directory to project_1
Then I ran another command php artisan serve. After running this command Laravel development server started and 127.0.0.1:8000 this ip has genrated.
I copied the id and paste it in my browser url bar.(I copied and pasted it without using keyboard. I only used mouse)
but when I provided the ip the project_1 starting page did not open.
The page was loading and it is still loading.
what can I do? Please help
logs folder
Here is my contribution, I cannot say what is the cause but I have a solution for it; because I have such as a challenge.
run
php -S 127.0.0.1:8000 -t public
Note that the 8000 is your port, and this could be any 4-digit number.
I hope this helps
Every thing you did seems right to me in terms of Laravel requirements, so lets check some other possible issues:
make sure that your internet connection isn't configured to use
proxy, if so make sure you excluded your local address.
if you are using Internet security suite software, make sure it doesn't block your requests, this vary from software to another but you might test this by deactivating the software for a while until you try.
now that's what I have in mind, I hope it help.
First, stop the php artisan serve
After changing directory go to inside your project folder, you can run php artisan serve. Then a localhost URL will be generated for you where you can see your project in the browser
If you have PHP installed locally and you would like to use PHP's built-in development server will start a development server at http://localhost:8000
Please try to install Laragon and forget about Xampp for now. This is really cool tool and you'll start much quicker. I did try to resolve few issues with Xampp myself and always wasted a lot of time. You can google tutorials later for it as well. Plenty of info out there.
As well it comes with in house installer for Laravel ;) and more :).
Make sure that you are not coping the url from Git Bash through command, it will stop running the project
Make sure that you are not using antivirus specially avast antivirus.

bootstrap.php.cache is missing

I have a problem with Symfony 2. trying the example from the book. I have written a controller but when i go to the URL specified in the route i get an error. The server can't find the page. When i run app_dev.php i get an error that the file boostrap.php.cache is missing.
searched on the internet but found nothing relevant so far. I don't know if the front-controller is already written or if that is something that still has to be done by me.
I can't get the application to run.
Found the solution. I followed the guidelines installing sf2 in netbeans. Instead of running the application as a local website i used the build-in server option wich gave me access to the cli commands. There i could use the command run server and all of my problems were gone.

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.

Magento: Page won't stop loading in admin/system_config/edit/section/design

I was using Magento 1.4.1 and upgrade gracefully to 1.4.2. After testing if the upgrade was Ok, I made some modification in order to have a new home page layout for a store using these instruction. The modifications have been tested on a local version (Ubuntu 10.04, php 5.3.2), and worked great.
When I upload the files to the pre-prod server (Centos 5.5, php 5.2.14), and access the System->Configuration->design tab in the admin backend, my browser seems to keep loading indefinitly.
What I have done:
I copied the app/code/core/Mage/Page/* directory to the app/code/local/Mage/Page/;
I created the app/etc/modules/Mage_Page.xml, and defined the codePool to local;
What I have already checked:
I got no errors in /var/log/httpd/*.log;
I got no errors in magento's var/log/system.log;
The frontend works fine;
The backend can be accessed, except the System->Configuration->design tab;
I tried to revert my modifications to a revision before the modification were made (using svn);
I cleaned up the cache using rm -fr var/cache/mage* var/session/* directly on the server;
I restarted the server multiple time;
I even tried to get a dump of the db in production on the preprod server, with no effect. I still got the same issue.
If someone could point out anything I could have forgot.
I am ready to try anything to make it work, since it would not affect the production server for now.
After a lot of searching, we finally tried to reboot the apache server (we had to force it to reboot, I don't know why?). When we retried, everything was working as expected.
There probably was a corruption on the server that made crash only this tag.
Hope this could help someone.

Categories