Thread: Execution of Perl Scripts dirk
What's the best method of executing a
Perlscript fromPHP?I simply have to trigger a Perlscript when aPHPscript is executed.No passing of variables is required. I have testet virtual('/cgi-bin/test.cgi') which is normally working. But it's not running if there is a redirect in the PHPscript.perkiset
Hey Dirk -
exec(' perl/aDir/aFile.pl');will just run it, you'll be waiting while it gets done. Obviously, if you do a > /dev/null & at the end of that command then it will run in the background and return immediately. If you need the results from stdio of the PHPscript, then you should do $aVar = shellexec() which will both wait for the script and bring the results from stdio into the variable $aVar.Hope that does it, /p dirk
Hi Ed,
just tested it. It's working fine. Thanks! perkiset
No worries!
/p JasonD
Just in case you are using a varible to trigger the exec make sure you are VERY careful.
Nasty bastards can easily manipulate this with form fields containing information such as. ;exit;cat /etc/passwd; dirk
Yes, thanks.
That's generally a problem, for example also with SQL injections. Would be interesting to compare PerlwithPHPregarding the injections.perkiset
quote author=JasonD link=topic=256.msg1801#msg1801 date=1180345801 Just in case you are using a varible to trigger the exec make sure you are VERY careful. SSSssssshhhhhhh! C'mon man! Actually Dirk, the most effective way of doing this is running the exec() with a $var gathered from a GET parameter. Trust me on this one /p JasonD
It's not a
perlorphpissue but rather a badprogrammingissue using whatever language happens to float your boat.Perk, I'll keep schtum next time perkiset
<i>( Wonders if JD reads Perk's posts as the sarcastic horsecrap that they are... )</i>
JasonD
possibly
|
Thread Categories
Best of The Cache Home | ||
Search The Cache |
- Ajax
- Apache & mod_rewrite
- BlackHat SEO & Web Stuff
- C/++/#, Pascal etc.
- Database Stuff
- General & Non-Technical Discussion
- General programming, learning to code
- Javascript Discussions & Code
- Linux Related
- Mac, iPhone & OS-X Stuff
- Miscellaneous
- MS Windows Related
- PERL & Python Related
- PHP: Questions & Discussion
- PHP: Techniques, Classes & Examples
- Regular Expressions
- Uncategorized Threads