I created a PHP script, made it executable, added a path directive to PHP itself. The question remains how to make it so that I can call my program just by typing its name? That is, not through /path-to-script/my_script , but simply by entering the name my_script .

And yes, I would like to be able to run the program not only from under its user.

    2 answers 2

    Your script should be in one of the paths listed in the $ PATH variable.

      I usually throw symlink in sbin. It is done like this:

       ln -s /path-to-script/my_script /sbin/my_script