PHP7 and Python 3 by default in a ssh session

Currently reading
PHP7 and Python 3 by default in a ssh session

2
0
NAS
DS213+, RS820+
Operating system
  1. Linux
  2. macOS
  3. Windows
  4. other
Hello,
On my DS 213+ (DSM 6.2.4-25556), if I connect via ssh, I have a php 5.6 and a python 2.7:
$ php -v PHP 5.6.11 (cli) (built: Mar 4 2021 18:45:33) ... $ python --version Python 2.7.18

These software are in /bin :
$ which php /bin/php admin@EUGENE:~$ which python /bin/python

How to get by default under the shell in ssh a php version 7 and a python version 3 ?

Thanks for your help,
Sincerely.
--
Francis
 
Hi, welcome to the forum.

php and python are the first found in your shell's PATH variable. This is mine...

PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/syno/sbin:/usr/syno/bin:/usr/local/sbin:/usr/local/bin

You could setup a shell alias to interpret 'php' and 'python' as being executables in the installed PHP 7.x and Python packages. For example, php to /volume1/@appstore/PHP7.0/usr/local/bin/php70 .

It's not something I've done for years, but the file to do this after a reboot/new session would likely be ~/.profile or ~/.bash_aliases. Google will help.
 
Upvote 0
Thank's for you reply. That's I'll do.

Another way, more dangerous, will be to rename python and php programs in /bin directory (ie with .obsolete suffix) and add softlinks for python and php toward their respective up-to-date binaries in /volume1/@appstore/...

But it's strange to keep such old version as PHP5.6 and Python2.7 in the /bin directory of DSM 6.2.

Thank's again for your help to solve my problem.
 
Upvote 0

Create an account or login to comment

You must be a member in order to leave a comment

Create account

Create an account on our community. It's easy!

Log in

Already have an account? Log in here.

Welcome to SynoForum.com!

SynoForum.com is an unofficial Synology forum for NAS owners and enthusiasts.

Registration is free, easy and fast!

Trending threads

Back
Top