Answer the question
In order to leave comments, you need to log in
How to run php->ssh script in console?
The picture is as follows. There is a server on Ubuntu 15.04, it has the ssh2 library filed with php 5.6.4, which is used in the script. If you access this script through the browser, everything goes well, the request leaves, the answer comes, the output is displayed on the screen. But if you run it through the console as "$php script.php", the puff starts to swear:
PHP Fatal error: Call to undefined function ssh2_connect() in...
What is the problem, and what to twist to make it work?
Answer the question
In order to leave comments, you need to log in
For console php and web php different configs are used. Perhaps the ssh2 extension is not connected for the console php (/etc/php5/cli/php.ini)
You are using different php.ini configs
look at /etc/php5/php.ini include ssh2 library there.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question