Jump to content

Run PHP code with Autoit?


Recommended Posts

PHP.exe is part of the PHP archive you have to install (or just unpack). (PHP files need the PHP interpreter, like au3 files with AutoIt)

To get the result, you can redirect the output in a file (php test.php > result.txt) or use an AutoIt function like StdoutRead()

Link to comment
Share on other sites

I tried application called "bamcompile" which can convert PHP file into exe file but when I try to compile my php script then I got error:

"Fatal error: Cannot instantiate non-existent class:  soapclient"
error line: $client = new SoapClient($wsdl);

any chance to install that missing class "soapclient" ??

Link to comment
Share on other sites

I tried application called "bamcompile" which can convert PHP file into exe file but when I try to compile my php script then I got error:

any chance to install that missing class "soapclient" ??

How old is your version of PHP? You might try using PEAR to install SOAP, it not loaded. Also if you're using the PHP CLI, which it looks like, it might not have SOAP loaded as it uses a different PHP.ini file than the regular PHP code uses. 

EndFuncAutoIt is the shiznit. I love it.
Link to comment
Share on other sites

I didn't install anything regarding php except that tool called "bamcompile". Please advise me what to install and where to get it from.

I never said you installed anything. I was just giving you suggestions of what to try and look for. If it doesn't see the class, then it either needs the library or probably just needs to be enabled. 

Here http://bit.ly/1wsx2LI :)

EndFuncAutoIt is the shiznit. I love it.
Link to comment
Share on other sites

I just had to install php package from this website:

http://windows.php.net/download/

then I extracted zip archive, configure php.ini file and unquote line extension=php_soap.dll and now it works ! amazing !

I am just curious how to place output "paramter: paramter-test" into variable in autoit

php_out.png

any idea?

trying this:

$iPID = Run("C:\php\php.exe script.php parameter-test")
$sOutput = StdoutRead($iPID)
msgbox(0, "", $sOutput)

$iPID return 0

$sOutput return null

Edited by maniootek
Link to comment
Share on other sites

Show php code.

<?php
echo 'parameter: ' . $argv[1];
?>

FIXED:

#include <Constants.au3>
$iPID = Run('C:\php\php.exe script.php parameter-test', "C:\php\" , "", $STDOUT_CHILD)
ProcessWaitClose($iPID)
$sOutput = StdoutRead($iPID)
msgbox(0, "", $sOutput)
Edited by maniootek
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...