Support

UNiTE, Remote CLI, eXtract Wizard

#3793 Advice needed: what's the best way to run Remote CLI on a Windows 7 box?

Posted in ‘UNiTE and Remote CLI’
This is a public ticket

Everybody will be able to see its contents. Do not include usernames, passwords or any other sensitive information.

Environment Information

PHP version
n/a
Tool
UNiTE
Tool version
n/a

Latest post by nicholas on Friday, 07 October 2011 14:24 CDT

Neilz
I've been using Akeeba Remote Control to do automated backups of 7 sites I maintain. It worked fine under Windows 7, still does, but I'm getting a note that 4.0.9 is out, and when I try to download, it gives me an error.

SO, I'm looking at moving to Akeeba Remote CLI. Now, the question becomes, what's the best way to run it? I have PHP for Windows installed, but not being very knowledgeable about using PHP in a command line under Windows, when I try to run the connection test, I get an error 'could not open file'.

I've got remote.phar directly under the PHP directory, and the Windows path= shows that directory as being in it, so the file should be visible.

So ... advice would be appreciated.

Thanks,

Neil Z.

nicholas
Akeeba Staff
Manager
Hi Neil,

I had to read your post a few times to understand what's going on. Your problem is an assumption you made. You assumed that by placing the Remote CLI's Phar archive in the path you can access it from anywhere. This is not exactly the case in Windows.

Let's say that you have installed PHP in c:\Program Files\PHP and you placed remote.phar in that directory. Assuming that you have placed that directory in your PATH, in order to run Remote CLI, you need to type a command like
php.exe "c:\Program Files\PHP\remote.phar" options
where options is the list of command line switches you need to pass to Remote CLI. For example: [/code]php.exe "c:\Program Files\PHP\remote.phar" --action=test --host=http://www.example.com --secret=iloveakeeba[/code] to test the connection to the server.

If you have a firewall, you must also allow php.exe to be able to connect to the Internet. Most software firewalls have an "interactive mode". If you enable it, as soon as Remote CLI tries to connect to the remote server the firewall will prompt you if you want to allow connection to the Internet for php.exe. Just say yes.

Nicholas K. Dionysopoulos

Lead Developer and Director

πŸ‡¬πŸ‡·Greek: native πŸ‡¬πŸ‡§English: excellent πŸ‡«πŸ‡·French: basic β€’ πŸ• My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

Neilz
OK .. didn't realize that PHP may not pickup the Windows PATH information for use by a calling script.

I moved the remote.phar to its own directory and then proceeded to call it from there, here's what I get.
C:\Users\Neil>php "c:\remotecli\remote.phar" --action=test --host=http://www.xxxxxxxx.org --secret=xxxxxxxxx

Warning: require_once(phar://remote.phar/arccli_version.php): failed to open stream: phar error: invalid url or non-existent phar "phar://remote.phar/arccli_version.php" in phar://C:/RemoteCLI/remote.phar/remote.php on line 17

Fatal error: require_once(): Failed opening required 'phar://remote.phar/arccli_version.php' (include_path='phar://C:\RemoteCLI\remote.phar;.;C:\Program Files (x86)\PHP\pear') in phar://C:/RemoteCLI/remote.phar/remote.php on line 17


However, doing a CD to the RemoteCLI directory and running it, I get this:

C:\RemoteCLI>php c:\RemoteCLI\remote.phar --action=test --host=http://www.xxxxxxxx.org --secret=xxxxxxxxxx
Akeeba Remote Control CLI 1.1 (2011-08-16)
Copyright â					

nicholas
Akeeba Staff
Manager
Ah, yes, I forgot about that :s You have to be in the same directory on Windows, otherwise PHP can't figure out the relative paths inside the PHAR archive. Creating a bat file is probably the best approach and you can place it in your path to be able to execute it from anywhere :)

Nicholas K. Dionysopoulos

Lead Developer and Director

πŸ‡¬πŸ‡·Greek: native πŸ‡¬πŸ‡§English: excellent πŸ‡«πŸ‡·French: basic β€’ πŸ• My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

Support Information

Working hours: We are open Monday to Friday, 9am to 7pm Cyprus timezone (EET / EEST). Support is provided by the same developers writing the software, all of which live in Europe. You can still file tickets outside of our working hours, but we cannot respond to them until we're back at the office.

Support policy: We would like to kindly inform you that when using our support you have already agreed to the Support Policy which is part of our Terms of Service. Thank you for your understanding and for helping us help you!