vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=252)
-   -   Php or Html code to execute PERL script (https://vborg.vbsupport.ru/showthread.php?t=304398)

Impromptu 11-11-2013 11:44 AM

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';

Max Taxable 11-11-2013 12:37 PM

That code is so old it might have come from Hammurabi. Are you one of the folks trying to fix the Obamacare website?

CGI.

nhawk 11-11-2013 07:56 PM

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");

Impromptu 11-12-2013 03:30 AM

Quote:

Originally Posted by Max Taxable (Post 2459911)
That code is so old it might have come from Hammurabi. Are you one of the folks trying to fix the Obamacare website?

CGI.

Not sure what Hammurabi means TBH. I assume Obama Care is some charity organised by the US President, but no I'd be the last person trying to fix any website. As per my post, I don't know how to program (far from it) and asked someone to help me.

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';

cellarius 11-12-2013 08:15 AM

Well, the error message is quite plain: No such file or directory. Your path is wrong.

Impromptu 11-12-2013 09:04 AM

Quote:

Originally Posted by cellarius (Post 2460092)
Well, the error message is quite plain: No such file or directory. Your path is wrong.

Hahaha I know that, but how do I change it...

Sorry I'm a layman in terms of programming...

cellarius 11-12-2013 09:29 AM

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).

nhawk 11-12-2013 11:02 AM

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.

Impromptu 11-12-2013 07:17 PM

Quote:

Originally Posted by nhawk (Post 2460107)
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.

My webhosting company has confirmed it is not in SAFE MODE.

You can check here: http://supercoachscores.com/phpinfo.php

This is so painful:mad::mad::mad:, but thank you everyone for the help.

Max Taxable 11-12-2013 10:09 PM

Quote:

Originally Posted by Impromptu (Post 2460188)
My webhosting company has confirmed it is not in SAFE MODE.

You can check here: http://supercoachscores.com/phpinfo.php

This is so painful:mad::mad::mad:, but thank you everyone for the help.

As I joked earlier - you are working with byzantine code- PERL, which went into the bin of technological obsolescence along with floppy disks and audio cassette tapes. This is the 21st Century, Mack and there's no reason I can think of, to call a Perl script.

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
  • Page Generation 0.01169 seconds
  • Memory Usage 1,739KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code_printable
  • (4)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete