Sign in to follow this  
Followers 0
maniootek

Run PHP code with Autoit?

12 posts in this topic

I am just wondering if it's possible to run some code written in php and get same results with Autoit without installing software like apache. Any idea?

Share this post


Link to post
Share on other sites



#3 ·  Posted (edited)

ok thanks, but where do I find that php.exe file and how will I get the return values?

Edited by maniootek

Share this post


Link to post
Share on other sites

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()

Share this post


Link to post
Share on other sites

thank you, i will try it and will come back with results

Share this post


Link to post
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" ??

Share this post


Link to post
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.

Share this post


Link to post
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.

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

#10 ·  Posted (edited)

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

Share this post


Link to post
Share on other sites

#12 ·  Posted (edited)

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

Share this post


Link to post
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
Sign in to follow this  
Followers 0