LiteSpeed Technologies
Download Download     Blog Blog     Wiki Wiki     Forum Forum     Store     Contact Contact    

Go Back   LiteSpeed Support Forums > External Applications > CGI/Perl/Python > Trying to get perl/cgi application to run that uses CGI::Fast

Reply
 
Thread Tools Display Modes
  #1  
Old 07-03-2012, 10:30 AM
hdee hdee is offline
New Member
 
Join Date: Jul 2012
Posts: 5
Default Trying to get perl/cgi application to run that uses CGI::Fast

I'm having the hardest time figuring this out.

At this point I'm trying to get it to just work with anything.

I've tried setting up lsperl, tried setting up an ext app config for perl (since I'm able to run the script find with perl from command line), also tried using cgi daemon. The furthest I've got with getting litespeed to run this is with the cgi daemon. I'm stuck at this error message though:

DBI connect('COMMERCEDB.DTISERV2.COM','dti_join',...) failed: ERROR OCIEnvNlsCreate. Check ORACLE_HOME (Linux) env var or PATH (Windows) and or NLS settings, permissions, etc. at /usr/local/dti/lib/DBConnect.pm line 101

I'm explicitly set in the code the environment variables it's looking for. What ever is happening is not being written in the logs.

Sorry if my explanation is confusing, let me know if you need anymore info.

I would like to set this up with lsperl but at this point I'd like to see something just work with cgi daemon.
Reply With Quote
  #2  
Old 07-03-2012, 06:32 PM
NiteWave NiteWave is online now
LiteSpeed Staff
 
Join Date: Sep 2009
Posts: 2,218
please refer our demo site:
http://www.litespeedtech.com/litespeed-live-demos.html
you can login the admin console with admin/admindemo

there is Perl 5.8.5: Ybb 2 Forum to use lsperl:
http://demo.litespeedtech.com/perl/
Reply With Quote
  #3  
Old 07-12-2012, 07:38 AM
hdee hdee is offline
New Member
 
Join Date: Jul 2012
Posts: 5
Quote:
Originally Posted by NiteWave View Post
please refer our demo site:
http://www.litespeedtech.com/litespeed-live-demos.html
you can login the admin console with admin/admindemo

there is Perl 5.8.5: Ybb 2 Forum to use lsperl:
http://demo.litespeedtech.com/perl/
The perl demo page doesn't work. Could you fix it?
Reply With Quote
  #4  
Old 07-12-2012, 05:53 PM
NiteWave NiteWave is online now
LiteSpeed Staff
 
Join Date: Sep 2009
Posts: 2,218
I restarted lsws on demo, that fixed it.

actually, you can do it too --- anyone can play with the admin console of the demo.
Reply With Quote
  #5  
Old 07-16-2012, 07:20 AM
hdee hdee is offline
New Member
 
Join Date: Jul 2012
Posts: 5
Hi NiteWave,

I found the admin console and was checking out settings for perl. I had set everything up on my end exactly the same as the admin console but it didn't work. lsperl won't recognize my fcgi files as perl scripts. I can get everything to run using a cgi daemon (not ideal of course) but I run into the error I posted originally even though the paths it's looking for is set.

I didn't know where to go from here because I've looked at all the documentation litespeed already provides and can't get any direction from error logs.

Is there any known problem with running perl programs with lsperl that already use CGI::Fast or FCGI?
Reply With Quote
  #6  
Old 07-16-2012, 08:09 AM
hdee hdee is offline
New Member
 
Join Date: Jul 2012
Posts: 5
I have some more to add actually.

At my company we're trying to migrate from zeus web server to litespeed. I'm working on converting a perl cgi application currently. With zeus everything runs fine. When I run the perl cgi from command line it's also able to run properly.

The only error info I was able to get was this:


[Mon Jul 16 15:02:25 2012] lsperld.fpl: Missing right curly or square bracket at (eval 2) line 5024, at end of line
[Mon Jul 16 15:02:25 2012] lsperld.fpl: syntax error at (eval 2) line 5024, at EOF

After viewing lsperld I noticed it opened whatever script it is going to run and reads in the code then executes it. Does this mean lsperl is not reading in the script it's about to run properly? There is a lot of japanese characters in these scripts, could that affect anything?
Reply With Quote
  #7  
Old 07-16-2012, 08:29 AM
NiteWave NiteWave is online now
LiteSpeed Staff
 
Join Date: Sep 2009
Posts: 2,218
ok, is it possible you send us a sample perl code, and let's experiment on our lab?
Reply With Quote
  #8  
Old 07-17-2012, 07:53 AM
hdee hdee is offline
New Member
 
Join Date: Jul 2012
Posts: 5
Hi NiteWave,

Thanks for working with me on this. I can't send you sample code for this because this perl cgi application is complex and private. I have more information to give though, perhaps you can guide me to the right answer or explain more indepth on lsperld.



lsperld.fpl
-------------
my $__sub = <FH>;
close FH;

$__package = valid_package_name($__filename);
#wrap the code into a subroutine inside our unique package
my $__eval = qq{package $__package; use subs qw(exit); sub exit { } sub handler { local \$0='$__filename'; $__sub; }};
{
# hide our variables within this block
my($__filename,$__mtime,$__package,$__sub);
print $__eval;
eval $__eval;
}
-------------


------end of $__eval output------
} # }}}

1;
__END__ <-- end of script


; } <--- this part is inserted by lsperld.fps

[Tue Jul 17 14:44:11 2012] lsperld.fpl: Missing right curly or square bracket at (eval 2) line 5034, at end of line
[Tue Jul 17 14:44:11 2012] lsperld.fpl: syntax error at (eval 2) line 5034, at EOF
Status: 500
Content-type: text/plain

ERROR: '/data/httpsd/join_20120604_emerchantpay/cgi-bin/newjoin.fcgi' is not a valid Perl script!

----------------------------------

The error message here doesn't make sense since the actual perl cgi file has no syntax errors. After poking around I noticed when I delete __END__ from the end of the perl cgi then lsperld doesn't spit any errors out when I run from the command line. What happens now though is when I run the perl cgi through my browser it gets a broken pipe and doesn't actually process the perl cgi code. It spits out half of the script to the browser then the process times out after a while.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 05:49 PM.



- Archive - Top
© Copyright 2003-2011 LiteSpeed Technologies, Inc. All rights reserved. Privacy Policy.