miseleigh Posted January 17, 2008 Share Posted January 17, 2008 I've been trying to use the php_ssh2 module, and have been having trouble getting it to load. Through the live chat here someone linked me to a site that suggests that Apache simply doesn't like this module, and has a workaround for it, but he didn't go into much detail for the workaround. He says that the "php_ssh2 module WILL load from php CLI script", and so his workaround was to call a CLI script from his PHP code that loads the module. I've been trying to do this, but I must not be doing it right, cuz it's not working. This is how I'm doing it: On the webpage: exec('SSH/load_module.bat'); $connection = ssh2_connect($ip[0]); load_module.bat: /php5.0/php.exe -c /php5.0/phpcode/php.ini load_module.php and then load_module.php: <? dl('php_ssh2.dll'); ?> And then I get the error 'Call to undefined function ssh2_connect()'. So I don't really know what I'm doing when it comes to CLI stuff, and executing them from PHP, so any help would be awesome. Quote Link to comment https://forums.phpfreaks.com/topic/86498-solved-how-can-i-use-the-cli-to-load-a-module/ Share on other sites More sharing options...
trq Posted January 17, 2008 Share Posted January 17, 2008 Through the live chat here someone linked me to a site that suggests that Apache simply doesn't like this module If a module should'nt be loaded into mod_php it is usually mentioned in the manual, there is no mention of this in regard to ssh2. Anyways, what you have done will load the module into the cli. Exec runs in a completelt seperate process to mod_apache. You'll need to call your entire script, via exec. Quote Link to comment https://forums.phpfreaks.com/topic/86498-solved-how-can-i-use-the-cli-to-load-a-module/#findComment-442002 Share on other sites More sharing options...
miseleigh Posted January 17, 2008 Author Share Posted January 17, 2008 Well, I know the module should work, but it looks like the module isn't getting a function from one of the windows .dlls that it expects, and I just can't get it to load that way. ("Error: At least one module has an unresolved import due to a missing export function in an implicitly dependent module.") I might be able to fix that if I could figure out which module is causing the problem, but I haven't been able to. So back to this. You're saying that loading a module in through the CLI doesn't affect Apache at all, even if I run it through Apache, so I'll have to write my ssh functions as CLI scripts? Is there a way I can get the results back from those scripts that way? Quote Link to comment https://forums.phpfreaks.com/topic/86498-solved-how-can-i-use-the-cli-to-load-a-module/#findComment-442018 Share on other sites More sharing options...
miseleigh Posted January 17, 2008 Author Share Posted January 17, 2008 Well, nevermind, we finally got the ssh module loaded properly by copying a newer version of libeay32.dll into Apache2/bin. I hate .dll issues. So now all I have to do is figure out how to use the ssh functions Quote Link to comment https://forums.phpfreaks.com/topic/86498-solved-how-can-i-use-the-cli-to-load-a-module/#findComment-442122 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.