Jump to content

[SOLVED]500 Internal Server Error When Uploading Files


cyllibi

Recommended Posts

Hi, I'm new to Helio and I think it's a fantastic service. I'm also fairly new to php, css, javascript, and mysql so maybe/hopefully this is something easy. My site is on Johnny, my domain is primitiveelegance.heliohost.org. My username here and there is cyllibi. I scored a $1 domain through GoDaddy and already put it to use at primitiveelegance.com.

 

I've run into an issue with uploading files to my site, which is a core part of what I'm wanting to set up (the site is being designed to ultimately be run by my mom) and hope I can find some help getting past it. Each time I try it, I run into a 500 error, and I welcome you to check it as well: http://primitiveeleg...com/additem.php

 

This page is essentially the file upload script from http://www.zubrag.co...upload-form.php copy/pasted into my layout. I work on the site from my home computer before I upload it to Helio and it works fine for me at home.

 

I apologize if this issue has already been addressed, I promise I scoured search results trying to find a fix or workaround to no success. Similar issues indicated .htaccess might be the culprit, but mine is just the default that came with the installation and pasted here in the interest of giving as much info as may be necessary:

 

IndexIgnore .htaccess */.??* *~ *# */HEADER* */README* */_vti*


<Limit GET POST>
order deny,allow
deny from all
allow from all
</Limit>
<Limit PUT DELETE>
order deny,allow
allow from all
</Limit>
AuthName primitiveelegance.heliohost.org
AuthUserFile /home/cyllibi/public_html/_vti_pvt/service.pwd

 

Thank you for any assistance. ~cyllibi

Link to comment
Share on other sites

Yes, I've got an images folder created and these are the settings I put into the script:

 

define('DESTINATION_FOLDER','images/');
define('MAX_FILE_SIZE', 0);
define('SUCCESS_URL','additem2.php');
$exts = array();
define('RENAME_FILE', true);
define('APPEND_STRING', '');
define('DO_LOG', false);

 

Once the upload processes and it sends you to SUCCESS_URL, I also modified the 'do not modify' section just a little to pass the filename with it, but since removing it doesn't make it work, I don't think the issue is here:

header('Location: ' . SUCCESS_URL . '?file=' . $dest_filename);

 

~cyllibi

Link to comment
Share on other sites

Still a 500 error for me, the images in there both went through somehow last night using one of the virtual machines at my workplace and ie7, it still gave an error but not a 500 error. I thought it was ie7 having a problem with the form. I'll try to recreate it today.

Link to comment
Share on other sites

Since I'm not where I can trouble shoot your acript right now and it's really not our respnsibility to do so, you should probably ask your questions in the forum of the writer of the script:

 

http://www.zubrag.com/forum/

 

Just make sure you don't have any problems uploading through the cpanel. You might want to check your Error Log at your cpanel for an explanation of the 500 error.

 

Link to comment
Share on other sites

Your script is working. I just now uploaded this image:

 

http://primitiveelegance.com/images/e11f78c97e8c20f91361ae9f5cb3c49e.jpeg

 

And the error your getting is this:

 

Warning: Cannot modify header information - headers already sent by (output started at /home/cyllibi/public_html/additem.php:5) in /home/cyllibi/public_html/additem.php on line 243

 

You've edited the original script and that's why your getting that error.

Link to comment
Share on other sites

OK, thanks again for the tips. I am happy to report that it is working satisfactorily for me now and ultimately, that's all I wanted ;)

 

I found a few things.

 

After you guys identified the header error, I determined a quick (and dirty?) workaround by adding <?PHP ob_start();?> to the start of the file and then <?PHP ob_end_flush();?> to the end.

 

I was still running into errors trying to upload a few test images but then realized the one byron used and the ones I accidentally pushed through at work were smaller than the ones I was testing from here at home. I did not think 450 kilobytes was large enough to cause an error, but then I sized the image down a bit and it went through quite easily. I was planning to size down my images a bit before sending them, so I'll just scale them down a little more and it will work just fine.

 

Thanks again for the assistance, now I can stop banging my head and move on with my design :)

 

~cyllibi

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...