I have my files uploaded on Ubuntu server. Everything is working except file upload.
I have given the permission to all the files as 0644 and for the folders 0755.
As per the references i am supposed to change the folder permission to 0777 which i don't want to do.
Is there any other way to enable file upload on ubuntu server without changing the permission from 0755 to 0777 ?
Don't apply 777 permission to any of your files/folders in the server.
The files are not uploading mainly because of two reasons.
Incorrect ownership (user:group)
Incorrect upload path
This article will help to setup the proper file/folder ownership.
I hope this helps.
Related
I have an issue in a program that uploads files from html in my local server, into the /var/www/html/my_app directory.
In this directory I have changed the permission with:
sudo chmod -R 777
So I can save the photo that uploads in the directory inside my_app.
But here is the problem, when I upload a file inside the directory it always has the read permission.
Can I change that? So all the files I upload have permission.
chmod 777
move_uploaded-file always set permission to 600 for any uploaded file whatever configuration set in apache umask. you can use chmod in context with your code while uploading file and set permission.
chmod($target_path, 0664);
http://php.net/manual/en/function.move-uploaded-file.php In the comment section another users have same issue so they are describing same thing.
When I upload files through my cpanels file manager all my php file permissions are being changed to 0666 from what I read this is not secure + it is causing my WordPress to not function correctly. Normally web hosts have the permissions set to 0644 when uploading files. It would takes ages for me to change all files manually from 0666 to 0644. How can I change the permissions when I upload in cpanel? Should I try ftp and see if that makes a difference?
EDIT
When I upload the zip file it uploads as 0644 than when I extract the files inside are all turned into 0666.
Thanks
There is no need for you to re-upload all files to simply change permission for them.
Use your FTP client to change file permissions for files, directories and sub-directories.
You can do this via command-line SSH (if you have access).
I want to know that if we set the 777 permission on a folder to upload filed, do we need to set the permission of internal folders as well or it will work inside the external folder for which we have set the permission
exp.
images/newfolder
if we set the permission of images, newfolder will allow uploading files automatically or not?
Actually the answer is no. Setting 777 permissions on a folder does not guarantee that all sub folders are also having the permission 777. Unless you do that recursively. So check which OS you use and do that recursively. I use linux (Ubuntu) and I can do this
sudo chmod -R 777 /path/to/dir/
I can't get Fedora to allow med to delete installation files or write the configuration.php. I have chmod 777 all files and directories.
chown apache:apache all files.
It will work correctly if I copy the configuration.php to the directory. But then I can't upload templates because the joomla/tmp folder is not writable.
Any ideas how to get it to work?
Firstly, change back the file permissions. Do not make everything 777. Files should be 644 and folders should be 755.
The reason why you are not able to edit files or upload anything is due to the folder ownership. This is something that you hosting provider will need to sort out for you.
The actual problem was that SELINUX prevented apache from writing to disc.
I moved my WordPress website to another domain by same hosting provider.
At the previous webhosting the upload folder seemed to work with 755 CHMOD setup on uploads directory - all subdirectories were set to 755.
Now I'm facing a weird issue because the system threw an error that this folder is not writable under 755 setup.
So I changed the CHMOD setup of uploads dir to 777, uploaded the file and reverted back to 755. Weird thing is that the subdirs 2013/month are set automaticaly to 777 now and I can't change them.
I tried using recursion in FileZilla, but the response was
550 CHMOD 755 10: Operation not permitted
any suggestions how to resolve this?
thank you in advance for your posts.
I would contact your host and have them check the ownership and group of your folders/files. You may not have permission to change them yourself, which would explain the issues you're having in FileZilla.