News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

500 Internal Service Error when trying to install package

Started by jtemple042996, April 20, 2013, 10:35:56 AM

Previous topic - Next topic

jtemple042996

I've reinstalled my forum in case there was any corrupted files or similar areas. I already checked the CHMOD Permissions and put them to what they are supposed to be set at(755 for Folders, 644 for Files). I've contacted Customer Support and they said i should contact the Software Developers. The error only occurs when i try to install packages. I've tried the suggestions on several topics on this forum, they didn't help.

Chalky


Colin

"If everybody is thinking alike, then somebody is not thinking." - Gen. George S. Patton Jr.

Colin

jtemple042996

@ChalkCat: I didnt see that one, Thanks, I'll try it!

@Colin: No server errors

MrPhil

So, everything's running fine, but when you try to install a mod you get a 500 error? See my sig > FAQs > 500 (Internal Server) Errors for a list of things that can cause this, in case you've overlooked something.

755 and 644 might not be usable for you. Depending on how your server is configured, for PHP (SMF) to write to directories or files might require 775/664 or even 777/666. Usually though, you'll get an error message that SMF can't write to _____ rather than a 500 error. Another common problem is not having a "temp" directory under Packages, although that usually doesn't give a 500 error. You say you've checked ownership -- are all files, including those just uploaded, owned by you? It's possible to run a forum with the wrong ownership of directories and files, until someone tries to upload an avatar or attachment, or you try to install a mod (when SMF tries to write/edit files). Have you tried uploading an attachment and/or an avatar, just to rule out ownership issues?

Can you tell where in the process you're getting the 500 error? Is it while trying to upload the package, or unpack it? Is it during editing of existing files? How far are you getting? Is the error while actually trying to edit (modify) the files? Is it possible that a piece of PHP code that isn't used during normal execution, such as the Package Manager, has a blank line at beginning or end? If this is happening with a fresh install that no hacker has touched (have you rechecked the last modified times?), it's unlikely to be that.

jtemple042996

Quote from: MrPhil on April 20, 2013, 12:29:59 PM
So, everything's running fine, but when you try to install a mod you get a 500 error? See my sig > FAQs > 500 (Internal Server) Errors for a list of things that can cause this, in case you've overlooked something.

755 and 644 might not be usable for you. Depending on how your server is configured, for PHP (SMF) to write to directories or files might require 775/664 or even 777/666. Usually though, you'll get an error message that SMF can't write to _____ rather than a 500 error. Another common problem is not having a "temp" directory under Packages, although that usually doesn't give a 500 error. You say you've checked ownership -- are all files, including those just uploaded, owned by you? It's possible to run a forum with the wrong ownership of directories and files, until someone tries to upload an avatar or attachment, or you try to install a mod (when SMF tries to write/edit files). Have you tried uploading an attachment and/or an avatar, just to rule out ownership issues?

Can you tell where in the process you're getting the 500 error? Is it while trying to upload the package, or unpack it? Is it during editing of existing files? How far are you getting? Is the error while actually trying to edit (modify) the files? Is it possible that a piece of PHP code that isn't used during normal execution, such as the Package Manager, has a blank line at beginning or end? If this is happening with a fresh install that no hacker has touched (have you rechecked the last modified times?), it's unlikely to be that.
I can upload the package just fine, it when i actually try to unpack/install the the error occurs. I've read your FAQ, although it was helpful it didnt fix the issue. I verified ownership of all files, and can upload avatars.

MrPhil

Any mods already installed? I'm wondering if one of them broke the Package Manager with a misedit. Or is this the first mod you've tried installing? Is mod_security turned OFF? It's a long shot, but can cause weird problems.

jtemple042996

Quote from: MrPhil on April 20, 2013, 01:13:58 PM
Any mods already installed? I'm wondering if one of them broke the Package Manager with a misedit. Or is this the first mod you've tried installing? Is mod_security turned OFF? It's a long shot, but can cause weird problems.
This is the first modification, how would i turn off mod_security?

MrPhil

You will have to ask your host how to do it, as it varies from host to host. Sometimes they have to do it; other times, you can add a few lines in your /.htaccess file. If they're uncooperative about helping you, google around this and other places for "mod_security" and try the various .htaccess entries until you find one that works. You should have mod security OFF anyway, as it tends to interfere with SMF's function more than it helps anything, but it may have no effect on this particular problem. If it doesn't help, we'll have to dive deeper into this problem.

I would check the "last modified" dates on all your files to see if someone is hacking you, and to investigate "too recently" changed files or files that you can't account for as part of a normal SMF installation. Did you completely clean out your site when you reinstalled, or did you just overwrite the SMF files? Make sure you're regularly scanning your PC for spyware, and have a firewall, so a hacker can't easily grab passwords. It's a fair amount of work, but you might have to check your SMF .php files for blank/empty lines before the first <?php or after the last ?>.

Other than that, if you've gone through everything on the page I gave the link to, I'm drawing a blank.

jtemple042996

