wesleytodd / YeoPress

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

Vagrant setup #179

Closed jbonigomes closed 8 years ago

jbonigomes commented 8 years ago

Hi there, this is more of a question then an issue, but I don't know where else I could ask.

I have started a project using the generator with the --advanced flag, so that I could get Vagrant set up.

I am new to Wordpress, apologies if those questions are too naive.

Question 1:

Question 2:

Question 3:

What am I doing wrong? :)

Thanks

P.S. Great work with the generator

wesleytodd commented 8 years ago
  1. yes, learning.com
  2. So the host file entry should point learning.com to the ip address of the virtual machine. You can find this in VirtualBox somewhere in the network settings. Then the line in the host file would be something like: 192.168.1.1 learning.com
  3. This I am not sure of, but the above 2 answers might get it working. If apache doesnt know the right domain name it will not route correctly, and if wordpress doesnt know where it is installed it might 404. Give that a try and post back!

PS. thanks, I am actually surprised that the vagrant stuff even still works. I haven't looked at it in a long time, and was never sure may people used it, because I didn't get many issues like this one. So good luck and let me know how it goes.

Toddses commented 8 years ago

For number 3 - do you have the paths set up in your wp-config,php file?

/**
 * Set custom paths
 *
 * These are required because wordpress is installed in a subdirectory.
 */
if (!defined('WP_SITEURL')) {
    define('WP_SITEURL', 'http://' . $_SERVER['SERVER_NAME'] . '/wordpress');
}
if (!defined('WP_HOME')) {
    define('WP_HOME',    'http://' . $_SERVER['SERVER_NAME'] . '');
}
if (!defined('WP_CONTENT_DIR')) {
    define('WP_CONTENT_DIR', dirname(__FILE__) . '/content');
}
if (!defined('WP_CONTENT_URL')) {
    define('WP_CONTENT_URL', 'http://' . $_SERVER['SERVER_NAME'] . '/content');
}

Are those lines in there? If so, copy and paste here for me. Bad paths here may explain why it can't find the wordpress install...

jbonigomes commented 8 years ago

Thanks @wesleytodd and @Toddses

@wesleytodd, I tried the set up what you mentioned above, however, now my page loads forever until it times out... :(

@Toddses, this is my wp-config:

/**
 * Set custom paths
 *
 * These are required because wordpress is installed in a subdirectory.
 */
if (!defined('WP_SITEURL')) {
  define('WP_SITEURL', 'http://' . $_SERVER['SERVER_NAME'] . '/wordpress');
}
if (!defined('WP_HOME')) {
  define('WP_HOME',    'http://' . $_SERVER['SERVER_NAME'] . '');
}
if (!defined('WP_CONTENT_DIR')) {
  define('WP_CONTENT_DIR', dirname(__FILE__) . '/content');
}
if (!defined('WP_CONTENT_URL')) {
  define('WP_CONTENT_URL', 'http://' . $_SERVER['SERVER_NAME'] . '/content');
}
Toddses commented 8 years ago

That all looks legit. You might try to switch that dirname(__FILE__) call to $_SERVER['DOCUMENT_ROOT']. The dirname() call works for me locally, but never works on our servers when I deploy.

Here, it may not solve the problem, as it should still find the install script regardless of the content_dir constant. You might also dig around the wordpress directory and make sure WP was installed correctly.

jbonigomes commented 8 years ago

Thanks for all your help, I decided to run it locally with MAMP at the end of the day, I have a deadline with my project and need to get going, but once again, thanks for all your help, I will close this issue for now.

Toddses commented 8 years ago

"I have a deadline with my project and I need to get going."

Oh how I wish all developers were as wise as you sir.

jbonigomes commented 8 years ago

Thanks @Toddses