How to link to php from xampp installation so i can just use php command instead of full path?

23,476

Have you tried symlinking the php binary from /usr/bin?

Assume your XAMPP installation is in default location /opt/lampp

This is the command to achieve that (in your case):

sudo ln -s /opt/lampp/bin/php /usr/bin/php
Share:
23,476

Related videos on Youtube

lonerunner
Author by

lonerunner

I am Freelance Web Designer and Server Administrator with passion in Photography. My main area of expertise is web development and design. I love making cool stuff on the web, and mainly i work with WordPress and Joomla cms. I am experienced in customizing and developing WordPress driven websites. As a Server Administrator over past years i have built and setup various web servers from shared hosting solutions to dedicated servers for audio and video streaming, gaming servers, and web servers. I also love photography and in my free time i always take my camera out trying to snatch few cool photos. I also do product shots for catalogs, flyers, websites, etc...

Updated on September 18, 2022

Comments

  • lonerunner
    lonerunner over 1 year

    I have xubuntu installation and xampp installed on my pc, and everything works great, but lately i am experimenting a little bit with laravel framework and a lot of tutorials and people just use php command in terminal, but for me to work i have to load a full path like

    /opt/lampp/bin/php
    

    and the file in bin/php links to proper php version.

    That works but i would like to speed up a proccess a bit and to use just php as everyone else use and it's much simpler than to use full path.

    So my question is how to set a path so i can use just php in my terminal.

    I have read a couple tutorials and there are suggests of setting a path in ~/.bashrc

    Or to use export

    But none of them works for me.

    Any suggestions?

  • Attila Naghi
    Attila Naghi about 6 years
    I am getting this: ln: failed to create symbolic link '/usr/bin/php': File exists
  • Goba
    Goba about 6 years
    @Chester remove the file and link again : sudo rm /usr/bin/php then ln -s /opt/lampp/bin/php /usr/bin/php again