Quote from: MrPhil on April 20, 2013, 02:14:31 PM
You will have to ask your host how to do it, as it varies from host to host. Sometimes they have to do it; other times, you can add a few lines in your /.htaccess file. If they're uncooperative about helping you, google around this and other places for "mod_security" and try the various .htaccess entries until you find one that works. You should have mod security OFF anyway, as it tends to interfere with SMF's function more than it helps anything, but it may have no effect on this particular problem. If it doesn't help, we'll have to dive deeper into this problem.

I would check the "last modified" dates on all your files to see if someone is hacking you, and to investigate "too recently" changed files or files that you can't account for as part of a normal SMF installation. Did you completely clean out your site when you reinstalled, or did you just overwrite the SMF files? Make sure you're regularly scanning your PC for spyware, and have a firewall, so a hacker can't easily grab passwords. It's a fair amount of work, but you might have to check your SMF .php files for blank/empty lines before the first <?php or after the last ?>.

Other than that, if you've gone through everything on the page I gave the link to, I'm drawing a blank.
I'll try to contact the Hosting Support about turning off mod_security. As for how i installed the forum, i completely removed all files in the field and uploaded a fresh copy from SMF Downloads. The "last modified" dates all seem normal. If turning off mod_security does not work i will check the .php files. Thanks for your help!

Storman™

Instead of making an assumption that  mod_security is enabled you could actually check first before asking your host.

If you create a phpinfo.php file then you can check it yourself:

What is phpinfo.php ?

It's a five minute job to check so worth a look.

If it is enabled then bare in mind that if you are on shared hosting then I suspect they would be loath to turn it off. Rightly or wrongly as a host they will have chosen to enable it. If it is enabled they may well want to migrate you to a different node where it is off.


jtemple042996

Mod_security was enabled and has been disabled. Still having the issue though.

MrPhil

No mods installed, fresh unhacked copy of files -- I would say then it's got to be something with permissions or ownership, but you say you've confirmed that you're listed as owner of all directories and files, and permissions are 755/644. At worst, with those permissions, you should get a "can't write to ___" error, not a 500. If you were constantly getting the 500 error, my next step would be to look at the content of the .htaccess and php.ini files for invalid entries, but you say that this is only happening part way through a mod install.

Can you give any more details about exactly when in the "unpack/install" operations this is happening? Can you capture the output (all the messages) and post it here? That might give a clue. Did you create a "temp" directory under Packages (I don't know why it often doesn't seem to be created with the install) and give it the same permissions as Packages (NOT 777)?

Arantor

Quote(I don't know why it often doesn't seem to be created with the install)

It's never created with the install. It's created only at the point of unpacking and is removed again thereafter. Why? I have no idea. I presume it's a form of clean-up with respect to the way the unpacker works (dumps everything out of the archive to the temp folder, before running stuff or actually moving it to the right folders)
Holder of controversial views, all of which my own.


MrPhil

Well, something's wrong with that process, because people often have to be told to manually create the directory. I wouldn't be surprised if this is something left over from an ancient server, just like the Settings.php update (rewrite) that insists on emptying the file first, rather than simply overwriting it (which is a silly thing to do anyway, but that's another fight).

Arantor

Nah, it's primarily a permissions issue from what I've seen. There are ways to completely side step it but they have caveats of their own (e.g. no tar.gz support, time out issues if there's a lot of files)

* Arantor has spent great amounts of time researching alternatives ;)
Holder of controversial views, all of which my own.


winniethepooh

Quote from: Arantor on April 20, 2013, 09:34:55 PM
Nah, it's primarily a permissions issue from what I've seen. There are ways to completely side step it but they have caveats of their own (e.g. no tar.gz support, time out issues if there's a lot of files)

* Arantor has spent great amounts of time researching alternatives ;)
wow, thanks for this explanation Arantor. I've been having the cant write to___ error and the host placed a fixedfileownership file in my / directory after i brought it to their attention. i now have the issue like you mentioned where it times out ever 4 or 5 files for a few seconds. i can still upload tar.gz but not in filezilla for somereason. also chmodding never works in filezilla. host says its a server issue. i asked what that meant and the rep said it was a known problem on windows server installations. Do you think he's just feeding me a line? im fairly green with some of this stuff still(really green actually)
"But I'm tryin' Ringo.I'm tryin' real hard to be the Shepherd."

Arantor

Windows servers don't support chmod because they don't use Unix style file permissions at all.
Holder of controversial views, all of which my own.


winniethepooh

Quote from: Arantor on April 20, 2013, 10:08:35 PM
Windows servers don't support chmod because they don't use Unix style file permissions at all.
I don't mean to thread jack, but is there anything i can do?
"But I'm tryin' Ringo.I'm tryin' real hard to be the Shepherd."

Arantor

Not use Windows hosting?
Change the configuration in IIS if you have access to it? Failing that, get your host to make things writable?
Install mods manually?

Those are pretty much your options. FWIW, almost everyone runs SMF on Linux hosting on real servers, not Windows. It generally performs so much better.
Holder of controversial views, all of which my own.


Advertisement: