Configure SSH Library |
Hi There,
I want to execute 'CLI' commands to my Linux Server over the SSH connection. Someone please help me to, step by step guide to Configure SSH Library and execute some commands. I am using Codelgniter2.x. Best Regards, TUSHAR NIRAS
Not sure what you mean, CI can use the CLI by executing "php -q /path/to/index.php controller method". Like "php -q /home/user/public_html/index.php blog view" to execute the blog controller/view method.
http://www.codeigniter.com/userguide2/general/cli.html Just remember that $_SERVER variables are set by the webserver, so if you are using CLI $_SERVER won't be present since it doesn't use the webserver and just executes php from the CLI. So if your app uses the $_SERVER superglobal, your app probably won't work via the CLI. Also things like sessions won't work using the CLI since there's no way to store and read cookies since there's no web browser involved.
(04-16-2015, 08:25 PM)CroNiX Wrote: Not sure what you mean, CI can use the CLI by executing "php -q /path/to/index.php controller method". Like "php -q /home/user/public_html/index.php blog view" to execute the blog controller/view method. Dear CroNix, I want to access linux server via SSH. and execute the commands from Web Application
To acess ssh you need: ssh host-or-ip@user-with-root-power. Then it ask a password.
ex.: ssh [email protected].
PHP is Life!!! See My Portfolio
(04-16-2015, 08:25 PM)CroNiX Wrote: Not sure what you mean, CI can use the CLI by executing "php -q /path/to/index.php controller method". Like "php -q /home/user/public_html/index.php blog view" to execute the blog controller/view method. Hi Cronix, Can I have SSH Library for CodeIgniter. I want to execute CLI commands on Linux machine using CodeIgniter.
(07-08-2015, 10:40 PM)tushar.niras Wrote:(04-16-2015, 08:25 PM)CroNiX Wrote: Not sure what you mean, CI can use the CLI by executing "php -q /path/to/index.php controller method". Like "php -q /home/user/public_html/index.php blog view" to execute the blog controller/view method. Have you tried this? http://phpseclib.sourceforge.net/ssh/examples.html |
Welcome Guest, Not a member yet? Register Sign In |