Answers.Body: <p>That PHP error is happening as Craft is trying to adjust permissions in some folder, either in craft/app or craft/storage.</p>
  
  <p>You’ll need to ensure that both of those folders (and all subfolders) are writable by PHP.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-01-29T20:25:23.827Z
Answers.Text: Ya I ended up changing those folders to www-data:www-data in order to get it work, Ill just need to properly create a new group so that I can own the files/folders and add it to the same group as PHP
Answers.UserDisplayName: mcclaskiem
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-01-29T19:21:48.057Z
Answers.LastActivityDate: 2016-01-31T07:23:11.737Z
Answers.LastEditDate: 2016-01-31T07:23:11.737Z
Answers.UserDisplayName: Brandon Kelly
Body: <p>I am trying to use the one-click update feature and continually am getting a 500 error when attempting retrieve available updates on staging server. All my permissions work correctly as my craft install works all over except when updating.</p>
  
  <p>the URL that gives this error is:</p>
  
  <p><code>http://staging.link.com/index.php?p=admin/actions/update/getAvailableUpdates</code></p>
  
  <p>Stacktrace:</p>
  
  <pre><code>&lt;h1&gt;PHP Error [500]&lt;/h1&gt;
  &lt;p&gt;chmod(): Operation not permitted (/var/www/staging/craft/app/helpers/IOHelper.php:1023)&lt;/p&gt;
  &lt;pre&gt;#0 /var/www/staging/craft/app/etc/errors/ErrorHandler.php(184): Craft\ErrorHandler-&gt;handleError()
  #1 /var/www/staging/craft/app/framework/base/CErrorHandler.php(133): Craft\ErrorHandler-&gt;handleError()
  #2 /var/www/staging/craft/app/framework/base/CApplication.php(824): Craft\ErrorHandler-&gt;handle()
  #3 /var/www/staging/craft/app/etc/web/WebApp.php(681): Craft\WebApp-&gt;handleError()
  #4 unknown(0): Craft\WebApp-&gt;handleError()
  #5 /var/www/staging/craft/app/helpers/IOHelper.php(1023): chmod()
  #6 /var/www/staging/craft/app/etc/cache/FileCache.php(138): changePermissions()
  #7 /var/www/staging/craft/app/framework/caching/CCache.php(185): Craft\FileCache-&gt;setValue()
  #8 /var/www/staging/craft/app/etc/cache/FileCache.php(64): Craft\FileCache-&gt;set()
  #9 /var/www/staging/craft/app/services/CacheService.php(130): Craft\FileCache-&gt;set()
  #10 /var/www/staging/craft/app/etc/et/Et.php(247): Craft\CacheService-&gt;set()
  #11 /var/www/staging/craft/app/services/EtService.php(54): Craft\Et-&gt;phoneHome()
  #12 /var/www/staging/craft/app/services/UpdatesService.php(277): Craft\EtService-&gt;checkForUpdates()
  #13 /var/www/staging/craft/app/services/UpdatesService.php(170): Craft\UpdatesService-&gt;check()
  #14 /var/www/staging/craft/app/controllers/UpdateController.php(57): Craft\UpdatesService-&gt;getUpdates()
  #15 /var/www/staging/craft/app/framework/web/actions/CInlineAction.php(49): Craft\UpdateController-&gt;actionGetAvailableUpdates()
  #16 /var/www/staging/craft/app/framework/web/CController.php(308): CInlineAction-&gt;runWithParams()
  #17 /var/www/staging/craft/app/framework/web/CController.php(286): Craft\UpdateController-&gt;runAction()
  #18 /var/www/staging/craft/app/framework/web/CController.php(265): Craft\UpdateController-&gt;runActionWithFilters()
  #19 /var/www/staging/craft/app/framework/web/CWebApplication.php(282): Craft\UpdateController-&gt;run()
  #20 /var/www/staging/craft/app/etc/web/WebApp.php(811): Craft\WebApp-&gt;runController()
  #21 /var/www/staging/craft/app/etc/web/WebApp.php(281): Craft\WebApp-&gt;_processActionRequest()
  #22 /var/www/staging/craft/app/framework/base/CApplication.php(184): Craft\WebApp-&gt;processRequest()
  #23 /var/www/staging/craft/app/index.php(62): Craft\WebApp-&gt;run()
  #24 /var/www/staging/html/index.php(19): require_once()
  &lt;/pre&gt;
  </code></pre>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-01-29T17:42:17.140Z
