L4 and Wordpress - How to install L4 on subdomain

2019-07-07 01:49发布

问题:

Here is the structure I am aiming for:

    project1.site.com  -> laravel projects
    project2.site.com  -> laravel projects
    project3.site.com  -> laravel projects
    www.site.com       -> wordpress install

How can I accomplish this? I currently tried the following web host structure

    /home/user/www/wp         -> wordpress install
    /home/user/l4/project1    -> laravel app folders
    /home/user/www/project1   -> laravel public folder

However L4 is not loading properly - it cannot access the app folder ("No such file or directory" when trying to access the L4 bootstrap folder located outside the webroot). I checked the folder permissions and everything looks fine, my guess is wordpress is not playing well with laravel.

Anyone know how to fix this? Or provide a setup to allow for a wordpress site with separate subdomains for each laravel project?

回答1:

Try a structure like this:

/home/user/www/wp      ->  Wordpress install
/home/user/www         ->  Laravel install

Make sure your home page goes to /home/user/www/public.

Also, for readability, I recommend calling the Wordpress install folder blog.