How does one go about implementing ssh2 in ExeOutput for windows. I use phpseclib 1.0.7 with php 5.6 on a Linux server. I would like to compile a small comm app for window to query the Linux system using ssh2. I can do this now Linux to Linux but I don’t know how I go about moving the functions to a Windows executable.
Download the PHP extension here: https://windows.php.net/downloads/pecl/releases/ssh2/1.1.2/php_ssh2-1.1.2-7.1-nts-vc14-x86.zip
Unzip php_ssh2.dll and place it into the “PHPRuntime7\ext” folder of ExeOutput.
Start a new project in ExeOutput, go to PHP Setting, choose PHP 7.1.
Then, in “PHP Extensions”, enable php_ssh2.dll.
The functions should now be recognized by your ExeOutput app.
I did as suggested above and this is what I get back:
PHP Warning: PHP Startup: Unable to load dynamic library ‘php_ssh2.dll’ (tried: C:\Users\donbar\PhpstormProjects\Compile\Data\ext\php_ssh2.dll (The specified module could not be found.), C:\Users\donbar\PhpstormProjects\Compile\Data\ext\php_php_ssh2.dll.dll (The specified module could not be found.)) in Unknown on line 0
The dll is there as well as in the ExeOutput ext folder.
I am obviously not understanding something here.
I have the php_ssh2.dll in the correct folder as was instructed in the first message and it is enabled in the extension list.
I continue to get the following error:
PHP Warning: PHP Startup: Unable to load dynamic library ‘php_ssh2.dll’ (tried: C:\Users\donbar\PhpstormProjects\Compile\ext\php_ssh2.dll (The specified module could not be found.), C:\Users\donbar\PhpstormProjects\Compile\ext\php_php_ssh2.dll.dll (The specified module could not be found.)) in Unknown on line 0
Why is it looking for the dll in C:\Users\donbar\PhpstormProjects\Compile\ext\
and
where does this come from: C:\Users\donbar\PhpstormProjects\Compile\ext\php_php_ssh2.dll.dll
I have the absolute path for virtual data set to C:\Users\donbar\PhpstormProjects\Compile\
I set up a completly new project with only one file to compile. I enable ssh2 in the php extensions (as I have done all along). I did not make any other changes. Then I compiled.
The following is the file list generated.
Adding PHP runtime components
Php extensions
o php_ssh2.dll compiled
php.ini
PHP ExeOutput extension
PHP opcache extension
ExeOutput internal extension
Notice that in your test a dependency is include: libeay32.dll. It is not in my list.
When I run the program I still get the same error:
PHP Warning: PHP Startup: Unable to load dynamic library ‘php_ssh2.dll’ (tried: C:\Users\donbar\Documents\Data\ext\php_ssh2.dll (The specified module could not be found.), C:\Users\donbar\Documents\Data\ext\php_php_ssh2.dll.dll (The specified module could not be found.)) in Unknown on line 0
Configuaration
php Version 5.6
php_ssh2.dll USED:compile into the EXE
No changes to the ini
Compile Result:
Adding PHP runtime components
Php extensions
o php_ssh2.dll compiled
o dependency libssh2.dll compiled
php.ini
PHP ExeOutput extension
PHP opcache extension
ExeOutput internal extension
Compilation Successful
ExeOutput has successfully built your application.
Path to Application File: C:\Users\donbar\Documents\InterfaceAPI.exe
File Size: 7.5 MiB, 7916725 byte(s).
Execution Results:
PHP Warning: PHP Startup: Unable to load dynamic library ‘C:\Users\donbar\Documents\Data\ext\php_ssh2.dll’ - The specified procedure could not be found.
My Question is still the same. Why is it trying to load the dll from ‘C:\Users\donbar\Documents\Data\ext’ ? If it is compiled into the executable why is it trying to load it at all?
It’s the error you made: you forgot to change to PHP 7.1. The extension indicated in the 1st post is for 7.1 and not 5.6. Otherwise, PHP won’t load it.