Internal Server Error when uploading files Internal Server Error when uploading files
 

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Main Menu

Internal Server Error when uploading files

Started by edaly, November 05, 2005, 09:31:40 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

edaly

First off let me say that Coppermine is fantastic.  It's so amazing that such a full-featured program is available for free.  And even more amazing that there are people supporting it for free.  I would not be trying to use up the valuable support time here if I didn't believe I'd exhausted all available options.

My coppermine site has been running fine for many months.  Then suddenly I started having problems when batch adding files.  Only a few would get added, then none would get added.  I've searched and read extensively on this forum and have tried many possible solutions.  Here's what I've tried:

- Upgrading to the latest vesion of Coppermine (1.3.5)
- Checking that the permissions on /albums, /albums/userpics, and /albums/edit are set to 755 (I've also tried 777)
- Turning on the debug mode and uploading only single files (I'm no longer testing batch adds)
- Increasing the resource limits in php.ini, including upload_max_filesize, post_max_size, memory_limit, etc.


I get the following error when trying to upload files
Quote
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, webmaster@tellureonline.com and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
Apache/1.3.34 Server at www.tellureonline.com Port 80


Here's the errorlog from CPanel:

Quote
[Sat Nov  5 13:39:36 2005] [error] [client 24.86.197.147] File does not exist: /home/edaly/public_html/500.shtml
[Sat Nov  5 13:39:36 2005] [error] [client 24.86.197.147] Premature end of script headers: /home/edaly/public_html/photos/upload.php
[Sat Nov  5 13:36:04 2005] [error] [client 24.86.197.147] File does not exist: /home/edaly/public_html/favicon.ico
[Sat Nov  5 13:36:01 2005] [error] [client 24.86.197.147] File does not exist: /home/edaly/public_html/favicon.ico
[Sat Nov  5 13:35:57 2005] [error] [client 24.86.197.147] File does not exist: /home/edaly/public_html/favicon.ico

Here's the debug info from Coppermine:

Quote
USER:
------------------
Array
(
    [ID] => af9c42d54660ed7b18be165ca358cdcc
    [am] => 1
    [liv] => Array
        (
           
  • => 114
                [1] => 115
                [2] => 144
                [3] => 118
                [4] => 202
            )

    )

    ==========================
    USER DATA:
    ------------------
    Array
    (
        [user_id] => 1
        [user_group] => 1
        [user_active] => YES
        [user_name] => edaly
        [user_password] => ********
        [user_lastvisit] => 2005-11-01 13:24:08
        [user_regdate] => 2005-04-29 17:39:35
        [user_group_list] =>
        [user_email] =>
        [user_website] =>
        [user_location] =>
        [user_interests] =>
        [user_occupation] =>
        [user_actkey] =>
        [disk_max] => 0
        [disk_min] => 0
        [can_rate_pictures] => 0
        [can_send_ecards] => 0
        [ufc_max] => 3
        [ufc_min] => 3
        [custom_user_upload] => 0
        [num_file_upload] => 5
        [num_URI_upload] => 3
        [can_post_comments] => 1
        [can_upload_pictures] => 1
        [can_create_albums] => 1
        [has_admin_access] => 1
        [pub_upl_need_approval] => 0
        [priv_upl_need_approval] => 0
        [group_name] => Administrators
        [upload_form_config] => 3
        [group_quota] => 0
        [can_see_all_albums] => 1
        [group_id] => 1
        [groups] => Array
            (
                [1] => 1
            )

    )

    ==========================
    Queries:
    ------------------
    Array
    (
       
  • => SELECT extension, mime, content FROM cpg133_filetypes;
        [1] => SELECT * FROM cpg133_users WHERE user_id='1'AND user_active = 'YES' AND user_password != '' AND BINARY MD5(user_password) = '******'
        [2] => SELECT MAX(group_quota) as disk_max, MIN(group_quota) as disk_min, MAX(can_rate_pictures) as can_rate_pictures, MAX(can_send_ecards) as can_send_ecards, MAX(upload_form_config) as ufc_max, MIN(upload_form_config) as ufc_min, MAX(custom_user_upload) as custom_user_upload, MAX(num_file_upload) as num_file_upload, MAX(num_URI_upload) as num_URI_upload, MAX(can_post_comments) as can_post_comments, MAX(can_upload_pictures) as can_upload_pictures, MAX(can_create_albums) as can_create_albums, MAX(has_admin_access) as has_admin_access, MIN(pub_upl_need_approval) as pub_upl_need_approval, MIN( priv_upl_need_approval) as  priv_upl_need_approval FROM cpg133_usergroups WHERE group_id in (1)
        [3] => SELECT group_name FROM  cpg133_usergroups WHERE group_id= 1
        [4] => DELETE FROM cpg133_banned WHERE expiry < '2005-11-05 13:39:25'
        [5] => SELECT * FROM cpg133_banned WHERE ip_addr='24.86.197.147' OR ip_addr='24.86.197.147' OR user_id=1
        [6] => SELECT aid, title FROM cpg133_albums WHERE category < 10000 ORDER BY title
        [7] => SELECT aid, title FROM cpg133_albums WHERE category='10001' ORDER BY title
        [8] => SELECT encoded_string FROM cpg133_temp_data WHERE unique_ID = '7620c158'
        [9] => UPDATE cpg133_temp_data SET encoded_string = 'YToxOntpOjA7YTozOntzOjExOiJhY3R1YWxfbmFtZSI7czoxMjoiODc5Xzc5NjAuSlBHIjtzOjE0OiJ0ZW1wb3JhcnlfbmFtZSI7czoyMzoibUhUVFBfdGVtcF9hY2VlM2FkZC5KUEciO3M6MTI6InByZXZpZXdfcGF0aCI7czozNDoiLi9hbGJ1bXMvZWRpdC9wcmV2aWV3XzVjNWMzZTY2LkpQRyI7fX0=' WHERE unique_ID = '7620c158'
        [10] => SELECT category FROM cpg133_albums WHERE aid='11'
        [11] => SELECT name FROM cpg133_categories WHERE cid='10001'
        [12] => SELECT category FROM cpg133_albums WHERE aid='2'
        [13] => SELECT name FROM cpg133_categories WHERE cid='10001'
        [14] => SELECT category FROM cpg133_albums WHERE aid='5'
        [15] => SELECT name FROM cpg133_categories WHERE cid='10001'
        [16] => SELECT category FROM cpg133_albums WHERE aid='14'
        [17] => SELECT name FROM cpg133_categories WHERE cid='10001'
        [18] => SELECT category FROM cpg133_albums WHERE aid='18'
        [19] => SELECT name FROM cpg133_categories WHERE cid='10001'
        [20] => SELECT category FROM cpg133_albums WHERE aid='13'
        [21] => SELECT name FROM cpg133_categories WHERE cid='10001'
        [22] => SELECT category FROM cpg133_albums WHERE aid='12'
        [23] => SELECT name FROM cpg133_categories WHERE cid='10001'
        [24] => SELECT category FROM cpg133_albums WHERE aid='15'
        [25] => SELECT name FROM cpg133_categories WHERE cid='10001'
        [26] => SELECT category FROM cpg133_albums WHERE aid='28'
        [27] => SELECT name FROM cpg133_categories WHERE cid='10001'
        [28] => SELECT category FROM cpg133_albums WHERE aid='25'
        [29] => SELECT name FROM cpg133_categories WHERE cid='10001'
        [30] => SELECT category FROM cpg133_albums WHERE aid='22'
        [31] => SELECT name FROM cpg133_categories WHERE cid='10001'
        [32] => SELECT category FROM cpg133_albums WHERE aid='7'
        [33] => SELECT name FROM cpg133_categories WHERE cid='10001'
        [34] => SELECT category FROM cpg133_albums WHERE aid='6'
        [35] => SELECT name FROM cpg133_categories WHERE cid='10001'
        [36] => SELECT category FROM cpg133_albums WHERE aid='23'
        [37] => SELECT name FROM cpg133_categories WHERE cid='10001'
        [38] => SELECT category FROM cpg133_albums WHERE aid='17'
        [39] => SELECT name FROM cpg133_categories WHERE cid='2'
        [40] => SELECT category FROM cpg133_albums WHERE aid='24'
        [41] => SELECT name FROM cpg133_categories WHERE cid='2'
        [42] => SELECT category FROM cpg133_albums WHERE aid='21'
        [43] => SELECT name FROM cpg133_categories WHERE cid='2'
        [44] => SELECT category FROM cpg133_albums WHERE aid='19'
        [45] => SELECT name FROM cpg133_categories WHERE cid='2'
    )

    ==========================
    GET :
    ------------------
    Array
    (
    )

    ==========================
    POST :
    ------------------
    Array
    (
        [unique_ID] => 7620c158
        [control] => phase_2
    )

    ==========================
    VERSION INFO :
    ------------------
    PHP version: 4.4.0 - OK
    ------------------
    mySQL version: 4.0.25-standard-log
    ------------------
    Coppermine version: 1.3.5
    ==========================
    Module: gd
    ------------------
    GD Support enabled
    GD Version bundled (2.0.28 compatible)
    FreeType Support enabled
    FreeType Linkage with freetype
    GIF Read Support enabled
    GIF Create Support enabled
    JPG Support enabled
    PNG Support enabled
    WBMP Support enabled
    XBM Support enabled
    ==========================
    Module: mysql
    ------------------
    Active Persistent Links 0
    Active Links 1
    Client API version 4.0.25
    MYSQL_MODULE_TYPE external
    MYSQL_SOCKET /var/lib/mysql/mysql.sock
    MYSQL_INCLUDE -I/usr/include/mysql
    MYSQL_LIBS -L/usr/lib -lmysqlclient 
    ==========================
    Module: zlib
    ------------------
    ZLib Support enabled
    Compiled Version 1.2.3
    Linked Version 1.1.4
    ==========================
    Server restrictions (safe mode)?
    ------------------
    Directive | Local Value | Master Value
    safe_mode | Off | Off
    safe_mode_exec_dir | /usr/local/php/bin | /usr/local/php/bin
    safe_mode_gid | Off | Off
    safe_mode_include_dir | no value | no value
    safe_mode_exec_dir | /usr/local/php/bin | /usr/local/php/bin
    sql.safe_mode | Off | Off
    disable_functions | no value | no value
    file_uploads | On | On
    include_path | .:/usr/lib/php | .:/usr/lib/php
    open_basedir | no value | no value
    ==========================
    email
    ------------------
    Directive | Local Value | Master Value
    sendmail_from | no value | no value
    sendmail_path | /usr/sbin/sendmail -t -i  | /usr/sbin/sendmail -t -i 
    SMTP | localhost | localhost
    smtp_port | 25 | 25
    ==========================
    Size and Time
    ------------------
    Directive | Local Value | Master Value
    max_execution_time | 300 | 300
    max_input_time | 600 | 600
    upload_max_filesize | 10M | 10M
    post_max_size | 20M | 20M
    ==========================
    Page generated in 4.032 seconds - 46 queries in 0.103 seconds - Album set :
Here's some info on the server from CPanel:

Quote
Operating system   Linux   
Service Status   Click to View   
Kernel version   2.4.31-grsec   
Machine Type   i686   
Apache version   1.3.34 (Unix)   
PERL version   5.8.4   
PHP version   4.4.0   
MySQL version   4.0.25-standard

I've contacted the service provider's tech support and they don't seem to have a clear idea what's causing it.  They told me they had changed the file permissions (on what dir they didn't say), and to try again, which I did (same error).


edaly

Tranz

http://forum.coppermine-gallery.net/index.php?topic=5843.0

Thank you for the detailed report. If only other folks would provide so much info to help us help them.

edaly

Thanks.. I had reviewed that post before, and increased the resource limits in php.ini, but this did make me question whether my php.ini settings were being used.  And lo and behold, I did a test with a very small image (600x350 pixels), and I was able to add it properly!

This makes me think that even though the resource limits are set high, perhaps the server is overriding them somehow.

From php.ini:
max_execution_time = 300     ; Maximum execution time of each script, in seconds
max_input_time = 600        ; Maximum amount of time each script may spend parsing request data
upload_max_filesize=10M
post_max_size=20M
memory_limit=30M


Just to clarify, here is exactly where it fails:

Choose file to upload:
(https://coppermine-gallery.com/forum/proxy.php?request=http%3A%2F%2Fwww.tellureonline.com%2FcoppermineDebugging%2FDebug_Upload_01.jpg&hash=ba5a24f037fe82e687eda38e4b401049f59edade)

File is uploaded successfully:
(https://coppermine-gallery.com/forum/proxy.php?request=http%3A%2F%2Fwww.tellureonline.com%2FcoppermineDebugging%2FDebug_Upload_02.jpg&hash=7de8c7df53a2798e0a682248d5fb51c0bea66bf6)

Place file in album:
(https://coppermine-gallery.com/forum/proxy.php?request=http%3A%2F%2Fwww.tellureonline.com%2FcoppermineDebugging%2FDebug_Upload_03.jpg&hash=4579ab8dbf9357e71488c35fdac4a924929d6a0f)

Click continue, get Internal Server Error:
(https://coppermine-gallery.com/forum/proxy.php?request=http%3A%2F%2Fwww.tellureonline.com%2FcoppermineDebugging%2FDebug_Upload_04.jpg&hash=88ad9db46c38b866ddaf66f76f7b4459c415d396)


Since the error happens after the file has been successfully uploaded, perhaps its ImageMagick that is causing the problem?


edaly

xplicit

Don't ask me: Can you do this .... or Give me that...or I need Quick help in PM's. I'm not Santaclaus so post your questions on the board so it will be in the benefit for everyone.

edaly

Wow, I'm really sorry about that.  A little while ago I asked my girlfriend (who knows a lot more about HTML than me) to modify the theme to make it more minimalist.  I didn't know she had removed the Powered by Coppermine line.

I just asked her to put it back and she did.


edaly

Joachim Müller

Quote from: edaly on November 06, 2005, 03:32:21 AM
I just asked her to put it back and she did.
As far as I can see she didn't - I still can't see it when accessing http://www.tellureonline.com/photos/

edaly

Have you tried hitting F5 to reload the page?  It shows up for me:

(https://coppermine-gallery.com/forum/proxy.php?request=http%3A%2F%2Fwww.tellureonline.com%2FcoppermineDebugging%2FDebug_Upload_05.jpg&hash=00d1bc43711fed60c6e4b56183697c4948c135e8)


edaly

Tranz

No, that's not the same as the original. It doesn't have a link to the project's home page. How are people to learn more about Coppermine if they want their own?

edaly

Further apologies.  Link should be working now.


edaly

edaly

So any thoughts on the Internal Server Error problem?  I'm not getting very far with the service provider tech support.


edaly

edaly

I've created a test account, so anyone can test uploading a file if this will help with debugging.  The account info is:

login: test
password: test

Also, I noticed there is a "Display php info" in the Admin tools section.  Here is what it prints out:

Quote
System      Linux titan.nswebhost.com 2.4.31-grsec #4 SMP Sat Aug 6 05:31:49 CDT 2005 i686    

Build Date      Oct 30 2005 19:46:30    

Configure Command       './configure' '--prefix=/usr' '--with-xml' '--enable-bcmath' '--enable-calendar' '--with-curl' '--with-dom' '--with-dom-xslt' '--with-dom-exslt' '--enable-exif' '--with-swf=/usr/local/flash' '--enable-ftp' '--with-gd' '--with-jpeg-dir=/usr/local' '--with-png-dir=/usr' '--with-xpm-dir=/usr/X11R6' '--with-gettext' '--with-imap' '--with-imap-ssl' '--with-kerberos' '--enable-mbstring' '--enable-mbstr-enc-trans' '--enable-mbregex' '--with-mcrypt' '--with-mhash' '--with-ming=../ming-0.2a' '--enable-magic-quotes' '--with-mysql=/usr' '--with-openssl' '--enable-discard-path' '--with-pdflib' '--with-pear' '--with-pgsql=/usr' '--with-pspell' '--enable-xslt' '--with-xslt-sablot' '--enable-sockets' '--enable-track-vars' '--with-ttf' '--with-freetype-dir=/usr' '--enable-gd-native-ttf' '--enable-versioning' '--enable-wddx' '--with-xmlrpc' '--with-zip' '--with-zlib'    

Server API                              CGI    
Virtual Directory Support               disabled    
Configuration File (php.ini) Path       /home/edaly/public_html/photos/php.ini    
PHP API                                     20020918    
PHP Extension                             20020429    
Zend Extension                             20050606    
Debug Build                             no    
Zend Memory Manager              enabled    
Thread Safety                             disabled    
Registered PHP Streams              php, http, ftp, https, ftps, compress.zlib

I also ran the Update Database function, and it did do a few updates (most were marked "Already Done").  However this didn't solve the problem.. I still get the Internal Server Error after when adding the uploaded picture to an Album.

Any help greatly appreciated..


edaly

Joachim Müller

I was able to upload just fine - see http://tellureonline.com/photos/displayimage.php?pos=-478
Make sure you don't use images that are to big in size or dimensions. Refer to the sticky thread on this board to get an idea what server-sided settings may keep you from uploading hires pics. Setting the max file size in coppermine's config won't do you any good if the server is not capable to process it. After all, an internal server error is just that: the server encountered an error, so the script didn't have a chance to create a meaningful error message. You'll have to find out using your server logs.

edaly

Thanks very much.  I'll try to get more info from the service provider.  The only error log I have access to via cPanel is not very descriptive ("Premature end of script headers: /home/edaly/public_html/photos/upload.php").  Again, thanks for the testing and recommendations.


edaly

edaly

Looks like it's the service provider that caused this problem:

"Hello,

New resource limits have been implemented. We notified our clients
about this by email.
It could have caused the issue.

Should you have any questions or require any assistance, we are always
at your service."

Guess I need to find an new hosting company..


edaly

edaly

Site is working again!  They made a change in the server's php.ini and it's working now.  Here's what the service provider tech support wrote:

"Hello,

I have fixed your issue. I have used our php.ini and change the max file size to 10MB for you. It was the PHP.ini file."

This thread can be closed.. problem was decidedly server-side.


edaly