Trying To Setup Development System

Greetings All,

I am just starting to play around with Kirby 3 on my local machine.

Setup is a Mac running OS 10.14 (Mojave) using Homebrew to have installed all the required software (PHP7.1, HTTPD, etc).

I have setup multiple virtual hosts for my system instead of relying on the standard webroot.

I have followed the Cookbook page here Using Kirby for multiple sites.

  1. It requires me to add the β€œroot” virtual host to the $sites variable. Is this normal?

  2. Everytime I access the site in a brand new session it cannot load the php71-intl plugin via php.ini until I run a refresh.

  3. Because of #2, the other sub sites do not execute their panel correctly and I am left with half setup pages.

Any help and advice appreciated. Even if it is a different method of looking at setting it up.

D

I personally would suggest using something like Valet+ (because its awesome and sets all that in a couple of minutes) or Mamp.

Having gone through the pain of setting up a server using system installed stuff several times, it ends up being a house of cards - one false move in the future and your world will crash in.

Valet+ uses natively installed stuff via Homebrew but its all tied together nicely into a predictable setup.

Thank you for the suggestion, however I have had problems with DNSMasq for a long time now so Valet(+) will cause problems.

I did get it working finally (the way my development system is happy with it) so that is a good thing. Reading your suggestion made my brain think in a different way.

On another note, do I have to create templates for every subdomain? Or can they share the same templates as the main kirby installation?

It would be better to start a new thread for that one, since it is a completely different question :slight_smile:

Yes, that should be possible for each folder with its own root.

How would I go about this?

This is my current development structure …

Kirby Installation with a subs folder.

In the subs folder are the various other websites that wish to run off the same installation.

Within those folders are the site/content/media folders as described in the multi-site example on the website.

Within site one would expect templates, blueprints, etc.

If I have those as empty then would it automatically default to the root installation?

D

You have to define where Kirby has to look for them in your index.php.

The example moves the complete site folder, but since Kirby has roots for individual folders within the site folder, it should be possible to move just parts.

All the roots: Roots | Kirby CMS

Okay,

so I went ahead and modified the index.php to add the assets directory into the Kirby object like so.

$kirby = new Kirby([
  'roots' => [
      'index'   => __DIR__
    , 'assets'  => $root . '/assets'
    , 'site'    => $root . '/site'
    , 'content' => $root . '/content'
    , 'media'   => $root . '/media'
  ]
]);

The assets directory is setup just like the root, except I have only added one css file for a specific page for testing (about.php).

However when I use css('@auto') in the header.php snippet within the sub site, it outputs the CSS for the root site.

I thought that it would look for the css based upon the page within the current site rather than the root site.

Am I doing something wrong here?