# Bake produce warning (512) and warning (2)

**URL:** <https://discourse.cakephp.org/t/bake-produce-warning-512-and-warning-2/8865>\
**Category:** Need Help\
**Tags:** help\
**Created:** [January 15, 2021, 3:27pm UTC](https://discourse.cakephp.org/t/bake-produce-warning-512-and-warning-2/8865 "2021-01-15T15:27:09Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![xyhuang](https://avatars.discourse-cdn.com/v4/letter/x/e9c0ed/32.png) [@xyhuang](https://discourse.cakephp.org/u/xyhuang)\
**Post date:** [January 15, 2021, 3:27pm UTC](https://discourse.cakephp.org/t/bake-produce-warning-512-and-warning-2/8865/1 "2021-01-15T15:27:09Z")

</div>

I have not made any of my own edits on the framework. Please help.

I tried to bake in the console and from what I can tell, the bake was successful.

 ![image](https://canada1.discourse-cdn.com/flex029/uploads/cakephp/original/2X/a/a6c8bc4c091e7d1850aa9026c3341e3eccd72c0c.png)  
 ![image](https://canada1.discourse-cdn.com/flex029/uploads/cakephp/original/2X/3/3f4e4963f8ac1fbcdbbea24abb2264e068a77a65.png)

However, when I open the site, I see:  
[**Warning** (2)](javascript:void(0);): file\_put\_contents(/home/sftp/keyadmin/pkm/logs/error.log): failed to open stream: Permission denied [**CORE/src/Log/Engine/FileLog.php** , line **131**]

**Warning** : file\_put\_contents(/home/sftp/keyadmin/pkm/logs/error.log) [[function.file-put-contents](https://secure.php.net/function.file-put-contents)]: failed to open stream: Permission denied in **/home/sftp/keyadmin/pkm/vendor/cakephp/cakephp/src/Log/Engine/FileLog.php** on line **131**

**Warning** : file\_put\_contents(/home/sftp/keyadmin/pkm/logs/error.log) [[function.file-put-contents](https://secure.php.net/function.file-put-contents)]: failed to open stream: Permission denied in **/home/sftp/keyadmin/pkm/vendor/cakephp/cakephp/src/Log/Engine/FileLog.php** on line **131**

**Warning** : file\_put\_contents(/home/sftp/keyadmin/pkm/logs/error.log) [[function.file-put-contents](https://secure.php.net/function.file-put-contents)]: failed to open stream: Permission denied in **/home/sftp/keyadmin/pkm/vendor/cakephp/cakephp/src/Log/Engine/FileLog.php** on line **131**

**Warning** : file\_put\_contents(/home/sftp/keyadmin/pkm/logs/error.log) [[function.file-put-contents](https://secure.php.net/function.file-put-contents)]: failed to open stream: Permission denied in **/home/sftp/keyadmin/pkm/vendor/cakephp/cakephp/src/Log/Engine/FileLog.php** on line **131**

**Warning** : file\_put\_contents(/home/sftp/keyadmin/pkm/logs/error.log) [[function.file-put-contents](https://secure.php.net/function.file-put-contents)]: failed to open stream: Permission denied in **/home/sftp/keyadmin/pkm/vendor/cakephp/cakephp/src/Log/Engine/FileLog.php** on line **131**

---

<div class="post-metadata">

**Author:** ![Zuluru](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/zuluru/32/1230_2.png) [@Zuluru](https://discourse.cakephp.org/u/Zuluru)\
**Post date:** [January 15, 2021, 3:31pm UTC](https://discourse.cakephp.org/t/bake-produce-warning-512-and-warning-2/8865/2 "2021-01-15T15:31:57Z")

</div>

It’s having problems writing to your log files. That’s nothing to do with bake, it’s almost certainly just a permissions issue on your logs folder.

---

<div class="post-metadata">

**Author:** ![xyhuang](https://avatars.discourse-cdn.com/v4/letter/x/e9c0ed/32.png) [@xyhuang](https://discourse.cakephp.org/u/xyhuang)\
**Post date:** [January 15, 2021, 3:33pm UTC](https://discourse.cakephp.org/t/bake-produce-warning-512-and-warning-2/8865/3 "2021-01-15T15:33:33Z")

</div>

How can I fix it? Where do I go?  
 ![image](https://canada1.discourse-cdn.com/flex029/uploads/cakephp/original/2X/c/cf80f6719505c7d9be464932868efaa2ed7d9bcd.png)

---

<div class="post-metadata">

**Author:** ![Zuluru](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/zuluru/32/1230_2.png) [@Zuluru](https://discourse.cakephp.org/u/Zuluru)\
**Post date:** [January 15, 2021, 4:08pm UTC](https://discourse.cakephp.org/t/bake-produce-warning-512-and-warning-2/8865/4 "2021-01-15T16:08:38Z")

</div>

It depends on many factors. Generically, the logs folder and any files in it need to have write permission for whatever user your web service is running as. There’s at least three system-specific things in there (what OS you’re on, what you’re using for your web server, and how that server is configured). But there’s a million tutorials out there about how to set permissions.

---

<div class="post-metadata">

**Author:** ![xyhuang](https://avatars.discourse-cdn.com/v4/letter/x/e9c0ed/32.png) [@xyhuang](https://discourse.cakephp.org/u/xyhuang)\
**Post date:** [January 15, 2021, 4:17pm UTC](https://discourse.cakephp.org/t/bake-produce-warning-512-and-warning-2/8865/5 "2021-01-15T16:17:08Z")

</div>

> **[How to change directory permissions in Linux](https://www.pluralsight.com/blog/it-ops/linux-file-permissions)**
>
> Learn how to change directory permissions in Linux for individuals, groups, and everyone, using both letter and number codes.

Something like this?
