I keep getting a TokenMismatchException when working on a cloned project using Vagrant on Windows.
I have several other laravel projects using similar setups and they work fine.
I tried cloning this project on a VM using VirtualBox and it works, I also cloned this project on a temporary remote staging server and it works but it does not using Vagrant on Windows.
I commented out the
Route::filter('csrf', function()
{
if (Session::getToken() != Input::get('csrf_token') && Session::getToken() != Input::get('_token'))
{
throw new Illuminate\Session\TokenMismatchException;
}
});
but unfortunately I cannot login afterwards as it just returns me to the index page.
I also changed the app/storage permission to 777 recursively as I believe that the token issue is within a session file which is not being overwritten. I also deleted all the content of app/storage/sessions and i can see new files generated when I refresh the application.
I would really like to be able to work using vagrant on this project as it requires regular and speedy changes and also because this is the setup I use on all projects. As I said all other Laravel projects work fine even the ones which I started off using VirtualBox and now on Vagrant.
All help is appreciated. Please let em know if my question isn't clear enough.
Thanks
As my question says, the issue was due to directory permissions. Because the original project was developed on a windows system not using Vagrant nor VirtualBox the permissions could not be changed through vagrant.
I solved this by starting a new laravel application and copying my controllers, models, config files and assets.
Now I can use Vagrant to manage this project.
Related
Hi After some issues with Vagrant I'm trying out a switch to Docker and using Sail but struggling with quite a few concepts that I can't seem to find the answers to (or get my head around).
I have a working project that I've been building on a local machine via Homestead and have it in a bitbucket repository. I can make changes to that project and it works on a windows machine and can access in the browser using the URL for the app.
I've now succesfully installed docker, ubuntu on windows and can "sail up" from within the project by navigating within ubuntu to the local files - from here I can "sail up" and browse to the app using http:/localhost. I can access the database via TablePlus and the app works - but very very slowly.
Search results suggest it's slow because I'm accessing the app via the windows directory (currently files sit on drive E) which then leads to some questions:
Should I place my project files within the home directory within ubuntu and run sail from there? If so is there an easy way to copy the directory from the E drive to the home directory or do I simply pull the repository from bitbucket from within ubuntu?
Does this mean each time I shut down the machine I will lose my app files? Meaning I should then ensure I have pushed any changes to the bitbucket repository?
As I understand it ubuntu on windows won't have php or composer installed as default - so do I need to install these first before even thinking about moving my project over?
Are there any recommended guides/videos that would help with a focus on Laravel and Docker (currently working my way through the ones on this site)
It's a strange concept - I got the hang of Homestead and was comfortable with the syncing concept but completely lost on docker - despite getting an app working but the concepts are lost on me at the moment and the Laravel set up guide assumes I have a grasp of them.
Thank you :)
I have a laravel project running on Linux server without any issue. The files are in /public_html directory and "laravel" directory is out of public_html. It has mySQL 5.6 and PHP 7.1. The project works completely fine.
Now, we have decided to move this on windows server. I have setup same PHP and mySQL on new windows server. I have double checked and this is correct.
I have imported entire database to windows and files have been moved as below:
The files from /home/abcuser/public_html/ directory to
C:\HostingSpace\abc.com\wwwroot
The files from /home/abcuser/laravel directory to
C:\HostingSpace\abc.com\laravel
The IIS has site path as below:
C:\HostingSpace\abc.com\wwwroot
I set all required permissions to these directories and updated database connection in .env file.
I am now getting blank page with no error message. Do I still need to make any changes in code? Did anyone has experienced the same?
Finally got this fixed..
I had to enable some PHP extensions. What I did is:
Checked the list of disabled PHP extensions from IIS of concerned
site.
Checked whether the particular extension is enabled in oldserver where
it is working.
And Enabled it as needed.
I have a new developer coming to work with me soon, and I'd like to make it as simple as possible for them to get a development environment set up.
I'm currently using a Vagrant (Laravel Homestead) box with about 15 domains set up, each with different configurations (different PHP versions etc), and I'd like to just share the existing box with them if possible.
Is it as simple setting up a repository with the VagrantFile, getting them to clone it and provision the box, or are there more steps involved?
Also, I've had to edit the MySQL configuration on the box, is there any way I can include these updates in what I share with them, or will they just need to reconfigure their own version manually?
Any advice appreciated.
Thanks
The easiest way to share the Homestead environment is to use the after.sh file to to perform any customization you may need beyond what Homestead gives you.
You can also copy your Homestead.yaml file to Homestead.yaml.example for the new coworker to easily copy and paste the sites & any other configuration changes.
I wrote a web app in Laravel. The repo doesn't store a whole Laravel installation - it only has app and public directories.
I'm trying to figure out a good solution to allow other devs to easily spin up a local version of my code for them to try/work on. Someone suggested that I set up a symlink between the cloned repo and my Laravel installation, which sounded like a good solution to me (allows them to push/pull from my repo without needing to copy files endlessly).
However, when I set up the symlink, Laravel starts looking for its files (bootstrap, vendor, etc.) in the repo's directory, but they don't exist there, so I just get a blank screen.
Any ideas?
So I have been given the task of upgrading one of our companies' old websites that is based on 1.5 to something newer (because a second site of ours on the same version just got hacked).
I know some php and some other web stuff, but I'd never used Joomla.
I have setup a lamp server on a local VM (ubuntu) for me to test it all out on, then upload the upgraded version as is suggested. My problem now is that I know the permissions are not correct because when I tried installing Akeeba Backup, it kept throwing errors such as "could not copy to /var/www/components and /var/www/administrator etc. I went in and chmod'd those 2 (and then the rest of www because of more errors) to 757 (from 755 for the most part) - which i know at that point might as well be 777. Then when I've tried to use Kickstart to restore from the JPA file I have, it just right away throws an error "could not create j_backup/ folder".
I know this slackening of all permissions on the root folder is wrong, but it was the only way to get it to 'work', which it's not even now, so my question is what did I do wrong in the setup and how do i fix it? I'm not great with Linux, but I'm thinking I have to make PHP owner of www? is that right? or terrible practice?
The other issue I see now is that I just installed the latest php and everything and I see Akeepa says not to use php 5.4... not sure how much of a problem that's going to be....
Some direction would be great because I'm more than a little lost.
Thanks!
This is certainly a headache. Most often, as you stated, the issue is the ownership of the files on your server. Files uploaded via FTP will be owned by your FTP user and may not be editable by the Apache/PHP user. Similarly, files created by installing extensions in Joomla! will be owned by the Apache/PHP user and your FTP user will not be able to modify them. Here is an article discussing the problem with a couple of possible solutions:
http://docs.joomla.org/Why_can%27t_you_install_any_extensions%3F#File_ownership_advice_from_ianmac
In the past, I have used an Apache Module called suPHP (http://www.suphp.org/Home.html) to solve this problem and keep it from reoccurring. suPHP executes PHP scripts with the permissions of their owners.
As for file permissions other than ownership, please refer to the Joomla! documentation for the correct settings: http://docs.joomla.org/Verifying_permissions. One quick way to handle this (if you can install extensions after correcting the ownership issue) is to use the AdminTools extension (http://extensions.joomla.org/extensions/access-a-security/site-security/site-protection/14087). One of its tools ‘fixes’ the file permissions on your server by resetting them to the Joomla! default.
Good luck!