wesleytodd / YeoPress

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

wp-config WP_SITEURL and WP_HOME not set #165

Closed safetycat closed 9 years ago

safetycat commented 9 years ago

neither of these values in the wp-config gets set to the wordpress url I put when prompted

if (!defined('WP_SITEURL')) { define('WP_SITEURL', 'http://' . $_SERVER['SERVER_NAME'] . '/wordpress'); } if (!defined('WP_HOME')) { define('WP_HOME', 'http://' . $_SERVER['SERVER_NAME'] . ''); }

is it possible to do? I don't mind doing myself, but I don't know where to look.

many thanks James

safetycat commented 9 years ago

what I mean is, when I ran the install I put the value 'localhost/safetycat' at the WordPress URL prompt so what I really needed in wp-config was

if (!defined('WP_SITEURL')) { define('WP_SITEURL', 'http://' . $_SERVER['SERVER_NAME'] . 'safetycat/wordpress'); } if (!defined('WP_HOME')) { define('WP_HOME', 'http://' . $_SERVER['SERVER_NAME'] . 'safetycat'); }

but I just got the above post --- so because I really want to be able to give this out to the F.E.Ds so they can spin up new projects it would be good if this could be automated

wesleytodd commented 9 years ago

What specifically is the url you want to visit the site at (ex: http://localhost/safetycat)? I think there are some issues with that method right now, right @Toddses? But is should be very simple to just use a subdomain instead of a director(ex: http://safeytcat.localhost). That works for sure.

safetycat commented 9 years ago

ok I will probably have to write some kind of script to set up the subdomains then, or anyway I am reading a book on yeoman so perhaps I'll make that work... thanks all great with everything else

Toddses commented 9 years ago

Yea the subdirectory install isn't quite there yet. We could maybe add that to the prompt session so its done automatically. Regardless, @safetycat, your changes to the config are correct for a subdirectory install.

Honestly if you're going to go the route of doing subdomains on your local, just do a vhost with a root URL. This is more useful, I think, especially if you are going to deploy your site to a root URL and not a subdomain/subdirectory.

safetycat commented 9 years ago

yeah, good advice, thanks - was tiptoeing around the vhost thing but think now I probably should do it... :-)

wesleytodd commented 9 years ago

Agreed with everything said here. It makes migrating the database back and forth easier and a whole host of other things.

If you are worried about getting the fed's up and running you could also check out the vagrant integration. It sets up a whole server for you with a LAMP stack.