Made changes to cakephp view files but changes not showing in browser - php

This one is quit puzzling to me. Please help
I baked a cake using root via ssh and everything went well except for the fact that i could not edit the view CTP files in dreamweaver. kept getting "access denied. Permission problem".
Via ssh and the cpanel i was able to change the permission to 755, 777. Got an error when attempted to change permission via dreamweaver
After changing file permission, I still got the error "access denied. permission problem.."
I then change the USER who owns the file using chown via ssh
I was then able to edit the file without error. I viewed the edited file via cpanel and realized that the changes took place. Bravo!
However, when i viewed the page in the browser, no changes were apparent.
I cleared the cache several times. My tmp folder is chmod 777
What am i missing?

Are you using Scaffolding perhaps? If so, disable it to see what happens.
Double check if these file names are correct too: Controller, View files and View folder.

Related

"failed to open stream: Permission denied" after 777 my entire app

I'm growing several grey hairs trying to work this one out.
All of a sudden in my Laravel project, I can't upload any files to my symlinked public/storage directly as it's complaining about permissions.
I then 777'ed every single file in the app (I know, I know), and it's still complaining about permissions. I've also run composer dump-autoload, which never seems to do anything but I thought I'd give it a go anyway.
Does anyone know what else I can try? I can verify everything is 777, so I can't see why any permissions would fail...
Gah, sorry guys, this was a bit of a red herring.
777'ing everything wasn't working because the uploaded files were being set to 644 (so my manual 777 was only being applied to files that already existed)
For future reference, if anyone's using Laravel and a queued job can't access a 644 file, set the file to 664 immediately after upload (apache owns the uploaded file, but www-data (or ec2-user) is the one trying to access when queued).
SE Linux might be a possible culprit, because the policies change in some cases, eg. when there are broken modules, it will mess up. that would be setsebool -P httpd_read_user_content 1 (if this should throw an error, manually deleting the broken modules is the only thing that helps).

php writes files that I can't access - windows IIS

I have a php page that writes files onto my local PC, into a specific folder named UploadedImages. This all works fine. The problem is that when I go to look at the file (always an image file -- a .png in this case), and double-click it, windows says I don't have permission to view it. Again, file permissions on the UploadedImages folder is wide open (Everyone -> Read/Write), and my login account has Full Control, and my login account is the Owner of the folder.
If I right-click the file and go into permissions, it shows that I have no permissions on the file. I can go in and grant myself ownership and permissions, then view it -- but it makes no sense that I have to do this every time.
How can I permanently solve this so that every file my php script writes into that folder I have automatic/full access to it?
I am running Windows 10, IIS 10.0 and PHP 5.6.11. It appears that IUSR account is getting the permissions, but why would I (the ADMIN on the folder) have all my rights revoked just because php writes a file there? Thank you.
One of solutions is try to run web server under certain user (not admin) to which you have full access rights.
Second possible solution: maybe your virtual host config contains directive which force server to work under admin or user to which you dont have access - try to change it.
#SweatCoder: You said:
Again, file permissions on the UploadedImages folder is wide open (Everyone -> Read/Write), and my login account has Full Control, and my login account is the Owner of the folder.
[...]
If I right-click the file and go into permissions, it shows that I have no permissions on the file. I can go in and grant myself ownership and permissions, then view it
This is what's called "inheritance". You need to set inheritance on the folder, so permissions on files are inherited from the parent directory.
//edit: see the icacls help information in cmd.exe:
icacls /?

WordPress - unable to upload images

I have a WordPress site on my webserver and have recently copied it to my localhost testing environment using XAMPP (bitnami) to work on it, and proceeded to re-upload the site back to the server without issue.
Now, everything is functioning fine except for uploading images. Whenever I attempt to upload them, it says it cannot write to the directory.
I have tried turning off date/time arrangement of images, I've tried manually creating the folder its trying to use and temporarily setting the permissions of it to 777 and it works. However, when I change them back to 755 it stops allowing uploads again.
Like I said this has only happened since copying my localhost wordpress back. I've read it may be due to the account WordPress is using to create/write files. Is there any way to find out what this account is? And how would I ensure it has the correct permissions? Could it somehow have inherited the Bitnami XAMPP WordPress account since I copied the files/DB over?
I have access to my sites cPanel if that helps.
don't change permissions change owner
sudo chown www-data:www-data /folderName

I can't upload files to a web page through code igniter

I'm new in the use of code igniter, however I have been having a problem while trying to upload files to a certain directory.
You see, I've tested the page in localhost, and I have no problem in uploading files in that situation, however, whenever I try to run that on server I keep getting the message that:"the directory doesn't appear to be writable". If I change the directory privileges to 777, fixes the problem, however that is a bad practice while developing a web page, and I would like it to keep the privileges in 775 at the least.
I have also found out that the executing 'whoami' I get the username 'wwwrun' so, is it possible to change the configuration of code igniter so that it runs with an user that owns that directory?
I really hope you can help me with this problem since, I haven't found a clear solution since I don't know where to begin...
you change the permssion before code igniter uploads, the folder should be owned by wwwrun and maybe in the wwwrun group, Maybe in the coders group ?
When its chowned to wwwrun having permission 700 or 750 will be fine

Setting permissions in Fedora Apache/PHP

I am building a Fedora server (on VirtualBox right now). It is running Fedora 15.
I want my PHP script to be able to edit the contents of a file in the same folder it is in.
The PHP script and the file are in /home/user/public_html/
But, when I call "file_put_contents("./theFile.txt")" I get an error saying that it cannot open the stream, permission denied.
So, I have:
- Made the file permissions 0777.
- Made the folder permissions 0777.
- Added the "apache" user to the group "wheel".
- Changed the user folder permissions to 0771.
- Changed the owner of the public_html folder and the text file to "apache:apache".
I am at my wits end and I have idea what to do next. Suggestions?
SELinux is preventing you from writing out the file. See the httpd_selinux(8) man page for ways to work with/around it.

Categories