CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Win32 Programming Help:
Apache+ActivePerl on my computer doesn't like the leading slash in #!/usr/bin/perl.

 



DrZed
User

Jun 6, 2000, 6:55 AM

Post #1 of 8 (7322 views)
Apache+ActivePerl on my computer doesn't like the leading slash in #!/usr/bin/perl. Can't Post

I really don't know if this is an 'ActivePerl' question or an 'Apache' question.

When I upload scripts to my site's server the following instruction works fine:
#!/usr/bin/perl

However, when I run them on my computer (using Apache and ActivePerl) I need to use the following:
#!usr/bin/perl

The difference is only a leading slash, but it is irritating to have to make changes before and after uploading. And if I forget, I end up uploading non-functional scripts.

Is there any way to get my computer to work with the leading slash?

Dr. Zed


Cure
User

Jun 17, 2000, 12:41 PM

Post #2 of 8 (7322 views)
Re: Apache+ActivePerl on my computer doesn't like the leading slash in #!/usr/bin/perl. [In reply to] Can't Post

#!/usr/bin/perl

works just fine on win32 machines
my path is #!/apache/bin/perl

If your not using a browser then you dont need a path in win32 systems


Cure


DrZed
User

Jun 17, 2000, 4:15 PM

Post #3 of 8 (7322 views)
Re: Apache+ActivePerl on my computer doesn't like the leading slash in #!/usr/bin/perl. [In reply to] Can't Post

Thank you for your response, but you seem to be ignoring what I posted.

#!/usr/bin/perl
doesn't work on my system.

I'm running Apache+Active Perl. I'm running Windows '98.

* oops, I had to edit the following path since it was a direct copy of what doesn't work. *

I will only accept
#!usr/bin/perl

* as per my original post, it only works without the leading / *

Or a full path
#!C:/Internet/Apache/usr/bin/perl

Neiter is acceptable for the online server I send my stuff to.

BTW, I'm writing CGIs which need to be run through a web server to use properly.

While I'm asking questions, my scripts don't appear to be able to write to files. I'm writing a forum script, and when I run it on my computer, I can't actually make new posts. I can on the online server, so it's probably something related to permission settings for Apache, but I haven't been able to find any fix and I can't find an Apache forum.

Dr. Zed


[This message has been edited by DrZed (edited 06-19-2000).]


Cure
User

Jun 17, 2000, 4:50 PM

Post #4 of 8 (7322 views)
Re: Apache+ActivePerl on my computer doesn't like the leading slash in #!/usr/bin/perl. [In reply to] Can't Post

#!/whatever/ is the path to the perl.exe
so I have no IDEA what your path is on your computer

If you want #!/usr/bin/perl then install it like that

And on windows you dont change permissions->its not like unix


Cure


dws
Deleted

Jun 18, 2000, 10:48 PM

Post #5 of 8 (7322 views)
Re: Apache+ActivePerl on my computer doesn't like the leading slash in #!/usr/bin/perl. [In reply to] Can't Post

In the case of IIS/PWS (so YMMV for Apache) the path in the #! line is ignored. Instead, in the case of PWS the application associated with .cgi is used. (IIS does something similar, but saves the association in its MetaBase).

Can you run the cgi from the command-line by typing only its name?


DrZed
User

Jun 19, 2000, 12:04 PM

Post #6 of 8 (7322 views)
Re: Apache+ActivePerl on my computer doesn't like the leading slash in #!/usr/bin/perl. [In reply to] Can't Post

Again, more clarification:

<BLOCKQUOTE><font size="1" face="Arial,Helvetica,sans serif">quote:</font><HR>#!/whatever/ is the path to the perl.exe
so I have no IDEA what your path is on your computer
If you want #!/usr/bin/perl then install it like that<HR></BLOCKQUOTE>

The actual path is irrelivant. The problem is that it WON'T accept #!/whatever/. It WILL accept #!whatever/, but that isn't acceptable to the on-line server I use.

<BLOCKQUOTE><font size="1" face="Arial,Helvetica,sans serif">quote:</font><HR>And on windows you dont change permissions->its not like unix<HR></BLOCKQUOTE>

I'm well aware of that. I wasn't talking about that type of permission. I'm talking about allowing Apache run perl CGI's to write to my computer. It is not able to. I can only assume that I need to 'enable' something in the Apache configs.

<BLOCKQUOTE><font size="1" face="Arial,Helvetica,sans serif">quote:</font><HR>In the case of IIS/PWS (so YMMV for Apache) the path in the #! line is ignored. Instead, in the case of PWS the application associated with .cgi is used. (IIS does something similar, but saves the association in its MetaBase).<HR></BLOCKQUOTE>

My milage is definatly varying, since it does require a specific #! line.

<BLOCKQUOTE><font size="1" face="Arial,Helvetica,sans serif">quote:</font><HR>Can you run the cgi from the command-line by typing only its name?<HR></BLOCKQUOTE>

That depends on what you mean. I can't use only the name (e.g. dzforum.cgi). However, I assume that you mean 'perl dzforum.cgi.

I can run it from the command line regardless of the #! line (since the perl program is being found via dos and not through a server). However, since it's a CGI, a command line run is of little use.

If no one knows why #!/whatever doesn't work, but #!whatever does, that's fine. I understand this isn't an Apache forum.

The whole Apache thing is a bit frustrating. I really wish their site linked to a forum.




dws
Deleted

Jun 19, 2000, 6:26 PM

Post #7 of 8 (7322 views)
Re: Apache+ActivePerl on my computer doesn't like the leading slash in #!/usr/bin/perl. [In reply to] Can't Post

Actually, I did mean typing the name of the .cgi by itself, without prepending "perl". This tests whether there's an association between .cgi and perl.exe. If the .cgi at least starts (and gets as far as bombing out because the necessary environment variables aren't present), then you have a working association.

Again, this might not be needed for Apache, but the lack of an association is doom for IIS/PWS users.


[This message has been edited by dws (edited 06-19-2000).]


gvh
Deleted

Jul 8, 2000, 1:06 PM

Post #8 of 8 (7322 views)
Re: Apache+ActivePerl on my computer doesn't like the leading slash in #!/usr/bin/perl. [In reply to] Can't Post

If I understand you correctly, you have a problem running your scripts
on the apache server running on your own win98 box.

Contrary to Windows itself, the apache server does use the hashbang
line to locate your perl interpreter, working on win98 as it does on
unix. Now on unix, perl usually is located in /usr/bin/perl where the
leading slash indicates that this directory is at the root of the file
system.

On your win98 machine, you do not seem to have this /usr/bin/perl :
from the 'full path' you mention as 'C:/Internet/Apache/usr/bin/perl'
I understand that it is located inside the apache directory. And that
explains why apache only likes it without the leading slash : in that
way, it becomes a relative path, off the apache directory. We just
have to assume that that is the current directory when apache runs
scripts.

If you want to avoid the backslash problem, you will probably have to
install perl as in c:\usr\bin\perl.

Hope this helps,

Guido

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives