|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| ||||||||||||||||||||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Help with an error message
If this is the wrong place to post this I am sorry but I have not been able to find a good forum on cgi. If this is not the right forum please direct me to the right place.
Well here goes: I am setting up a Traffic Exchange script. It is a good script I have had it up and running before. With no errors. I have decided to reinstall the script but when I try to run the script to setup the db I keep getting an error. I can program but I did not write this one. The path is correct I checked with the ISP My path to purl: #!/usr/local/bin/perl My call is: require "home/snickers123/profitx2.com/420/iConfig.pm"; The error message: Can't locate home/snickers123/profitx2.com/420/iConfig.pm (This is the part I do not understand) in @INC (@INC contains: /etc/perl /usr/local/lib/perl/5.8.8 /usr/local/share/perl/5.8.8 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.8 /usr/share/perl/5.8 /usr/local/lib/site_perl .) at inst_mysql.cgi line 41. Thank you for any help you can give me.Snickers123 (Len) |
|
#2
|
|||
|
|||
|
Your require statement is using a relative path. You should change it to an absolute path.
Code:
require "/home/snickers123/profitx2.com/420/iConfig.pm"; Here's another option which is generally considered better. Code:
use lib '/home/snickers123/profitx2.com/420'; use iConfig; |
|
#3
|
|||
|
|||
|
Tried it
Thank you very much for your help. Tried both the absolute path and the other it made no difference I get the same error
|
|
#4
|
|||
|
|||
|
Next step is to verify that the path you're using is correct and make sure the permissions on each directory within that path are set correctly to allow the web server user account access.
|
|
#5
|
|||
|
|||
|
Quote:
Hi! Looks like the path is fine, since I can load and see the file from here. A caution about security: Your modules should NOT be accessable from the outside! If the webserver allows it, move the modules to /home/snickers123/lib/ and add that to the script as such: When you've moved it, change your MySQL password, as a bunch of people have probably already seen it, including the all-seeing eye (GoogleBot). |
|
#6
|
|||
|
|||
|
The path is right
I checked the path with the ISP and it is correct.
The permissions are set as follows. The cgi-bin folder and all it's sub-directories and all .cgi files are set to 755. The data dir. is named 420 and is set at 777 along with all its files. This has really got me stumped. I really do thank you for all your help. Snickers123 (Len) |
|
#7
|
|||
|
|||
|
Please give me a hint
If the path works for you please can you give me any hint why it is not working for me?
Thank you for your tips. I already deleted the data base and will set the data file up in the root. Snickers123 (Len) |
|
#8
|
|||
|
|||
|
|
|
#9
|
|||
|
|||
|
Error Message
Code:
#!/usr/local/bin/perl Line 1 use CGI::Carp qw(fatalsToBrowser); Line39 require "use lib '/home/snickers123/420'"; Lline 40 use iConfig; Line 41 require "use lib '/home/snickers123/420'"; Line 42 use iSubs; Line 43 Error: Can't locate iConfig.pm in @INC (@INC contains: /etc/perl /usr/local/lib/perl/5.8.8 /usr/local/share/perl/5.8.8 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.8 /usr/share/perl/5.8 /usr/local/lib/site_perl .) at inst_mysql.cgi line 41. BEGIN failed--compilation aborted at inst_mysql.cgi line 41. Snickers123 |
|
#10
|
|||
|
|||
|
Quote:
Aha, I've spotted the misunderstanding. not Code:
require "use lib '/home/snickers123/420'"; but just Code:
use lib '/home/snickers123/420'; Compare use to require in perldoc. I strongly encourage you to use "use". Last edited by Demmy : October 21st, 2009 at 04:31 AM. Reason: I really should use the spellchecker >.< |
|
#11
|
|||
|
|||
|
Quote:
Is this the right syntax for a required file: use lib '/home/snickers123/420'; use html_head.inc; This script was written back in 2002. Is it to old to run on todays servers. Old script, out of date syntex. Snickers123 |
|
#12
|
|||
|
|||
|
Quote:
That's close. Try this: Code:
use lib '/home/snickers123/420'; use 'html_head.inc'; or this (since html_head.inc is not a true module/package): Code:
use lib '/home/snickers123/420'; require 'html_head.inc'; |
|
#13
|
|||
|
|||
|
Quote:
From what I saw when I was snooping around in there, html_head.inc isn't Perl code, but HTML. Am I wrong? |
|
#14
|
|||
|
|||
|
The script is running great now.
Thank You Very,Very Much ![]() It seems to be working fine now. The last require did the trick. I really can not thank you enough for taking the time. The problem was just in the calls. Now I have my work cut out for me. I need to go through the entire script and find all the calls. Have a really great day Snickers123 |
|
#15
|
|||
|
|||
|
Quote:
Excellent, congrats! I've often found that completely rewriting stuff with the legacy code as a guide is faster and less frustrating, but if you're only just starting out with Perl that's probably not the case for you. You could grep through the file for "sub", I guess? Anyway, best of luck to you! |
![]() |
| Viewing: Dev Shed Forums > Programming Languages > Perl Programming > Help with an error message |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|