0

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?

Thanks, enter image description here

Harpartap S C
  • 483
  • 4
  • 14

1 Answers1

0

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:

  1. Add /opt/lampp to your $PATH (and also for root for it to work with sudo)
  2. Make your aliases work under sudo
  3. Use the full path /opt/lampp/lampp as indicated in the FAQ

Either option should work out in the end.

Artur Meinild
  • 26,018