Jump to content

Image and file uploads not working ("flock() has been disabled")


Recommended Posts

Posted

After moving my clients site the image and file uploads stopped working. When trying to upload an image I get this error in the console: 

?id=1:1 Uncaught SyntaxError: Unexpected token < in JSON at position 0
    at JSON.parse (<anonymous>)
    at Function.parseJSON (JqueryCore.js?v=1510128475:2)
    at XMLHttpRequest.<anonymous> (InputfieldImage.js?v=119-1512211887:1433)

A neverending upload process starts and when I reload the page I get this error:

Warning: flock() has been disabled for security reasons in /www/w/8/4/0/3/w8403104/html/wire/core/FileLog.php on line 89

If the image field is inside a repeater the image is uploaded, but nothing is visible inside PW. The image gets uploaded to the server but permissions are always set to 600, if I change the permissions manually to 640 the image is visible. I've tried with different permissions in config.php, but the problem persists.

The site is on a shared webspace at a bigger provider with quite a lot of restrictions (chmod not allowed). I've been going back and forth with the hostmaster about these issues, but that hasn't been fruitful.

Is there anything else I could try? Any chance of getting PW to work on this server? 

Posted
1 minute ago, nikoka said:

No, unfortunately they don't give access to php.ini.

Then unless they will change it for you, I think you are out of luck.

Posted

Was just about to say something about how flock() alone probably won't be a massive problem – it's only used in FileLog, so with it disabled ProcessWire won't be able to write anything to log files, but technically speaking everything else should still work – but the chmod issue sounds like a real showstopper.

Some hosting providers have their own guides for configuring things like uploads "properly", but honestly speaking it sounds like you should look into switching to another hosting provider as soon as possible. This one sounds like a major pain in the a*s.

Posted

Ouch, yeah I was afraid the chmod issue would be a problem. I'm amazed of all the restrictions this provider (Elisa) has set up, but they insist WordPress, Drupal and Joomla users have no problem with this.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...