# Perl/CGI Questions

## Recommended Posts

##### Share on other sites

I have some scripts that would allow a user to upload a file to a server but I have never got it to work. These are straight from books so I know they work. I have the CHMOD right. I am wondering, does anyone think that a server can restrict a certain script and if so how can I be sure before I spend a bunch of money on a server. If anyone knows why this might not be working please respond. Thanks

##### Share on other sites

I know you said you checked this, but it sure sounds like a CHMOD problem to me. What do you have the directory chmod to?

##### Share on other sites

If you're going to pay alot of money for the server, then make sure it has good support and ask them.

##### Share on other sites

I think I had the directory at 777 and the cgi script at 766 the html file was 777 also I believe. What do you think they should be?

##### Share on other sites

777. try changing them all to that (just to see).

##### Share on other sites

At one point I did CHMOD them all to 777. Do you think the server could be restricting me from uploading files? Or do you have any idea how else I can allow a user to upload a file to a website?

##### Share on other sites

Try another upload script. I don't think the server should reject it for any reasons, as long as the permissions are 777..

wierd.

##### Share on other sites

• 2 months later...

For security issues, a server may restrict it for some gay reasons, if you have a panel, allow uploads from someone other than you. Also, check the script on another server, if it doesn't work on your server, then call tech support.

##### Share on other sites

Again, beautiful response time.

##### Share on other sites

once again stfu, I will take my DAMN time responding, oh and um make sure perl works period, before testing the file upload script, because sometimes files get uploaded as binary, and don't work.

##### Share on other sites

• 2 weeks later...

I know that you asked for Perl, but if your server supports PHP then I think I have a working script lying around somewhere that you could use.

##### Share on other sites

It does support PHP and I would like the script, but I really was wondering why the it wasnt working. I uploaded it about 20 times. Making small changes to it. I took the code straight from a book even, to be sure that there would be no mistakes. I uploaded it in ASCII form and I know that the perl works because I made a counter. So let me say it one more time, "What the deal yo?!?"

##### Share on other sites

I shall try and dig it out for you.

I have had no experiance with Perl so I'm afraid I won't be able to help you with it.

##### Share on other sites

• 1 month later...

Also, what kind of configuration you have on the server?

##### Share on other sites

It says error 500.

##### Share on other sites

Hmmm. That's not much of a help.

Try to visit the page, and when error 500 appears, get the last 5 lines in your error log. You know how to access your error log? It is basicly a file called error_log. If you need more specific information or commands I'll try my best.

##### Share on other sites

I have set it up so it will print the errors but it never prints them. It is as if the script is not be executed. If it is possible, the server may have restricted file uploads. I can make the script create a file, as in a counter but I can not make it upload a file. I worked on this for a week and a half and decided it was useless. There arent enough people with CGI or Perl knowledge to get help.

-Scorpio

##### Share on other sites

You set what to print the errors? You mean it is an option in the script?

This is obviously a problem in the execution of the script itself. Anyway, I might be able to help you if you get me the error messages.

Just look for the file:

$locate error_log  If you find it for example in: /var/log/apache/error_log, then you should print the last 6 lines of the file: $ tail -6 /var/log/apache/error_log


Then copy these files and paste them here. It might be very easy to solve.

##### Share on other sites

I had it so it would print any errors in text on the page and tell me waht the problem was, but instead I got an error 500 and I have no idea what that means. The owners of the site are not helpful and if I mail them all i get is an automatic response that doesnt address the problem... Great customer service.

-Scorpio

## Create an account

Register a new account