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: Beginner:
Okay, this is silly

 



SirAnvil
Deleted

Feb 25, 2001, 3:15 PM

Post #1 of 9 (935 views)
Okay, this is silly Can't Post

This should work, but it isn't.

I'm trying to create a file with my script and change the permission to 777. I've got the following wich works just fine from command line but not from the browser. My scripts are 755 and I've also tried 766. I'm a stuck

sniplet
use Fnctl;

sysopen(FH1, $filetoopen, O_WRONLY|O_EXCL|O_CREAT, 0777) || die $!;
print FH1 "info info and some more info";
close(FH1);

From the browser I get permission denied and from the command line it works just fine. Any suggestions? Perhaps a whole new file creation process?

SirAnvil
www.christiangamers.org


kencl
User

Feb 26, 2001, 11:44 AM

Post #2 of 9 (924 views)
Re: Okay, this is silly [In reply to] Can't Post

I'm assuming you're running a Unix/Linux system with Apache, not uploading to an ISP.

I suspect it's a matter of the permissions of the user running the process. Add a sleep(20) to the script, then look at the processes (ps -aux). The sleep just keeps the process running long enough for you to see who owns it. Running the script via Browser should run under user "nobody", who may not have permission to set world writable permissions.

This is just a guess, and it's been a while since I've booted into Linux so I could be way off. Wink

PS what is die $! printing?

>> If you can't control it, improve it, correlate it or disseminate it with PERL, it doesn't exist!


muinatit
Deleted

Feb 26, 2001, 3:50 PM

Post #3 of 9 (918 views)
Re: Okay, this is silly [In reply to] Can't Post

$! is the actual server error that it encounters. Very helpful for debugging.

Jeffrey "muinatit" Lamoureux
muinatit@hotpop.com


SirAnvil
Deleted

Mar 1, 2001, 10:17 AM

Post #4 of 9 (900 views)
Re: Okay, this is silly [In reply to] Can't Post

to answer your quesiton it's giving me

"you don't have permission to access this.cgi on this server"

the cgi is chmod 755 and i've tried 766 and 777. but when run from the command line it works fine.

I tried your trick and when run from the command line I own the process. But when run from the browser it does not hang long enough to find out. i changed it to 60 but still can't it give me the permission error right away...Any ideas?

SirAnvil
www.christiangamers.org


Aquilo
journeyman

Mar 1, 2001, 11:24 AM

Post #5 of 9 (898 views)
Re: Okay, this is silly [In reply to] Can't Post

sounds like the folder is not writeable or if your working in a
site.com/mainsum/sub/sub - type deal one of pervious folders or the folder you are working in has htaccess restricting it only to server calls.




SirAnvil
Deleted

Mar 1, 2001, 11:29 AM

Post #6 of 9 (897 views)
Re: Okay, this is silly [In reply to] Can't Post

Good answer. Unfortunately it did not work. I chmod the directory to 777. the script is still 766.

Could it possably be the coding itself? I'm using a special modual to do the magic, perhaps a better written code might do the trick?


SirAnvil
www.christiangamers.org


Aquilo
journeyman

Mar 1, 2001, 10:11 PM

Post #7 of 9 (887 views)
Re: Okay, this is silly [In reply to] Can't Post

:) You know about magic what you send out comes back three fold - messing with a daemon umm might be your code or the special module! :)

I don't know I'm probably newer to perl then you! :)




SirAnvil
Deleted

Mar 2, 2001, 9:01 AM

Post #8 of 9 (882 views)
Re: Okay, this is silly [In reply to] Can't Post

I think what I'll do is scrap the whole code and get a login script that pre-created and modify as needed.
any suggestions? I'm going to go thumbing through TPA

SirAnvil
www.christiangamers.org


SirAnvil
Deleted

Mar 15, 2001, 2:35 PM

Post #9 of 9 (872 views)
Re: Okay, this is silly [In reply to] Can't Post

FYI: I still don't know what the problem was but I'm in the middle of migrating to a new server. i tried the exact code I have on another server and it works fine. Hmmmmm

SirAnvil
www.christiangamers.org

 
 


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

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