1

I cloned a repository from my drupal site to a local environment running MAMP PRO in a windows machine. all the files and data base are setup correctly. when I try to run Drupal 8 I get this error. I know its a permissions problem but I'm not sure where to change the permissions or what to do. I tried many settings and I get same results.

Drupal\Core\File\Exception\FileWriteException: Temporary file 'temporary://filF92B.tmp' could not be created. in Drupal\Core\File\FileSystem->saveData() (line 521 of core\lib\Drupal\Core\File\FileSystem.php). 


Drupal\google_tag\Entity\ContainerManager->saveSnippets(Object) (Line: 77)
Drupal\google_tag\Entity\ContainerManager->createAssets(Object) (Line: 160)
Drupal\google_tag\Entity\ContainerManager->getScriptAttachments(Array) (Line: 70)
google_tag_page_attachments(Array) (Line: 297)
Drupal\Core\Render\MainContent\HtmlRenderer->invokePageAttachmentHooks(Array) (Line: 273)
Drupal\Core\Render\MainContent\HtmlRenderer->prepare(Array, Object, Object) (Line: 117)
Drupal\Core\Render\MainContent\HtmlRenderer->renderResponse(Array, Object, Object) (Line: 90)
Drupal\Core\EventSubscriber\MainContentViewSubscriber->onViewRenderArray(Object, 'kernel.view', Object)
call_user_func(Array, Object, 'kernel.view', Object) (Line: 111)
Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch('kernel.view', Object) (Line: 156)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 68)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 57)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 106)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 85)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 52)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 708)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
1
  • Probably your files folder. Take a look at this page
    – 2pha
    Commented Jan 23, 2021 at 0:18

4 Answers 4

1

Ok, It looks like is not necessary to access the admin panel to change the temporary directory. In settings.php I was able to modify the below line to set it up. After clearing Drupal cache and adding an .htaccess file it worked.

$settings['file_temp_path'] = '/tmp'; 
1

I was having this problem while working with the copy of a site in production in local with XAMPP. I solved it adding this to settings.php:

$settings["file_temp_path"] = sys_get_temp_dir();
0

Go to Administrator -> Configuration -> Media -> File System (/admin/config/media/file-system) to get your temporary path. Make sure it have the right privileges for the Apache user.

enter image description here

2
  • The problem is that I can't access the back end.
    – Biok
    Commented Jan 23, 2021 at 17:05
  • @Biok If so i think there is no way to check the permissions setting of the tmp directory Commented Jan 24, 2021 at 3:19
0

In my case the $settings['file_temp_path'] was overrided in the local.settings

Not the answer you're looking for? Browse other questions tagged or ask your own question.