I am observing a strange error message when trying to upload an mp3 file via the panel.
The loading bar progresses up to 100% and then it tells me within the upload modal: “the file has not been found”.
I honestly have no clue where to even start looking with this problem.
We are running
PHP Version 5.4.40-1~dotdeb+squeeze.1
and Apache 2.0
if that is of any importance…
I tried different files and other files (even smaller mp3s) work… therefore I suspect its the file size, because its about 12MB big but I couldn’t find anything that hints to a maximum upload file size.
When searching for the error message on google I find a link to the old forum, but the post has been deleted.
As regards the file size itself, is that on a remote server where maybe the file size is restricted by php? You might have to adjust your upload_max_filesize and post_max_size in your php.ini
So my server admin changed the upload_max_filesize appropriately, but the error persists.
I then reckon it’s more of a problem of the server not being setup quite right than a kirby-related problem.
Therefore I will try to seek help elsewhere
If anyone else encounters this error, I started to look for php upload issues and there are plenty of things to look for.
So we have not been able to overcome this problem yet. We assume it may stem from the user-/group-permission setup and how that works with the panel. But we are not sure.
What would be a basic approach to setting up the server for Kirby?
From what I hear from my server admin, there is the www-data user which is the regular user but also the one that would be editing content via the panel. If that user is not allowed to do this, the panel becomes inaccessible (“check folder permissions” etc.). But, if they do get the permission, we see different security issues there, since Kirby doesn’t use a Database and the user needs to have permission to edit content inside the www folder structure. Or are we doing something inherently wrong?
Another user would be the FTP user which I apparently used to upload Kirby cms.
The server admin now added the www-data user to a group which the ftp-user is in as well and now I can create and delete pages and edit content, but I cannot upload any files. It still says “The file has not been found”.
The permissions are currently set to 775. I found the Wordpress article for setting permissions but it hasnt been helpful in the sense, that if I set permissions to 755 for folders and 644 for files, I can’t edit content anymore via the panel and the problem may lie in the general user/group setup which I personally wouldn’t know how to set up normally.
I am really grateful for any help on this, I have had a lot of trouble wrapping my head around this the past month! Especially since I am anything but a server admin, I usually don’t mess with that kinda stuff
Setting permissions to 775 can be (depending on the server and if it is used by other people and sites as well) quite dangerous, as everyone on the server will be able to read every file.
I’d recommend setting the file and directory owner to the www-data user for the content directory and the cache and thumbs directories (every directory that gets modified by Kirby). After that you won’t be able to modify these files/directories via FTP, but as you are using the Panel you probably won’t have to do that anyway.
The file upload issue can have very many reasons (as you wrote previously). Does a very simple file upload demo script work (simply use an example from somewhere, for example from the PHP docs)? If it doesn’t, you might be able to track down the issue by printing out the file data array $_FILES.
Regarding the php file upload, after uploading the file with a simple php upload script, like you said, the upload.php script page opens and shows nothing, although it should print “Success” when it is finished
If I tell it to print the array $_FILES it of course does the same (no)thing.
Are referring to the PHP Upload Test Script or the Panel Upload?
In both cases I don’t get HTTP 500.
With the test script the page is blank after upload and the body empty. Not sure if I’m doing something wrong with the upload script, but when I press upload, it opens the upload.php (which is the script) and the page is empty. Is it supposed to do that at all?
I saw that there is an error in the code that makes it not work even if your server setup was OK: The field in the HTML is called fileToUpload, but the PHP code checks for a file named image. But even when changing the form to use image as field name, it still doesn’t work.
Could you please insert a var_dump($_FILES) as the first line of the uploader.php script so I can test what error code (which is included in the array) PHP sets when uploading a file?
I’m puzzled as well.
While I was hoping for a simpler solution, I honestly suspected that the server might be setup inherently wrong. Unfortunately I have no access to the command line and such.
Maybe the the admin should do a complete wipe and start from scratch.
But a million thanks for taking the time to worry about my problems!