The Siemens Community Catalyst program was co-created with our community to acknowledge technology leaders who consistently contribute to the Siemens Community. Nominations are accepted on a rolling basis.
I'm looking for a sample to execute PHP (Skripts) using "Execute Program". Current I get some error. Rapidminer can't find php. Please look at images.
Thanks,
Thomas
some add:
command: cmd /c start "D:\Wiedmann\Tools\php-5.6.13-Win32-VC11-x86" php -h
sems to be a little bit better. Is this the right way to do so?
may this
cmd /c start "php -f rapidminer.php"
but my php skript did'nt start. Maybe I get empty CMD console, but php did'nt run the script.
Seems difficult. Any comment?
Hi Thomas,
from my experience it is like this: If you can execute that script in your normal Windows cmd, then it should also be able to run from within RapidMiner.
Can you tell a little bit more of your setup? Which Windows version are you using? Is the path you posted your project or your php installation directory?
I would think that something like
C:\<php install path>\php <project path>\rapidminer.php
should work.
Cheers
Jan
Thanks Jan. Thats true, but my problem is, that PHP don't find the PIPE Data from "Write CSV".
1) Model Looks like attached image..
2) parameter from Execute Program looks like..
command: cmd /c start \Wiedmann\Tools\php-5.6.13-Win32-VC11-x86\rapidminer-start-php.bat
working directory: \Wiedmann\Tools\php-5.6.13-Win32-VC11-x86\
3) rapidminer-start-php.bat looks like
rem --- rapidminer-start-php.bat ---d:cd d:\wiedmann\tools\php-5.6.13-Win32-VC11-x86php rapidminer.php
4) rapidminer.php looks like..
<?php echo 'start php'; // $data = stream_get_contents(STDIN); $data = array(); // https://stackoverflow.com/questions/5891888/piping-data-into-command-line-php // TEST $fp = readfile("php://stdin"); echo 'start php-2'; while($f = fgets(STDIN)){ echo "line: $f"; $data[] = $f; } echo 'start php-3'; var_dump($data); sort($data); echo 'start php-4'; if (empty($data)) { $data = array ( 1, 2, 3 ); } echo 'start php-5'; fwrite(STDOUT, implode(';',$data)); echo 'start php-6';?>
Problem:
PHP get no piped information. PHP ist readin on STDIN and wait forever. My breakpoint after shows me this Box
PHP script is still waiting on echo "php-2" forever. PHP waits on console INPUT.
Big Question: Why "Write CSV" Data are not piped to "Execute Program" ?
EDIT
This for example work well and PHP get piped data from dir.
\Wiedmann\Tools\php-5.6.13-Win32-VC11-x86>dir | php rapidminer.php
Join us for a community conversation on how High-Performance Computing (HPC) and Simcenter PSIM work together to meet the increasing demands of modern power electronics simulation. During this one-hour technical session, you'll discover how leveraging HPC can speed up simulations, improve scalability, and empower engineers…
Join us for a community conversation on accelerating your motor simulation workflow with Simcenter Simlab. In this beginner-friendly session, we'll introduce the platform's automated model-building capabilities and show how easy it is to set up your first electric motor analysis. You'll see the basic steps of geometry…
Join us for a Community Conversation where we'll discuss practical approaches to analyzing complex electromagnetic models using hybrid solver techniques. This session will provide a general overview of how different computational methods can be combined within a single simulation to address models containing varied…