Essentially, the problem seems to be that $_SERVER['DOCUMENT_ROOT'] is pointing towards /Library/ rather than /Users/.
Is there any circumstance in your setup where you would want $_SERVER['DOCUMENT_ROOT'] to be pointing towards /Library/?
If not, and you always want $_SERVER['DOCUMENT_ROOT'] to be pointing towards /Users, then would changing DOCUMENT_ROOT in your server settings not be a possible solution?
As far as I am aware, it is not unusual to use $_SERVER['DOCUMENT_ROOT'] to fetch the document root directory.
I do not know of an alternative to $_SERVER['DOCUMENT_ROOT'] which would specifically support your setup (Apache server on Mac with two root directories) .
I think the best solution might be to ensure that $_SERVER['DOCUMENT_ROOT'] returns the path you want to use.
I've tried a web search for this problem and found the following forum threads which seems to be relevant.
https://forum.mamp.info/viewtopic.php?f=4&t=669
https://css-tricks.com/forums/topic/how … -x-simply/
If you are using MAMP, then the following suggestion (from the second link above) might help:
https://css-tricks.com/forums/topic/how … post-95005
Here are a few other links which relate to your setup (Apache server on Mac) and reference the document root. They may contain some information which will help.
http://superuser.com/questions/225346/h … -on-my-mac
https://coolestguidesontheplanet.com/in … n/#webroot
http://serverfault.com/questions/161529 … n-mac-os-x
Otherwise, a workaround would be to replace $_SERVER['DOCUMENT_ROOT'] in the 'juicebox.php' file with the path you want to use (or create a new PHP constant and use this instead of $_SERVER['DOCUMENT_ROOT'] in the 'juicebox.php' file).