How can I access XAMPP/Lampp folder via Terminal on Mac - terminal

I recently started using XAMPP on Mac and it installed the "lampp" folder under "Shared" and showing as an IP address in Finder. So I can access the files via Finder but I'm unable to cd into the folder via Terminal.
The Shared folder is simply not visible. I tried /Volumes to see all volumes, but "lampp" wasn't listed, as well mounting it somehow but that also didn't work. Any ideas? It's so odd that I see the folder in Finder but not in Terminal!

I had the same problem the route for htdocs is the following:
cd /Users/***your_user_name***/.bitnami/stackman/machines/xampp/volumes/root/htdocs
"username" only replaces that line by the name of your user
Example, for me it would be:
cd /Users/adanuri/.bitnami/stackman/machines/xampp/volumes/root/htdocs

I run in to the same problem and looked for hours for a solution. I now found this page:
https://www.apachefriends.org/blog/new_xampp_20170628.html
Since it is a VM you have to click on the Open Terminal button in the general tab of the stack manager. Then a new window opens and you can work on the terminal.
Screenshot of the stack manager with the open Terminal option
Screen Shot of the open Terminal window

If you just want the http://localhost version, go and reinstall the non VM XAMPP.
Make sure you download & install a version where the name doesn't include '-VM' here: https://www.apachefriends.org/download.html

This the path where you can find the full path of xampp htdocs folder.
/Users/my_name/.bitnami/stackman/machines/xampp/volumes/root/htdocs

In case you do not remember the path of the "htdocs" folder, you could type ls -a (ls stands for list) and see even hidden folders and files.
".bitnami" is one of those (inside the user folder) and then follow the path down to "htdocs".
All the other folders, already pointed out by #uriplata in the above answer, are visible simply using the command ls each time you change folder (with command "cd").

You have to mount the drive:
When the drive is mounted you can see it at: .bitnami/stackman/machines/volumes/root
If the drive is not mounted root will be empty. However, your data will still be there.

"Open Terminal" XAMPP management tool, see image in this link
You only must clic in "Open Terminal" at XAMPP management tool, as you can see in the attached image.

Related

Path to Box Folder in Mac OS Monterey

I recently upgraded my MacBook Pro OS to Monterey and the Box folder/link which was formerly located in my home directory appears to have vanished. I can still see the Box folder as a "Location" in Finder and access files, but I can not use the Terminal/CLI to easily copy files to Box without using the Folder (which is annoying). With OneDive, GoogleDrive, Dropbox the links still exist - just not Box. Moreover, the "Get Info" button is useless, telling me the path to Box is "Box" although there is no /Box , /mnt/Box, /Volumes/Box etc...
Looking for a possible Path I can use has been frustrating, there is:
/Users/$USER/Library/Application Support/Box but there is not a nice file system there I can use.
/Applications/Box.app is just the application...
I'm assuming my cache of Box documents still exists locally as a FileSystem, but I have no idea where which I find infuriating.
Any information appreciated.
Found it, path location is:
/Users/$USER/Library/CloudStorage/Box-Box
Not sure how I missed this earlier or what happened to the link.
After the above, you can simply create a symbolic link in your home directory via the ln command:
ln -s source_file symbolic_link. For example,
ln -s /Users/YourUserName/Library/CloudStorage/Box-Box Box
After, Box will be displayed in your home directory as a symbolic link, and you will be able to change into the directory without having to memorize the whole path.

'open in terminal' option is enabled on the right-click menu, but it goes directory to the home directory

When I am in a folder and I want to open that folder on the terminal, the 'open in terminal' option on the right-click menu takes me to my home directory. I have two computers, both of them have Ubuntu 18.04, This problem exists on only one of them. Does anyone know how to fix this issue?
I finally found the problem and fixed it. On the terminal preferences, I had assigned a custom command to be run instead of my shell. I unchecked the option to run a custom command and things went back to normal.

Docker-desktop for MacOs can't add /usr/local folder in Preferences/File-Sharing

