The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Php or Html code to execute PERL script
Hi All,
I asked a friend to program me a script, but he did the script in PERL, but he doesn't code online (ie php or html). Does anyone how to call a PERL script in VB via html or php code? I tried the PERL script via command prompt and it works (he gave instruction), but I've tried it so many ways in html/php code to execute the PERL script but it won't work. Thanks in advance.. Jay parts of the code are below. #!/usr/bin/perl use warnings; use strict; use URI; use Web::Scraper; use HTML::Entities; use List::MoreUtils 'first_index'; |
#3
|
|||
|
|||
1) Make sure the user php runs as has permission to execute the perl script.
2) Make sure safe_mode is OFF in PHP. 3) This should work in PHP.. Code:
exec("sudo perl /path/to/your/script.pl $variables $here"); |
Благодарность от: | ||
Max Taxable |
#4
|
|||
|
|||
Quote:
Cheers for the link! --------------- Added [DATE]1384237676[/DATE] at [TIME]1384237676[/TIME] --------------- Tried in HTML (or PHP) but both didn't work: lscgid: execve():/clientdata/apache-www/s/u/MYWEBSITEDOMAIN/www/cgi-bin/myscraper.pl: No such file or directory Any ideas? #!/usr/cgi-bin/perl -w # use warnings; use strict; use URI; use Web::Scraper; use HTML::Entities; use List::MoreUtils 'first_index'; |
#5
|
||||
|
||||
Well, the error message is quite plain: No such file or directory. Your path is wrong.
|
#6
|
|||
|
|||
Quote:
Sorry I'm a layman in terms of programming... |
#7
|
||||
|
||||
Well, we can't tell you what the correct path to your script on the server is. Try finding out via the pwd shell command (if you have shell access).
|
Благодарность от: | ||
Max Taxable |
#8
|
|||
|
|||
cgi-bin is almost never in the www directory. It's almost always one below that.
IE: /clientdata/apache-www/s/u/MYWEBSITEDOMAIN/cgi-bin/myscraper.pl Hence why safe_mode needs to be off in php.ini. |
Благодарность от: | ||
Max Taxable |
#9
|
|||
|
|||
Quote:
You can check here: http://supercoachscores.com/phpinfo.php This is so painful, but thank you everyone for the help. |
#10
|
||||
|
||||
Quote:
There's nothing you can do in Perl that can't be done better in PHP so I don't understand why your friend codes in PERL. Does he live in a cave or something? My reference to Hammurabi was trying to say just the above. Hammurabi's code? Never heard of it? |
Благодарность от: | ||
nhawk |
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|