I have been using XAMPP to work on personnal project using PHP. XAMPP used to work before when I first installed it but now there seems to be an issue that I can't seem to resolve. Here's what happens:
- I have aliases for my lampp commands and whenever I run it as a normal user, it asks me to be root.
- Then when I add sudo before the command to become root, it tells me there is no such command.
How can I solve this problem?
I believe you have answered your own question, as part of the question itself.
You write: "I have aliases for my lampp commands ...".
Aliases normally do not work when using
sudo
, which is explained in this Q&A.For aliases to work with sudo, you have to add the "hack":
alias sudo='sudo '
Secondly, if you look at the official FAQ for XAMPP, it's pretty clear that the command needed to run is:
sudo /opt/lampp/lampp start
.I reckon the issue here is that the executable is not in the
$PATH
as it normally would, so you basically have 3 options:/opt/lampp
to your$PATH
(and also forroot
for it to work withsudo
)sudo
/opt/lampp/lampp
as indicated in the FAQEither option should work out in the end.