View Full Version : Dreaded 500 Internal Server Error
KevinBedell
04-17-1999, 09:36 PM
I've been trying to get some CGI stuff working usnig PHP or even simpler stuff. I keep getting 500 Internal Server Errors no matter what I try. http://www.aota.net/ubb/frown.gif
I noticed in one post there was a reference to a test CGI (http://solareclipse.net/CCForum/Test/index.cgi) that someone couldn't get to work. I downloaded a copy of that exact script and could not get it to work (though if you click on the link you'll see that it does in fact work under that user's account!)
Gosh. I tried setting everything to 755 security (including the directory and all the files) and still nothing. I tried a number of other things and no progress.
Could it have something to do with the fact that some of my files seem to be owned by a "xkbedell" user and some owned by a "kbedell" user? Also there seems to be a "xkbedell" group too.
I've searched the FAQ, the message boards, my error and script logs and still I'm stuck... Time to call for reinforcements!
Any new ideas for me to try?
Sign me,
Mystified and Mortified. http://www.aota.net/ubb/smile.gif
(AKA Kevin)
kbedell xkbedell
The majority of the time that someone says "it works over there but not when I put it over here" it's usually because it was not uploaded in ASCII mode.
In your FTP program make triple sure you specify to upload in ASCII. Do not allow it to 'decide for itself' you need to specify ASCII.
Just doing that may solve many of your problems...
Deb
Charles Capps
04-17-1999, 11:38 PM
Er, no, you could not have downloaded that exact program, as I have not yet actually released it to the public. :-)
What does it say in your error logs, if it says anything? Have you tried executing the script (assuming Perl) from the command line?
------------------
"Okay, so I'm not "SANE" so to speak, but uh... I'm the lovable kind of psycho"
http://solareclipse.net/
hearts
04-17-1999, 11:57 PM
Could it have something to do with the fact that some of my files seem to be owned by a "xkbedell" user and some owned by a "kbedell" user? Also there seems to be a "xkbedell" group too.
would ya mind clarifying this statement?
Cuz ya make it seem like you might have your paths incorrect.
Are ya running this script from your cgi-bin or are you running this script in a sub directory within your www?
your path would consist of xkbedell like this:
/big/dom/xkbedell/cgi-bin for your cgi
/big/dom/xkbedell/www/your_dir (any dir within your www.
Your post indicated that you were making your paths with out the "x" and with.
assuming you are not waiting for your domain to propagate, your URL would not have the "x".
----------
hearts
-----
[This message has been edited by hearts (edited 04-17-99).]
MonsterMan
04-18-1999, 12:01 AM
(I used to be KevinBedell - but wanted a change of pace...)
Well... Er... It looks like I've got to go back to school here a bit on my CGI skills...
I right-clicked on the link to this file in another thread and selected "save to file", then saved the output to a file on my machine. Then I ftp'd the results file to my account and tried to execute it. (Thought I was pretty slick!)
In fact I was trying to execute the HTML output from your original .cgi script.
In case this is the first you've seen of me, allow me to introduce myself. I'm the new guy on the block who doesn't know what he's doing...
Anyway, I'll get the hang of this eventually http://www.aota.net/ubb/smile.gif.
I developed a site (www.greeksource.com) a few years ago that had a whole bunch of Perl stuff on it. Now I'm going to be working on a project where I'm using PHP/MySQL.
Unfortunately, it seems pretty clear that my skills are a bit rusty. But I'll get back on top of it pretty quick.
Until then, I hope you'll all bear with me while I figure out how to make this stuff work.... And thanks in advance for the help I'll undoubtable need... I'll try to pay it back when I can.
Thanks!
MonsterMan (AKA KevinBedell)
www.kbedell.com
MonsterMan
04-18-1999, 12:17 AM
Hearts -
I'm waiting for my domain to transfer from my previous provider.
What I was trying to say in the previous post was that I don't understand why I'm seeing the username "xkbedell" as the file owner for some files and the username "kbedell" as the username for others.
In addition, the UNIX group "xkbedell" is the group that owns all my files.
Back when I was a C/UNIX programmer (a few years ago) I remember noticing that many errors I ran into were the result of permissoin issues and file ownsership.
It seemed like there may be something weird happening... Like I said, I probably just don't understand. In fact, it is probably actually BETTER that I don't understand...
Let me hack this out a bit more and come back a bit later once I understand a bit more about what the heck I'm doing...
MonsterMan
BTW - Thanks for taking time to respond and offer the help! I'm sure you probably have more interesting things to do on a Saturday night (the real question is Why don't I have more interesting things to do on a Saturday night?)
hearts
04-18-1999, 12:33 AM
ROFL.. (the saturday night comment)-- I PLEAD the 5th!
I don't understand what you are talking about.. am I missing something here? I have a client's domain waiting on propagation, and I didn't see nothing like that in his FQ set up. Differences in packages maybe?
Maybe you are right.. you don't wanna know. Therefore, maybe I don't wanna know!
should ya need help, or just simply want a second pair of eyes, hit me in email. hearts@heartsweb.com .. as long as I don't have to answer the saturday night dilema, I don't mind helping! http://www.aota.net/ubb/wink.gif
----------------
hearts
-----
MonsterMan
04-18-1999, 12:53 AM
Here's an example -
This script is in my cgi-bin directory (called first.php). When I run it from the command line (ie. "php first.php") I get correct output. I can then redirect it to a file and view it from my web browser correctly.
The script is simple:
<html> <head> <title> First Project </title> </head>
<body> <H1> Centered Text </H1>
<?
$today = date("Y-m-d");
print "<center> Today is: $today </center>";
?>
</body> </html>
And the issue couldn't be ASCII ftp'ing. I created the script from scratch in "vi".
Anyway, it doesn't work if I try to run it as a cgi. I GET THE DREADED 500 INTERNAL SERVER ERROR. Error logs reflect nothing useful. Depression sets in.
Anything seem weird to anyone else?
M-Man
MM:
Place the file in your www directory instead of your cgi-bin and it should run.
<edit>
php "scripts" are accessed just like html documents and then pre-processed by the php engine before sending to the browser.
</edit>
Rich
[This message has been edited by Rich (edited 04-18-99).]
Hehe... what you have written will work perfectly. Upload first.php to your www directory and it will do as it should.
The reason it is not working in your cgi bin is because it is not a cgi script.. it is php.
I copied and pasted what you wrote to http://www.hosthelp.com/test.php and as you will see all is well http://www.aota.net/ubb/smile.gif
Deb
hearts
04-18-1999, 01:29 AM
I didn't dare say nothing about this PHP code cuz i thought that cgi could be written in any language.. I am new to this.. totally!
anyways.. let me say WOW WOW WOW.. I wanna learn this php! YES .. okay.. so my Saturday nights are nothing to brag about.. I didn't realize PHP was so easy... why does it look so much like perl?
maybe a dumb question and out of its original posting.. but can ya combine PHP coding with html coding all in the same file.. ya just call it *.php?
--------------
hearts
-----
[This message has been edited by hearts (edited 04-18-99).]
Yep, that's one of the great things about php... tis a server side scripting language.. as Rich said, everything is completed before the page hits the browser.
With CGI (most commonly coded in Perl) to create a simple mail form you need to create the HTML page and then when you hit the 'send' button it calls a cgi script that is located somewhere else.
With PHP you can achieve the same results (and much better ones!) all within the same file.. toss it in your www directory lable it .php and voila you're good to go http://www.aota.net/ubb/smile.gif
http://www.php.net
Devshed has some good beginner's tutorials on it as well as http://www.314interactive.com/io/index.php3
Deb
MonsterMan
04-18-1999, 01:37 AM
Thank you everyone for your help! I'll pay back the favor when I can.
Hearts - yeah, you can pretty much just mix PHP and HTML up in the same file. You just slip in and out of PHP as you need by inserting the <? and ?> tags to show where PHP starts and stops.
It looks pretty cool - relatively easy to get into, but deep enough to take you a long way if you need.
See you around!
MM
hearts
04-18-1999, 01:59 AM
Hey Deb, I love that second link! Who are these ppl? I saw FQ linked all over the place! http://www.aota.net/ubb/smile.gif
Well.. I think I am gonna take the time to learn this.. you have created a monster! hmmmmmmmmmm... should I change my handle to Monster Hearts? *giggle*
FQ is dangerous to my sleeping habits... or lack thereof! http://www.aota.net/ubb/wink.gif
------------------
hearts
-----
Justin
04-18-1999, 04:48 PM
why does it look so much like perl?
What have I been trying to tell you, hearts? It's soooo simple, and easier than perl http://www.aota.net/ubb/smile.gif You can write a site full of dynamic content, even using a full database, and all your coding can be right in with the HTML:þ
------------------
Justin Nelson
FutureQuest Support
hearts
04-18-1999, 05:07 PM
hey Justin.. there is nothing mentioned in FQ's TOS that says I haveta listen to ya! *grin* Besides, have ya ever heard of an older sis respecting her kid bro? *totally unamerican!* *giggle*
JUSSSSSSSSSSSSSSSSST kidding! http://www.aota.net/ubb/wink.gif
--------------
hearts
-----
Hmmm hearts.. thanks for bringing that up.. guess I need to add a paragraph to the TOS huh?
"In addition to the rules listed in the TOS Hearts must listen to Justin."
Something like that should cover it hehe
Justin
04-18-1999, 05:38 PM
ROFLMAO!!! http://www.aota.net/ubb/smile.gif Wow, the perks that come with this job just never end, huh? I get the word "Administrator" under my name, and now mandatory respect from Hearts - now if only I could get them to pay me...
hehe http://www.aota.net/ubb/biggrin.gif
------------------
Justin Nelson
FutureQuest Support
While we are on the subject.. and I am going to sound like a real novice here (which I am)
How hard would it be to convert a cgi-script to one using php/mysql? I mean.. you know, for the person who knows what they are doing.
(which I don't) http://www.aota.net/ubb/redface.gif
------------------
Paul
hearts
04-18-1999, 09:48 PM
well, since my contract is an annual one, I don't haveta listen to Justin til sometime in ummm... March! *giggle*
Dontchya just love contracts! http://www.aota.net/ubb/biggrin.gif
---------------
hearts
-----
vBulletin® v3.6.8, Copyright ©2000-2009, Jelsoft Enterprises Ltd.