I'm using Docker Desktop vrs 2.1.1.0 (edge channel) on Mac Os Mojave. I need to include a file from /usr/local folder, as shared file in Docker's preferences, but the /usr folder is not displayed while browsing the folders. The option to write the folder/file name manually is also not available. See the print screens.
Does anyone have a clue how to add those folders in preferences?
File sharing paths are not manually editable
Folders like /usr or /Volumes don't appear in folder browsing
Update
I need to share this actual folder: /usr/local/share/dotnet/sdk/NuGetFallbackFolde and not entirely the /usr/local as I wrote above. But as I'm not able to select at least the /usr folder, this is why I've mentioned only the /usr/local folder.
Update
I've downgraded progressively up to Docker Community Edition 2.0.0.3 2019-02-15. That seems to be the last version with the old user interface. With this version the folder browser dialog from file sharing displays all the folders and also manual editing of the file paths works.
On versions Docker Desktop Community 2.1.0.1 and Docker Desktop Community 2.1.0.2, which have the new UI, it doesn't work.
I have faced the same problem and could sort it out using the latest docker version.
You can edit ~/Library/Group\ Containers/group.com.docker/settings.json.
Then add whatever path you need, in my case was a synthetic link (created through synthetic.conf), this way by manual editing the file the UI does not auto resolve the link so it works well.
{
"filesharingDirectories" : [
"\/Users",
"\/Volumes",
"\/datadrive",
"\/private",
"\/tmp"
],
In the File Sharing tab of Docker's Preferences, click the Add Directory button (+) and browse to the root directory of your Mac drive. Now press Command+Shift+Dot to show hidden directories. This will make the usr directory visible.
You will now be able to browse to the /usr/local/share/dotnet/sdk/NuGetFallbackFolder directory.
I think you have to add application to the list of trusted apps. Take a look here:
http://www.owsiak.org/macos-mojave-and-accessing-timemachine-data/
Unless you add Full Disk access, applications are not able to browse certain areas of your volume.
Update
Unfortunately, it looks like giving access to whole drive is not a solution in this case.
It looks like Docker Desktop is not quite happy with sharing /usr/local directory.

Where to find htdocs in XAMPP Mac

I cannot find the htdocs directory anywhere on XAMPP for Mac.
Many videos on YouTube show people just clicking a button that says "Go to application folder" but on my user interface, it reads: "Go to application" which just opens the localhost page at http://localhost.
Where can I locate the htdocs directory?
In the "volumes" tab, you have to mount it first. Then it appears on the desktop as if it were an external USB. All the data is inside it. :D
At least for macbook (os high sierra) go to terminal and type or copy and paste:
cd ~/.bitnami/stackman/machines/xampp/volumes/root/htdocs
I have installed XAMPP version 7.3.11, After starting the Apache and other services, go to volumes tab on XAMPP, and click on mount button,
And then Click on explore button,
You will get Finder open up with this,
Open xampp application, then do the following:
go to: volumes,
click the [mount] button, and
finally click explore.
Go to Volumes Tab and click Mount
You can find it under Locations in the Sidebar. Click on it.
Open this folder: Lamp
You can find the htdocs folder inside Lamp, just like the below screenshot:
Note: I am using macOS Catalina.
you installed Xampp-VM (VirtualMachine), simply instead install one of the "normal" installations and everything runs fine.
Simple as ...
From the UI
Click Go->Go to Folder then /Applications/XAMPP/htdocs
From Terminal
cd /Applications/XAMPP/htdocs
Click volumes, then explore, and then that should open lampp which has htdocs in it.
for each easy and useful access you can add terminal command via editing your bash profile, here how:
open terminal -> type cd hit enter.
then type nano .bash_profile
then add this line
alias htdocs="cd ~/.bitnami/stackman/machines/xampp/volumes/root/htdocs"
Now hit ctrl + o then hit enter, then hit ctrl + x
Now to refresh the terminal commands type the following command
source .bash_profile
Now you can use htdocs command each time you want to navigate htdocs folder.
There are two ways to find it:
One way is to open Finder>Applications>XAMPP(FolderNotTheInstaller)>htdocs
Another way is cmd+space and searches for manager-osx,
go to Welcome and click the Open Application Folder.
For me it was in
/Users/your username/.bitnami/stackman/machines/xampp
I am using Mac Os Mojave 10.14.5
From XAMPP Application window (manager-osx) click => Open Application Folder >> htdocs
Now you opened your target folder.
You can see process by image below
XAMPP Application window (manager-osx)
Open Application Folder
Application (xamppfiles) folder opened
Click on 'htdocs'
Your target folder 'htdocs' opened
Now begin your development
Make sure no other apache servers are running as it generates an error when you try to access it on the browser even with a different port. Go to Finder and below Device you will usually see the lampp icon. You can also open the htdocs from any of the ide or code editor by opening files or project once you locate the lampp icon. Make sure you mount the stack.
Simply click in "Go To Application Folder"
I used this line to locate and edit the permissions under xampp:
chmod 777 ~/.bitnami/stackman/machines/xampp/volumes/root/htdocs/folder
The next moment I installed MAMP, can find the docks in my local.
PFA screenshot.
Location:
/Applications/MAMP/htdocs/
You installed xampp Vn thats the problem.
Install normal xampp and everything will be fine.
link to nornal xampp: https://www.apachefriends.org/download.html
Download it from the link
install it
when it opens, Simply click in "Go To Application Folder".
/Applications/XAMPP/xamppfiles/htdocs
Go to finder in your Mac
In Location click the network address.
You will see the Lampp folder. To see this network address yo need to have started xampp application and mounted it.
Click Lampp folder
You will see the htdocs folder among the folders.
On opening htdocs folder you will find your php applications
From the Finder menu, click Go->Go to Folder. Type in /Applications/XAMPP

How can I get gVim (Windows) to use "home\.vim" for my plugins?

I have a Desktop running Windows 7, and a Macbook Pro running Mountain Lion. I use gVim and MacVim respectively. I like to keep my plugins and settings synced between the machine, so I store them in my Google Drive, and I can always pull them from there.
On my Mac, I just have a .gvimrc file and a .vim folder in my home folder, and Vim loads all my plugins and settings properly.
On my Windows computer however, Vim WILL properly load settings from the .ggvimrc file in my home folder. But if I store plugins in "home.vim\plugin" Vim will NOT load them.
To get plugins/themes working on my Windows machine, I need to put them in "C:\Program Files (x86)\Vim\vimfiles\plugin"
I would like to be able to store everything in my "home.vim" folder on either machine, and have it work properly.
So is there any way to set this up on my Windows machine?
Thank you!
As long as you keep your .vimrc in a default location (cp. :help vimrc), and only want to change the path to plugins, syntax files, etc., you can put the following into your .vimrc file:
if has('win32') || has('win64')
set runtimepath=path/to/home.vim,$VIM/vimfiles,$VIMRUNTIME,$VIM/vimfiles/after,path/to/home.vim/after
endif
You didn't specify your exact path, so I used path/to/home.vim here; adapt to your system.
Your use case of synchronizing the configuration is quite common, what is unusual is that you seem to want to keep your .[g]vimrc in a default location, but only move the plugins etc. somewhere else. Typically, both .vimrc and the .vim/plugins subfolders are moved away, and people use symbolic links (created with mklink on Windows) to refer to them from their home directory.
Somewhere at the beginning of your .vimrc (inside a if has('win32') || has('win64') if your files have to run on other platforms)
set runtimepath-=~/vimfiles
set runtimepath^=~/.vim
set runtimepath-=~/vimfiles/after
set runtimepath+=~/.vim/after
On Windows 7, you must put your plugins and colorschemes in:
C:\Users\username\_vim\
and your settings in:
C:\Users\username\_vimrc
First I put the contents ~/vimfiles into ~/.vim.
Then I added this to my vimrc:
let &runtimepath.=',$HOME/.vim'
On Windows 10, the vim directory is located at %USERPROFILE\vimfiles, you may link it to any other directory through the mklink command.
On Windows I don't use %USERPROFILE% to store .vimrc, instead, I create an environment variable %HOME% pointing to my custom directory, and I have %HOME%/.vimrc and %HOME%/.vim/ there, using .vim/ makes sure the "vim" from Windows git installation can use them directly.
The Windows VIM has a default runtime path entry of ~/vimfiles, with ~ corresponds to %HOME%, so I create a directory symbolic link as follows:
cd /d %HOME%
mklink /j /d .vim vimfiles
Then all both the .vimrc and .vim/ in my custom directory are working in different environments, without if has("win32") stuff in your .vimrc for this purpose.
I was unable to implement either of your suggestions for some reason.
I ended up finally solving this by by creating softlinks to my Google Drive folder on all machine. Now if I edit my .vimrc or .vim folder in my Google Drive folder, it's reflected on all machines instantly. It's great!

Resources