Comments.Text: Can you confirm that Craft is writing files to its storage/runtime folder properly, and that Apache has sufficient owner/group access? I could be wrong, but it seems like a [file ownership problem](http://stackoverflow.com/questions/23070266/php-chmod-operation-not-permitted-safe-mode-deprecation-involved).
Comments.UserDisplayName: Matt Stein
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-01-29T18:02:02.050Z
Comments.Text: @MattStein the craft.log file is properly updating as for the owner/group the craft.log file is different than the rest of the files in directory
Comments.UserDisplayName: mcclaskiem
Tags: <php><permissions><updating>
Title: PHP 500 Error On One-click Update
ThreadText: # PHP 500 Error On One-click Update
  
  (Asked by: username_0 on 2016-01-29)
  
  I am trying to use the one-click update feature and continually am getting a 500 error when attempting retrieve available updates on staging server. All my permissions work correctly as my craft install works all over except when updating.
  
  the URL that gives this error is:
  
  `http://staging.link.com/index.php?p=admin/actions/update/getAvailableUpdates`
  
  Stacktrace:
  
  ```
  <h1>PHP Error [500]</h1>
  <p>chmod(): Operation not permitted (/var/www/staging/craft/app/helpers/IOHelper.php:1023)</p>
  <pre>#0 /var/www/staging/craft/app/etc/errors/ErrorHandler.php(184): Craft\ErrorHandler->handleError()
  #1 /var/www/staging/craft/app/framework/base/CErrorHandler.php(133): Craft\ErrorHandler->handleError()
  #2 /var/www/staging/craft/app/framework/base/CApplication.php(824): Craft\ErrorHandler->handle()
  #3 /var/www/staging/craft/app/etc/web/WebApp.php(681): Craft\WebApp->handleError()
  #4 unknown(0): Craft\WebApp->handleError()
  #5 /var/www/staging/craft/app/helpers/IOHelper.php(1023): chmod()
  #6 /var/www/staging/craft/app/etc/cache/FileCache.php(138): changePermissions()
  #7 /var/www/staging/craft/app/framework/caching/CCache.php(185): Craft\FileCache->setValue()
  #8 /var/www/staging/craft/app/etc/cache/FileCache.php(64): Craft\FileCache->set()
  #9 /var/www/staging/craft/app/services/CacheService.php(130): Craft\FileCache->set()
  #10 /var/www/staging/craft/app/etc/et/Et.php(247): Craft\CacheService->set()
  #11 /var/www/staging/craft/app/services/EtService.php(54): Craft\Et->phoneHome()
  #12 /var/www/staging/craft/app/services/UpdatesService.php(277): Craft\EtService->checkForUpdates()
  #13 /var/www/staging/craft/app/services/UpdatesService.php(170): Craft\UpdatesService->check()
  #14 /var/www/staging/craft/app/controllers/UpdateController.php(57): Craft\UpdatesService->getUpdates()
  #15 /var/www/staging/craft/app/framework/web/actions/CInlineAction.php(49): Craft\UpdateController->actionGetAvailableUpdates()
  #16 /var/www/staging/craft/app/framework/web/CController.php(308): CInlineAction->runWithParams()
  #17 /var/www/staging/craft/app/framework/web/CController.php(286): Craft\UpdateController->runAction()
  #18 /var/www/staging/craft/app/framework/web/CController.php(265): Craft\UpdateController->runActionWithFilters()
  #19 /var/www/staging/craft/app/framework/web/CWebApplication.php(282): Craft\UpdateController->run()
  #20 /var/www/staging/craft/app/etc/web/WebApp.php(811): Craft\WebApp->runController()
  #21 /var/www/staging/craft/app/etc/web/WebApp.php(281): Craft\WebApp->_processActionRequest()
  #22 /var/www/staging/craft/app/framework/base/CApplication.php(184): Craft\WebApp->processRequest()
  #23 /var/www/staging/craft/app/index.php(62): Craft\WebApp->run()
  #24 /var/www/staging/html/index.php(19): require_once()
  </pre>
  
  ```
  
  **Tags:** php, permissions, updating
  
  > **Comments:**
  > **username_1**: Can you confirm that Craft is writing files to its storage/runtime folder properly, and that Apache has sufficient owner/group access? I could be wrong, but it seems like a [file ownership problem](http://stackoverflow.com/questions/23070266/php-chmod-operation-not-permitted-safe-mode-deprecation-involved).  
  > **username_0**: @username_1 the craft.log file is properly updating as for the owner/group the craft.log file is different than the rest of the files in directory  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_2 on 2016-01-29. Score: 0 | Accepted answer
  
  That PHP error is happening as Craft is trying to adjust permissions in some folder, either in craft/app or craft/storage.
  
  You’ll need to ensure that both of those folders (and all subfolders) are writable by PHP.
  
  > **Comments:**
  > **username_0**: Ya I ended up changing those folders to www-data:www-data in order to get it work, Ill just need to properly create a new group so that I can own the files/folders and add it to the same group as PHP  
  
  ---
  
  