Page 1 of 1

Error trying to ADD MEDIA: Unknown error occured...

Posted: Thu Jun 02, 2005 3:27 pm
by bpevans
I get the following error when trying to upload media to my server.
Running Serendipity 0.8.1 and PHP 4.3.9 with mysql Distrib 3.23.58, mageMagick 6.2.2 05/26/05 Q16, running on a smp Fedora Core 3 box.

In MANAGE DIRECTORIES I am able to create directories. File perms on upload are 777. I do not have SELinux enabled.
Adding image...

Unknown error occured, file not uploaded. Maybe your filesize is larger than the maximum size allowed by your server installation. Check with your ISP or edit your php.ini file to allow larger file size uploads.

Everything else seems to work; I even copied files over to the server and they seem to work just fine (thumbnails generated, use them in posts)

Any help or pointers? Didn't find anything specific in my searches. Apache error_log is equally helpless. (I need to find a debugging how-to for this)

On my QA box (same software) this upload works fine but it's got less history to it & I can't see what's different yet.

Re: Error trying to ADD MEDIA: Unknown error occured...

Posted: Thu Jun 02, 2005 6:17 pm
by garvinhicking
Have you checked the PHP.ini directive "file_uploads"? It surely is a php.ini problem or a HTTP_POST_MAX_SIZE problem. I know Apache also has possibilities to restrict HTTP POST sizes, but don'T know where exactly.

Regards,
Garvin

Posted: Fri Jun 03, 2005 12:32 am
by bpevans
I updated my php.ini prior to install, 12mb was set and i just dialed it back to 10mb. On my QA box the 2mb cap works fine for the same images I tried. The images i'm testing with are average of about 57k.
;;;;;;;;;;;;;;;;
; File Uploads ;
;;;;;;;;;;;;;;;;

; Whether to allow HTTP file uploads.
file_uploads = On

; Temporary directory for HTTP uploaded files (will use system default if not
; specified).
;upload_tmp_dir =

; Maximum allowed size for uploaded files.
upload_max_filesize = 10M
I can't find anything that looks relevant in httpd.conf
Any way to squeeze out some debug from s9y in this area?
[client 1.3.4.25] PHP Warning: File upload error - unable to create a temporary file in Unknown on line 0, referer: http://xxxxxxxxx.com//serendipity_admin ... =addSelect
//sorry i'm only on evening #2 with this stuff.
-barry

Posted: Fri Jun 03, 2005 1:08 am
by bpevans
i diffed httpd.conf's from my qa and prod boxes and they're identitcal.

All post, memory, & upload settings in php.ini are inline with values suggested at pre-install screen.

I've checked and re-check file permissions and ownership but still can't find the problem. Also didn't have any luck getting php to generate more logs .

advice appreciated.

Posted: Fri Jun 03, 2005 1:05 pm
by garvinhicking
The log snippet you posted gives the clue: The directory where the temporary files are stored in is not writable for the webserver.

Make sure your /tmp directory is world-writable and that the upload_location in php.ini is set to that path.

Regards,
Garvin

Posted: Fri Jun 03, 2005 3:01 pm
by bpevans
garvinhicking wrote: Make sure your /tmp directory is world-writable and that the upload_location in php.ini is set to that path.

Still no luck. Added the suggested property and set the similar one. Error remains the same.
/etc/php.ini wrote:; Whether to allow HTTP file uploads.
file_uploads = On

; Temporary directory for HTTP uploaded files (will use system default if not
; specified).
upload_tmp_dir =/tmp

; s9y forum suggestion
upload_location=/tmp

; Maximum allowed size for uploaded files.
upload_max_filesize = 10M

Posted: Fri Jun 03, 2005 4:11 pm
by garvinhicking
What does "ls -lad /tmp" output in your linux bash?

Regards,
Garvin

Posted: Fri Jun 03, 2005 4:21 pm
by bpevans
garvinhicking wrote:What does "ls -lad /tmp" output in your linux bash?
Man. :shock: Tunnel vision is crippling. I checked permissions a slew of times but never suspected that my /tmp directory got hosed. This must have happened a few days ago when I was fighting with mysql 4.1 problems.
An idiots linux box wrote:Scratchy$ ls -lad /tmp
drwxr-xr-x 14 mysql mysql 4096 Jun 3 09:51 /tmp
Scratchy$ chmod 777 /tmp
Scratchy$ chown root:root /tmp
A happy s9y install now wrote:Adding image...

File new-carry-collection.jpeg successfully uploaded as /var/www/html/uploads/new-carry-collection.jpg
Thumbnail created.
Done.

Thanks Garvin!

s9y rocks by the way. Still very happy i traded in PostNuke for s9y.

Posted: Wed Sep 21, 2005 9:40 pm
by Guest
I have exactly same problem. After going through this post, I have all settings correct like image size in php.ini and file permissions on /upload and /tmp directory.

The error is

Code: Select all

Adding image... 

Unknown error occured, file not uploaded. Maybe your filesize is larger than the maximum size allowed by your server installation. Check with your ISP or edit your php.ini file to allow larger file size uploads.
I tested this from inside the home network and from outside. I get this error only when I am inside the network. I am scratching my head if it was otherwise, I would have understood but I get this error within network.

Is there a way, I can see the log generated through php so that I know where the real issue is?

:arrow: Thanks for your help.

Posted: Wed Sep 21, 2005 10:23 pm
by garvinhicking
Guest: Yes, PHP creates a logfile if you set the error_log in your php.ini file.

Your error really sounds strange - can you check with a different browser, maybe it's an issue of the browser? Or maybe the vhost is configured differently when accessed from the outside? Also check your apache error log.

You can edit your include/admin/images.inc.php file and look for this line:

Code: Select all

                } else {
                    echo ERROR_UNKNOWN_NOUPLOAD . '<br />';
                }
change this to:

Code: Select all

                } else {
                    print_r($_FILES);
                    echo ERROR_UNKNOWN_NOUPLOAD . '<br />';
                }
Regards,
Garvin

Posted: Thu Sep 22, 2005 8:03 am
by wesley
You know, this reminds me of that last bugfix. The error message really
needs to be disambiguified.