Recent Topics

1 Jun 06, 2011 04:59    

My b2evolution Version: 4.0.5

Hi, I've checked and made sure my file upload settings allow 8 megs/8000kb in php ini, and in my blog file settings, dir permissions are as created by b2 during it's install. (775 for blogs/media/blogs I believe - tried changing it to 777, made no difference)

Whenever I try to upload a file in the back office I get the message:

The file does not seem to be a valid upload! It may exceed the upload_max_filesize directive in php.ini.

This happens even with a 30 kb jpeg. I've checked google and the b2 board for solutions and haven't found any reasons to explain this.

Problem occurs while logged in as an admin user/blog owner set to level 5 permissions and the super admin set to level 10.

I noticed at http://doc.b2evo.net/HEAD.bak/__filesource/fsource_admin__blogsincfilesupload.ctrl.php.html that this code may have something to do with it:

        if( ! isset($_FILES['uploadfile']['_evo_fetched_url'][$lKey]) // skip check for fetched URLs
            && ! is_uploaded_file( $_FILES['uploadfile']['tmp_name'][$lKey] ) )
        { // Ensure that a malicious user hasn't tried to trick the script into working on files upon which it should not be working.
            $failedFiles[$lKey] = T_('The file does not seem to be a valid upload! It may exceed the upload_max_filesize directive in php.ini.');
            // Abort upload for this file:
            continue;
        }

but that's just a guess as nothing is showing up in the servers logs.

Any hints? I had at one time successfully uploaded one file from the back office but am now unable to. Thought I'd stop over here and ask before I resort to re-installing the b2 and starting over.

Thanks.

2 Jun 09, 2011 19:11

No suggestions as of yet? I'm not wanting to post the url publicly. Besides I'd have to allow someone to log in to see the issue for themselves. If I'm just not getting a response because I haven't posted the url then perhaps just PM me.

3 Jun 10, 2011 00:47

Do you already have any files uploaded? Try removing all directories from /blogs/media/blogs/ then go to b2evo file manager and it will create blog directories with correct permissions.

PM me your b2evo and FTP passwords, I'll check what's wrong with your installation.

4 Jun 10, 2011 06:46

I did have one file uploaded already that was quite small - under 100kb.
I tried your suggestion - before doing so I noticed that in the file upload settings I had set the dir permissions to 775 and file permissions to 664, so I changed the dir permission to 777, removed the directories from blogs/media/blogs as you suggested

- the file manager did recreate the folders
- same problem persisted
- trying to upload a file keeps returning that same message regardless of file size and whether I'm using the quick upload or the main file upload and happens regardless of what dir/blog I select to upload the file to. This is being tested as admin with set to level 10 with all privileges checked off and has previously been tested as the blog owner (admin, set to level 5, all permissions checked off)

So I'll pm you access in just a minute.

5 Jun 10, 2011 19:43

I fixed the error by adding the following string to .htaccess file

php_value date.timezone "America/Los_Angeles"

You should edit php.ini too if you have access, or let the support know about their broken PHP config.

6 Jun 10, 2011 19:48

By the way you should set file permissions to more restrictive since php runs as user. It's safe to use 755/644 or even 750/640

7 Jun 10, 2011 19:59

I fixed the error by adding the following string to .htaccess file
Code:
php_value date.timezone "America/Los_Angeles"

LOL. You can't be serious. I saw that in the error logs and I've encountered that with other PHP scripts but typically it's just been a warning and I haven't seen it interfere with script behavior. I thought about adding that just in case there was some file creation error due to the date but thought No, it can't be that.

Prior to this thread I did have it at 775/644 - I modified it to 777/644 for testing to make sure it wasn't a permission issue - I have worked with lousy scripts before that require 777 to be able to upload files or they don't work. But then B2 Evo is anything BUT lousy. I'll change it back asap. 750/640 sounds good.

That php change is problematic - I don't understand why PHP shouldn't just assign itself to whatever time zone the server environment is currently set to. Oh well, it doesn't.

Thanks for your help Sam.
Next payday is donation time.

8 Jun 10, 2011 20:19

No problem.
This timezone warning is very common on servers with PHP 5.

9 Jun 10, 2011 20:28

So I'm noticing. :roll:

:)


Form is loading...