2

My hoster has i public html folder where all websites are lying. Different Websites are separeted by subfolders. Should i upload all Craft3 installation files to this public html folder and point the webserver to the /web folder?

Or should i upload only the /web folder to my webhoster's public html folder and place all other files ABOVE, like it's explained in the Craft 2 installation guide? If yes, how do i configure the craft path in the index.php file?

Thank you very much for a explanation!

3

Only upload the /web folder to the /public_html folder.

All other folders should be one level lower so they're not publicly accessible.

Personally, I'm also wondering why not everything resides in a nice clean /craft folder anymore. Now the craft directories are listed amongst a bunch of other stuff on a lowerlevel directory. It's probably the only one really strange architectural choice. I guess P&T is not using WHM/Cpanel etc.

Anyway: do not upload anything except /web in your public folder.

If you do it like this, the index will work correctly out of the box, since it'll be looking for the /app and all folders one level lower then the /public_html by default.

|improve this answer|||||
  • That's because the clean way to install Craft is via composer and the composer puts everything into the vendor folder. It's much better the way it is now. – Robin Schambach Apr 11 '18 at 5:11
  • 1
    No it doesn't.... WHM/Cpanel, one of the most popular control pannels, with or without composer, it creates this mess. There's a vendor folder alright, but all the rest is mixed. I find this a very, VERY, poor choice of implementation. – tom May 12 '18 at 18:13
0

You can place it in a dedicated craft folder or a private_html folder with composer, but then you have to edit the index.php file a bit to make it work. See Setup Craft 3 when de craft folder is above public_html on shared hosting

|improve this answer|||||
  • didn't work for me. I had to set the path in the index.php file like this: define('CRAFT_BASE_PATH', '../../craft folder above public_html'); – TomS Apr 14 '18 at 20:44
  • The easiest thing to do would be to insert the full path, avoiding any confusion, like so: define('CRAFT_BASE_PATH', ('/home/pathToCraftFolder/craft')); – noregt Apr 16 '18 at 11:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.