CentOS 6.7

PHP: How to run / execute a script in the background forever through SSH ?

You can execute a php script in the background forever by using SSH through PHP but for that you have to make sure first that SSH2 extension is available.

PHP DOCS: http://www.php.net/manual/en/function.ssh2-exec.php

If you want to do same thing through SSH Terminal (PuTTY) then follow this tutorial:
SSH: how to run a PHP script in background forever in Linux (CentOS) ? […]

CentOS: how to execute a php file with different php version than the php version of OS

To execute a php file with different php version than the version installed on the main php of your Server follow this:

You should know that where is that php version located so that you can add the path.

In my case I want to use PHP 7 that is installed in the plesk hosting panel folder so I’ll run following command:

 /opt/plesk/php/7.0/bin/php server.php

In […]