Perl in Yii

Hi, i want to have a php call to perl script.

example:($out=shell_exec("$perl")). is my perl file. How can i do that in yii framework. can anyone help me please??

You can do it like in your example. Any problems with it?


Its now working…

I have created a controller named login, and inside this i am having both "" and "sample.php".




echo "$storage";


print("Hello world!!");

when i place this code inside sample.php, simply its showing the output as "Array" instead of "Hello World"… its not executing the Perl script actually… what i have to do for executing the Perl script.

(I have installed Yii inside Wamp(\wamp\ WWW\Yii) and i have installed Perl inside(\wamp\bin\ Perl).

Is the procedure correct? r else if i did any mistakes please specify…

$storage=explode("\n",$out); give you array. You can not just echo it. Try:



foreach($parts as $part)

    echo $part;

And, there is no need in sample.php, you can add this code in controller action directly.


Now i am able to execute a perl script inside Yii framework.

Mistake that i made was

Initially i have given as


i have changed it to

$out=shell_exec("$perl \wamp\www\myYii\protected\views\login\");

I have to specify the absolute path.