Jump to content

Can't get Processwire working in Vagrant?


kyle
 Share

Recommended Posts

I have been able to easily install processwire in the past locally and on servers, but I recently added Vagrant to my development process, and I can't seem to get processwire installed correctly.


 


Everything is right as far as the required components for the install.  I go through ans rename the site-default to site and htacess.txt to .htaccess.  Then I chmod /site/assets and /site/config.php to 777.  Everything passes the check correctly, and then I enter the database info etc.  There are no errors here.


 


Everything looks like it gets installed  correctly, but when I log in I get the "This request was aborted because it appears to be forged." error.  I have come across this error before, and know how to fix it normally.  I have confirmed that the sessions, cache, logs, files folders were created.  I have even tried to chmod the whole site to 777, but nothing has worked.  I have set $config->protectCSRF to false, and it gets rid of the error; however, it doesn't actually log me into the site but it redirects me back to the processwire login page with no errors and the form fields cleared.  The owner and group when I ssh in are vagrant/vagrant, so I don't think that would be an issue.


 


I have seen this post which seems to be having the same issue as me, but the index.php file has seemed to same, so the answer is outdated.


 


Any ideas?


Link to comment
Share on other sites

@kyle: in case that this is related to creating files on the disk, have you considered installing SessionHandlerDB, i.e. moving sessions to database?

If you can't log in to install it, you can do this with a very simple external script:

<?php
require 'index.php'; // path to PW index.php
wire('modules')->install('SessionHandlerDB');
  • Like 2
Link to comment
Share on other sites

  • 2 weeks later...

It was an issue with vagrant.  I have had the issue setting up laravel also.  To fix it I just changed the user/group for apache to vagrant.  Generally this wouldn't be safe at all in a production environment but access to the VM is limited to me, so I am not too concerned.

To change the user/group will depend on your OS.  In ubuntu the config file is located in /etc/apache2 and it is apache2.conf.  Sometimes "apache2" will be swapped out for "http.d".  You can edit the file using vim/nano and then save and restart apache.

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...