![]() |
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'; |
That code is so old it might have come from Hammurabi. Are you one of the folks trying to fix the Obamacare website?
CGI. |
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"); |
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'; |
Well, the error message is quite plain: No such file or directory. Your path is wrong.
|
Quote:
Sorry I'm a layman in terms of programming... |
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).
|
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. |
Quote:
You can check here: http://supercoachscores.com/phpinfo.php This is so painful:mad::mad::mad:, but thank you everyone for the help. |
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? |
All times are GMT. The time now is 03:21 AM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|