Upload media / Select files button not working (Wordpress / Ubuntu 14.04)

March 13, 2017 225 views
Apache WordPress Ubuntu

Help needed!

I am having a hard time understanding why is the "select files" on media uploads view not working on a couple of my wordpress (version : 4.7.3 ) sites hosted on my Ubuntu 14.04 droplet. It seems that the issue is only with Chrome though. Whenever I click on "select files" button in Media>Library>Add New, the pop up window doesn't appear.

I have already tested changing the themes, and I also verified that its not a wordpress update bug, since I have another wordpress site hosted in the same droplet, same wordpress version and that one is working fine.

It seems weird to me that the issue is only present in Chrome, makes me think some file permissions/security issue ? I honestly have no idea

I really need your help with this. Whoever is having the same issue please let me know

1 Answer

@josefano09

If the issue persists in just one browser, I'd be less likely to think it's a permissions issue -- instead, I'd be on the side saying it's an issue with WordPress or one of the plugins you've installed. Still, it never hurts to check file and directory permissions just to be sure.

Login to the CLI as your root or sudo user and navigate to the directory where the site is located. From there, you can use ls -al to view the user:group that currently owns each file and directory.

When it comes to stock installations of Apache using mod_php (which is what most use), the files and directories need to be owned by the same user that Apache is running as. In most cases, that's the www-data user unless you've changed it or it was previously set to something else. If you have a different setup, use the user you know works.

From there, you should be able to simply use chown to recursively change the user:group owner. If the current file or directory is already owned by that user, nothing will change. If a file or directory isn't owned by that user:group, then it will be after the command is ran.

So if WordPress is installed to /home/user/public/, we can run:

chown -R www-data:www-data /home/user/public/*
Have another answer? Share your knowledge.