0

I was struggling with apache2 already installed in ubuntu so I decided to return back to lampp..I have unistalled apache 2 mysql server and phpmyadmin. The problem is that when I type sudo which php I get nothing...

So I cannot request e.g. sudo composer create-project laravel/laravel.....

since php is missing for root user..

Although when I type which php I get /opt/lampp/bin/php..

Is it possible to make the root user use the same path..?

John K.
  • 55
  • 1
  • 2
  • 4
  • Generally, it's better not to use the root user whenever you can. Is there a chance you can install laravel as a regular user and drop sudo completely? – Shomz Jan 05 '14 at 01:01
  • Possible duplicate of [Why does sudo change the PATH?](https://stackoverflow.com/q/257616/608639) – jww May 30 '19 at 04:11

1 Answers1

1

You can do this:

Switch to root user

sudo su -

Edit the .bashrc

vi ~/.bashrc

And add a new path to the current one:

export PATH=$PATH:/opt/lampp/bin
Antonio Carlos Ribeiro
  • 86,191
  • 22
  • 213
  • 204