wesleytodd / YeoPress

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

Add a note about editing wp-config when the generator finishes #26

Closed ActionScripted closed 11 years ago

ActionScripted commented 11 years ago

Steps to reproduce:

  1. Create directory in web server path
  2. Run yo wordpress
  3. Setup WordPress as a submodule
  4. Try to access project through web server

There doesn't appear to be an .htaccess file, which I understand as not everyone will use Apache, but it'd be great if there were options for nginx or Apache during the setup to output the proper rewrites.

Or maybe that's not the problem.

wesleytodd commented 11 years ago

So just to be clear, when you try to visit the site, it re-directs you to /wp-admin/install.php. This page is a 404?

If I understand correctly, the issue here is probably that your wp-config does not have the correct configuration values for these lines:

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

Either that or you did not put in the install url correctly. Remember that it requires the port number if you are on something like localhost:8080, which is what happens if you used the vagrant box.

Let me know if that helps.

wesleytodd commented 11 years ago

Also, if these dont help, can you post the settings you used when you ran yeoman. The part between the red lines when you are asked to confirm would be good.

mynorth commented 11 years ago

Worked once I manually updated wp-config.php thanks!

Would it make sense, given the nature of this project, to use the URL provided for the "WordPress URL" prompt for the values in wp-config.php instead of $_SERVER['SERVER_NAME']? Or perhaps add a line after setup like, "You may need to modify some settings in wp-config.php"?

wesleytodd commented 11 years ago

This configuration will work without change in most situations. What did you have to change it to to get yours to work?

The issue I see with your change would be that it would need to change when you launched to your production url. This may not be an issue once we get a deployment solution in place, but for now you would definitely have to change it. Which is why I didn't do it.

ActionScripted commented 11 years ago

With my local setup, have Apache running at localhost:80 and put cloned git projects into my Sites folder so that my local path is http://localhost/~michael/some-site-com/some-site.com

During yo wordpress it prompts for the full URL and if it could just add/use this in wp-config.php instead of $_SERVER['SERVER_NAME'] it would work without changes on my machine. I realize I could setup a virtual host or something, and I'm fine manually editing wp-config.php. I do think a mention of possible changes to wp-config.php might be nice in the docs or post setup.

wesleytodd commented 11 years ago

I think a note about changing it is a good idea.

Another option would be to add an advanced prompt like "Use url as server name in wp-config". With this we could see which way was most helpful to people. But I think the way it is should work for most people.

wesleytodd commented 11 years ago

b24b9a444a50fba714b0d8b4ff1e495957548cd7