file-permissions

file_put_contents permission denied

て烟熏妆下的殇ゞ 提交于 2019-11-26 06:31:24
问题 I am trying to write a query to a file for debugging. The file is in database/execute.php . The file I want to write to is database/queries.php . I am trying to use file_put_contents(\'queries.txt\', $query) But I am getting file_put_contents(queries.txt) [function.file-put-contents]: failed to open stream: Permission denied I have the queries.txt file chmod\'d to 777, what could the issue be? 回答1: Try adjusting the directory permissions. from a terminal, run chmod 777 database (from the

How to grant permission to users for a directory using command line in Windows?

杀马特。学长 韩版系。学妹 提交于 2019-11-26 05:54:46
问题 How can I grant permissions to a user on a directory (Read, Write, Modify) using the Windows command line? 回答1: As of Vista, cacls is deprecated. Here's the first couple of help lines: C:\>cacls NOTE: Cacls is now deprecated, please use Icacls. Displays or modifies access control lists (ACLs) of files You should use icacls instead. This is how you grant John full control over D:\test folder and all its subfolders: C:\>icacls "D:\test" /grant John:(OI)(CI)F /T According do MS documentation: F

How can I exclude all “permission denied” messages from “find”?

霸气de小男生 提交于 2019-11-26 04:57:01
问题 I need to hide all permission denied messages from: find . > files_and_folders I am experimenting when such message arises. I need to gather all folders and files, to which it does not arise. Is it possible to direct the permission levels to the files_and_folders file? How can I hide the errors at the same time? 回答1: Note: * This answer probably goes deeper than the use case warrants, and find 2>/dev/null may be good enough in many situations. It may still be of interest for a cross-platform

How do I give PHP write access to a directory?

自古美人都是妖i 提交于 2019-11-26 04:39:41
问题 I\'m trying to use PHP to create a file, but it isn\'t working. I am assuming this is because it doesn\'t have write access (it\'s always been the problem before). I tried to test if this was the problem by making the folder chmod 0777, but that just ended up making every script in that directory return a 500 error message until I changed it back. How do I give PHP write access to my file system so it can a create a file? Edit: It is hosted on Hostgator shared hosting using Apache. Edit 2:

Windows 7, update.packages problem: “unable to move temporary installation”?

天大地大妈咪最大 提交于 2019-11-26 03:36:54
问题 I am using R 2.13.0 with windows 7, after giving my user full privileges to the R folder (as described here). This allows me to install new packages just fine. However, when using update.packages(), to update existing packages, I keep getting the following error (for example, when updating the MASS package): package \'MASS\' successfully unpacked and MD5 sums checked Warning: unable to move temporary installation \'C:\\Program Files\\R\\R-2.13.0\\library\\file6cae3bcf\\MASS\' to \'C:\\Program

Cannot read configuration file due to insufficient permissions

不问归期 提交于 2019-11-26 03:31:57
问题 I\'ve recently encountered an error trying to host my asp.net site with IIS. I have found a solution that many swear by. Solution: Add IIS_IUSRS with Read permission on files in the folder Change IIS authentication method to BasicAuthentication refresh the website. It will work (http://vivekthangaswamy.blogspot.com/2009/07/aspnet-website-cannot-read.html) What do I add to my web.config file though? I\'ve never had to edit it before. Here is its current contents: <?xml version=\"1.0\"?> <!--

open() in Python does not create a file if it doesn&#39;t exist

狂风中的少年 提交于 2019-11-26 02:39:32
问题 What is the best way to open a file as read/write if it exists, or if it does not, then create it and open it as read/write? From what I read, file = open(\'myfile.dat\', \'rw\') should do this, right? It is not working for me (Python 2.6.2) and I\'m wondering if it is a version problem, or not supposed to work like that or what. The bottom line is, I just need a solution for the problem. I am curious about the other stuff, but all I need is a nice way to do the opening part. The enclosing

Retaining file permissions with Git

…衆ロ難τιáo~ 提交于 2019-11-26 02:05:31
问题 I want to version control my web server as described in Version control for my web server, by creating a git repo out of my /var/www directory . My hope was that I would then be able to push web content from our dev server to github, pull it to our production server, and spend the rest of the day at the pool. Apparently a kink in my plan is that Git won\'t respect file permissions (I haven\'t tried it, only reading about it now.) I guess this makes sense in that different boxes are liable to

How to set up file permissions for Laravel?

ⅰ亾dé卋堺 提交于 2019-11-25 23:58:39
问题 I\'m using Apache Web Server that has the owner set to _www:_www . I never know what is the best practice with file permissions, for example when I create new Laravel 5 project. Laravel 5 requires /storage folder to be writable. I found plenty of different approaches to make it work and I usually end with making it 777 chmod recursively. I know it\'s not the best idea though. The official doc says: Laravel may require some permissions to be configured: folders within storage and vendor