Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
I have half a dozen scripts that make up a shopping cart system. The main script calls subroutine scripts using a Require function (e.g. require "config.cgi";).

I've developed the system on a Linux server and now I've leased website space with www.omnis.com to begin final testing and production. The Omnis server is also running with Linux.

The problem: The scripts won't run on the Omnis.com server. When I try to call the system I get the dreaded 500 Internal Server Error message. To say that the Omnis technical people have been less than helpful would be a gross understatement. They loaded a three line script into my cgi-bin and ran it, reporting that the system works and that's the most they can do. They say that debugging code isn't their responsibility. I never asked them to debug the script, and they completely ignored my request for information about error messages on the server logs.

Using a script called AdminPro, I've learned that the main script is failing when it reaches the Require function that calls the configuration subroutine. That occurs at the very start of the script. The error message says:

Can't locate config.cgi in @INC (@INC contains: /etc/perl /usr/lib/perl5/site_perl/5.8.4/i686-linux /usr/lib/perl5/site_perl/5.8.4 /usr/lib/perl5/site_perl /usr/lib/perl5/vendor_perl/5.8.4/i686-linux /usr/lib/perl5/vendor_perl/5.8.4 /usr/lib/perl5/vendor_perl /usr/lib/perl5/5.8.4/i686-linux /usr/lib/perl5/5.8.4 /usr/local/lib/site_perl .) line 12.

From experience I know that this message usually pops up when there's a problem with the subroutine script, but these scripts are all working perfectly on the testing server. The permissions on the new server are correct, the scripts all pass Omnis Perl checker for correct syntax, and I uploaded them correctly.

I thought that scripts within the same file directory were automatically loaded into the @INC array but I guess that I was wrong. And on the possibility that relative addressing isn't working, I changed the Require function to reflect the full path. No difference.

My questions:

1) Is the @INC array unique to each website, or is it a common array used by all websites on that server?

2) Is it possible that the server is set not to allow the use of the Require function that so people can't contaminate the @INC array with special mods?

3) Is there a way to force the loading into the @INC array?

I'll be grateful for any suggestions since the people at Omnis.com won't provide any help at all.

Thanx in advance for any help you can provide.


In reply to Require a script not found in @INC array by TJD

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (5)
As of 2024-04-23 18:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found