Executing Perl Script with PHP
Is there any way to run/execute a perl.pl file with PHP (other than HTML
FORM)? I've tried using include & require but it only prints the raw
source of the perl file. Thanks for any help anyone can provide.
Re: Executing Perl Script with PHP
wombat wrote:
> Is there any way to run/execute a perl.pl file with PHP (other than HTML
> FORM)? I've tried using include & require but it only prints the raw
> source of the perl file. Thanks for any help anyone can provide.
I got all these with the first search on google using this search query:
http://www.google.com/search?hl=en&client=firefox-a&rls=org. mozilla%3Aen-US%3Aofficial&hs=ubZ&q=php+execute+perl+script& btnG=Search
Don't know if these will work but I got these from the search above
check these out:
http://us.php.net/function.exec
http://us.php.net/function.shell_exec
http://www.wellho.net/mouth/493_Running-a-Perl-script-within -a-PHP-page.html
To execute perl scripts from inside PHP-scripted pages, use the
following code:
<?php virtual ("../path/to/script.cgi"); ?>
Re: Executing Perl Script with PHP
In article <kpmdnV4xP94xFTfbnZ2dnUVZ_sytnZ2d [at] wavecable.com>,
zach <wackzingo [at] gmail.com> wrote:
> wombat wrote:
> > Is there any way to run/execute a perl.pl file with PHP (other than HTML
> > FORM)? I've tried using include & require but it only prints the raw
> > source of the perl file. Thanks for any help anyone can provide.
>
> I got all these with the first search on google using this search query:
> http://www.google.com/search?hl=en&client=firefox-a&rls=org. mozilla%3Aen-US%3A
> official&hs=ubZ&q=php+execute+perl+script&btnG=Search
>
>
>
>
>
> Don't know if these will work but I got these from the search above
> check these out:
>
> http://us.php.net/function.exec
> http://us.php.net/function.shell_exec
> http://www.wellho.net/mouth/493_Running-a-Perl-script-within -a-PHP-page.html
>
>
>
> To execute perl scripts from inside PHP-scripted pages, use the
> following code:
>
> <?php virtual ("../path/to/script.cgi"); ?>
Yea saw all that with my own surfing. Nothing seems to work. That's why
I decided to poke around here and see if anybody could help.
Re: Executing Perl Script with PHP
wombat wrote:
> In article <kpmdnV4xP94xFTfbnZ2dnUVZ_sytnZ2d [at] wavecable.com>,
> zach <wackzingo [at] gmail.com> wrote:
>
>> wombat wrote:
>>> Is there any way to run/execute a perl.pl file with PHP (other than HTML
>>> FORM)? I've tried using include & require but it only prints the raw
>>> source of the perl file. Thanks for any help anyone can provide.
>> I got all these with the first search on google using this search query:
>> http://www.google.com/search?hl=en&client=firefox-a&rls=org. mozilla%3Aen-US%3A
>> official&hs=ubZ&q=php+execute+perl+script&btnG=Search
>>
>>
>>
>>
>>
>> Don't know if these will work but I got these from the search above
>> check these out:
>>
>> http://us.php.net/function.exec
>> http://us.php.net/function.shell_exec
>> http://www.wellho.net/mouth/493_Running-a-Perl-script-within -a-PHP-page.html
>>
>>
>>
>> To execute perl scripts from inside PHP-scripted pages, use the
>> following code:
>>
>> <?php virtual ("../path/to/script.cgi"); ?>
>
> Yea saw all that with my own surfing. Nothing seems to work. That's why
> I decided to poke around here and see if anybody could help.
What are you talking about, exec command works just fine.
Hendri Kurniawan
Re: Executing Perl Script with PHP
wombat wrote:
> In article <kpmdnV4xP94xFTfbnZ2dnUVZ_sytnZ2d [at] wavecable.com>,
>> http://us.php.net/function.exec
>> http://us.php.net/function.shell_exec
>> http://www.wellho.net/mouth/493_Running-a-Perl-script-within -a-PHP-page.html
>>
>>
>>
>> To execute perl scripts from inside PHP-scripted pages, use the
>> following code:
>>
>> <?php virtual ("../path/to/script.cgi"); ?>
>
> Yea saw all that with my own surfing. Nothing seems to work. That's why
> I decided to poke around here and see if anybody could help.
virtual requires that you use apache and configured to execute perl scripts.
exec/shell_exec can always be used to tell the perl binary to execute script.
If you use exec/shell_exec and it don't still not work, then it's most likely
not a perl script.
--
//Aho
Re: Executing Perl Script with PHP
In article <13alll4ejdo2je2 [at] corp.supernews.com>,
Hendri Kurniawan <hckurniawan [at] gmail.com> wrote:
> wombat wrote:
> > In article <kpmdnV4xP94xFTfbnZ2dnUVZ_sytnZ2d [at] wavecable.com>,
> > zach <wackzingo [at] gmail.com> wrote:
> >
> >> wombat wrote:
> >>> Is there any way to run/execute a perl.pl file with PHP (other than HTML
> >>> FORM)? I've tried using include & require but it only prints the raw
> >>> source of the perl file. Thanks for any help anyone can provide.
> >> I got all these with the first search on google using this search query:
> >> http://www.google.com/search?hl=en&client=firefox-a&rls=org. mozilla%3Aen-US
> >> %3A
> >> official&hs=ubZ&q=php+execute+perl+script&btnG=Search
> >>
> >>
> >>
> >>
> >>
> >> Don't know if these will work but I got these from the search above
> >> check these out:
> >>
> >> http://us.php.net/function.exec
> >> http://us.php.net/function.shell_exec
> >> http://www.wellho.net/mouth/493_Running-a-Perl-script-within -a-PHP-page.htm
> >> l
> >>
> >>
> >>
> >> To execute perl scripts from inside PHP-scripted pages, use the
> >> following code:
> >>
> >> <?php virtual ("../path/to/script.cgi"); ?>
> >
> > Yea saw all that with my own surfing. Nothing seems to work. That's why
> > I decided to poke around here and see if anybody could help.
>
> What are you talking about, exec command works just fine.
>
> Hendri Kurniawan
Actually exec did work but I went and changed code and it ceased to work
so I'll figure that out. However, what exec did was run the code only
and nothing else from the page that executed the per script.
In other words I was hoping for index.php (which has it's own content)
to run a snippet perl script and then return and finish the rest of
index.php. I know it can be done using include calling a small php file
from the main php file but wanted to know if the same can be done
calling a perl file (which displays a list from a database).
Re: Executing Perl Script with PHP
wombat wrote:
> In article <13alll4ejdo2je2 [at] corp.supernews.com>,
> Hendri Kurniawan <hckurniawan [at] gmail.com> wrote:
>
>> wombat wrote:
>>> In article <kpmdnV4xP94xFTfbnZ2dnUVZ_sytnZ2d [at] wavecable.com>,
>>> zach <wackzingo [at] gmail.com> wrote:
>>>
>>>> wombat wrote:
>>>>> Is there any way to run/execute a perl.pl file with PHP (other than HTML
>>>>> FORM)? I've tried using include & require but it only prints the raw
>>>>> source of the perl file. Thanks for any help anyone can provide.
>>>> I got all these with the first search on google using this search query:
>>>> http://www.google.com/search?hl=en&client=firefox-a&rls=org. mozilla%3Aen-US
>>>> %3A
>>>> official&hs=ubZ&q=php+execute+perl+script&btnG=Search
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> Don't know if these will work but I got these from the search above
>>>> check these out:
>>>>
>>>> http://us.php.net/function.exec
>>>> http://us.php.net/function.shell_exec
>>>> http://www.wellho.net/mouth/493_Running-a-Perl-script-within -a-PHP-page.htm
>>>> l
>>>>
>>>>
>>>>
>>>> To execute perl scripts from inside PHP-scripted pages, use the
>>>> following code:
>>>>
>>>> <?php virtual ("../path/to/script.cgi"); ?>
>>> Yea saw all that with my own surfing. Nothing seems to work. That's why
>>> I decided to poke around here and see if anybody could help.
>> What are you talking about, exec command works just fine.
>>
>> Hendri Kurniawan
>
> Actually exec did work but I went and changed code and it ceased to work
> so I'll figure that out. However, what exec did was run the code only
> and nothing else from the page that executed the per script.
>
> In other words I was hoping for index.php (which has it's own content)
> to run a snippet perl script and then return and finish the rest of
> index.php. I know it can be done using include calling a small php file
> from the main php file but wanted to know if the same can be done
> calling a perl file (which displays a list from a database).
I've never tried anything like what you want, but from the problems your
having something I would use the exec in a file that will be included
into the index file. This way the index calls the include file, the
include when called executes the exec command while being included into
the index.