You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Omer Shenker <ma...@omershenker.net> on 2003/06/03 16:56:17 UTC

[users@httpd] Re: problem with perl-scripts

On 03 June 2003 at 09:34 Jamie.Kerwick@benenden.org.uk wrote:
> #!c:\perl\bin\perl.exe
> 
> Require "c:\collect\run\lib\perl\header.pl";
> ...........
> 
> 
> As the error says it can't find 
> /collect/run/lib/perl/header/pl, so you may
> need to give it the full path as above (substituting c:\ for 
> the drive on
> which it is located).

Actually, on Perl on Windows handles paths with forward slashes correctly.
In fact, so does the Win32 API: it's only some of the user-level programs
that hide that. Assuming everything is running on C:, there shouldn't even
need to be a drive specified.

Try
require 'c:/collect/run/lib/perl/header.pl';
and if that doesn't work, check that the user Apache is running as has read
permissions to that file.

Also make sure that file actually does exist on that path. Don't take that
as an insult to your intelligence: it can happen to anyone, and I do speak
with experience. :) That path you're specifying is from the root of your
drive, not from the DocumentRoot.

I don't think this error message is the one you get for a script that
doesn't "return true", but make sure there's a line of "1;" at the end of
that included file.

-- 
Omer Shenker                          http://omershenker.net/



---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


[users@httpd] RE: [lists] Re: [users@httpd] Re: problem with perl-scripts

Posted by Omer Shenker <ma...@omershenker.net>.
On 04 June 2003 at 03:27 Mathias Alt wrote:
>  Any way to handle it without modifing any script? maybe set 
> the working
> directory to n: instead of c: ?

Possibly. Unless you're using mod_perl, the working directory is set to the
directory of a script before it's executed. What I'd suggest is mapping
//server/vol/ndsuser to a drive letter (say, o:). Then make DocumentRoot
o:/Web/html and the absolute paths in your scripts should work.

-- 
Omer Shenker                          http://omershenker.net/



---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Re: problem with perl-scripts

Posted by Mathias Alt <Ma...@gmx.net>.
> On 03 June 2003 at 13:06 Mathias Alt wrote:
> > this is a good idea, but how can I handle it? apache is 
> > installed on c: . I
> > specified my DocumentRoot
> > via unc-path like this (it is also drive n:) :
> > 
> > DocumentRoot //server/vol//ndsuser/Web/html/
> > 
> > Alias /Collect //server/vol//ndsuser/Collect
> > <Directory //server/vol//ndsuser/Collect>
> >     Options Indexes FollowSymLinks
> >     AllowOverride None
> >     Order allow,deny
> >     Allow from all
> > </Directory>
> > ~~~~~~~~~~~~~~~~~~~~~~
> 
> I don't think Apache's Alias directive is visible to Perl scripts. Why not
> write a Perl script (or something involving sed) to replace
> '/collect/run/lib/perl/' with
> '//server/vol/ndsuser/Collect/run/lib/perl/'?
> That might not be ideal, but at least it should work. I guess the best
> solution would really be to make the scripts use relative paths, but that
> might be more work than you need to do.
> 

 Any way to handle it without modifing any script? maybe set the working
directory to n: instead of c: ?

Thanks
Mathias

-- 
+++ GMX - Mail, Messaging & more  http://www.gmx.net +++
Bitte lächeln! Fotogalerie online mit GMX ohne eigene Homepage!


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


[users@httpd] Re: problem with perl-scripts

Posted by Omer Shenker <ma...@omershenker.net>.
On 03 June 2003 at 13:06 Mathias Alt wrote:
> this is a good idea, but how can I handle it? apache is 
> installed on c: . I
> specified my DocumentRoot
> via unc-path like this (it is also drive n:) :
> 
> DocumentRoot //server/vol//ndsuser/Web/html/
> 
> Alias /Collect //server/vol//ndsuser/Collect
> <Directory //server/vol//ndsuser/Collect>
>     Options Indexes FollowSymLinks
>     AllowOverride None
>     Order allow,deny
>     Allow from all
> </Directory>
> ~~~~~~~~~~~~~~~~~~~~~~

I don't think Apache's Alias directive is visible to Perl scripts. Why not
write a Perl script (or something involving sed) to replace
'/collect/run/lib/perl/' with '//server/vol/ndsuser/Collect/run/lib/perl/'?
That might not be ideal, but at least it should work. I guess the best
solution would really be to make the scripts use relative paths, but that
might be more work than you need to do.

-- 
Omer Shenker                          http://omershenker.net/



---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Re: problem with perl-scripts

Posted by Mathias Alt <Ma...@gmx.net>.
> Try
> require 'c:/collect/run/lib/perl/header.pl';
> and if that doesn't work, check that the user Apache is running as has
> read permissions to that file.

There are hundreds of files with this line without a specified drive. also
the drive would be n: , because this is a network drive.
apache is running as a user with rights to the files.

> Also make sure that file actually does exist on that path. Don't take that
> as an insult to your intelligence: it can happen to anyone, and I do speak
> with experience. :) That path you're specifying is from the root of your
> drive, not from the DocumentRoot.

this is a good idea, but how can I handle it? apache is installed on c: . I
specified my DocumentRoot
via unc-path like this (it is also drive n:) :

DocumentRoot //server/vol//ndsuser/Web/html/

Alias /Collect //server/vol//ndsuser/Collect
<Directory //server/vol//ndsuser/Collect>
    Options Indexes FollowSymLinks
    AllowOverride None
    Order allow,deny
    Allow from all
</Directory>
~~~~~~~~~~~~~~~~~~~~~~

c:/collect/run/lib/perl/header.pl  does not exit

any idea?

TIA

Mathias


-- 
+++ GMX - Mail, Messaging & more  http://www.gmx.net +++
Bitte lächeln! Fotogalerie online mit GMX ohne eigene Homepage!


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org