wesleytodd / YeoPress

A Yeoman generator for WordPress
Other
1.08k stars 161 forks source link

Not working with Vagrant #44

Closed ninjasort closed 11 years ago

ninjasort commented 11 years ago

I've installed everything correctly and even replaced the old

:exit => "dmode=777","fmode=666"

to

:mount_options => ["dmode=777","fmode=666"] in the Vagrantfile, but when I run vagrant and go to localhost:8080, it redirects me to localhost/wordpress/wp-admin/install.php with nothing. If I relpace it with localhost:8080 in front, I get the install page but no styles. Very strange... any help?

wesleytodd commented 11 years ago

When you entered the hostname into the prompts, did you include the port? Check this part of your wp-config and make sure the port is correctly in place. That is the first thing that comes to mind, but I am not positive without more info.

Also, I would like to update the vagrant stuff at some point, so if you know what you are doing and want to give back, please feel free to fix it up and submit a PR.

ninjasort commented 11 years ago

I just started a fresh project using the --advanced scaffold with the hostname as localhost:8080 and I got this vagrant error again:

Error: { [Error: Command failed: There are errors in the configuration of this machine. Please fix the following errors and try again:

vm:

] killed: false, code: 1, signal: null }

So I changed the Vagrantfile with these settings and ran vagrant up

I then went to localhost:8080 and it redirected me to localhost with nothing. Here's that line

define('WP_SITEURL', 'http://' . $_SERVER['SERVER_NAME'] . '/wordpress');

Also, even when I change it with the port number it still redirects. I'm reading up on Vagrantfiles now and although I'm not a pro with them, I'm definitely willing to help learn and contribute what I find.

wesleytodd commented 11 years ago

I may be using an older version of Vagrant, I will check that out.

As for the port number, it needs to be there with the vagrant config. That full block there should read:

define('WP_SITEURL', 'http://' . $_SERVER['SERVER_NAME'] . ':8080/wordpress');
define('WP_HOME',    'http://' . $_SERVER['SERVER_NAME'] . ':8080');
define('WP_CONTENT_DIR', __dir__ . '/content');
define('WP_CONTENT_URL', 'http://' . $_SERVER['SERVER_NAME'] . ':8080/content');

So did you have all of those with the port?

ninjasort commented 11 years ago

Okay I changed them and now it's working but now I'm getting a wordpress "Error establishing a database connection" error.

Also you can install the latest Vagrant with Homebrew Cask https://github.com/phinze/homebrew-cask

I'm using Vagrant 1.3.5

wesleytodd commented 11 years ago

Closing. If you are getting that error the generator worked. It is just a matter of getting the WP configuration right.