File could not be uploaded or revised

Our OJS was working fine until a few days ago we got the error message when trying to upload a “cover image” then when I tried to upload a pdf it gave a http error. Iv’e read other possible solutions and checked permissions, all looks good but still change permissions on the .php file mentioned in the error_log but still didn’t work so I reversed it to what it was before. The error_log shows a permission issue.

Appreciate any help please.

Hi @lvaiaoga

It isn’t a permission problem with your PHP files, but rather a problem with your cache/ folder. The warning is just being generated by the PHP file mentioned in the log entry. That cache/ folder needs to be writable by your webserver or whoever your PHP scripts run as.

Cheers,
Jason

Hi jnugent,

Thank you for the reply. Any suggestions how can I fix this error?

I did try giving writable access to that cache folder and files. I did 777 just to test it but it still gave the following error. I attached the error i’m getting now. The user is apache which is what we always used and was working until a few days ago. We didn’t do any updates to changes. Thanks for your help

ojs%20file%20permissions

Hi @lvaiaoga

That’s the wrong cache folder. You don’t want to change the classes responsible for the cache code, but rather the cache itself. Look carefully at the path in your error message. It’s /opt/ojs/311/cache

Cheers,
Jason

Hi jnugent,

Thank you for pointing that out. Sorry about that. I went the directory as you mentioned and it does look like the owner which is apache already has writable rights. I am fairly new to linux so excuse me if I miss something but im excited to learn something new every time haha. I will attach what I’m looking at. Any advise is appreciated.

Out of curiosity, where is your files_dir pointing to in your config.inc.php file, and what are the permissions on that?

Cheers
Jason

Hopefully this is what you are asking for. Thank you.OJS4 ojs5