Bug #31255

CF: Could not create directory

Added by Steffen Gebert almost 4 years ago. Updated almost 2 years ago.

Status:Resolved Start date:2011-10-25
Priority:Should have Due date:
Assigned To:- % Done:

100%

Category:Caching Spent time: -
Target version:6.2.0
TYPO3 Version:4.6 Is Regression:No
PHP Version: Sprint Focus:
Complexity:

Description

Installing TYPO3 in a directory, where the web server user has no write permissions at all ends up with a RuntimeException:

PHP Fatal error:  Uncaught exception 'RuntimeException' with message 'Could not create directory!' in t3lib/class.t3lib_div.php:2909
Stack trace:
#0 t3lib/cache/backend/class.t3lib_cache_backend_filebackend.php(201): t3lib_div::mkdir_deep('/var/www/typo3t...')
#1 t3lib/cache/backend/class.t3lib_cache_backend_filebackend.php(99): t3lib_cache_backend_FileBackend->createFinalCacheDirectory('/var/www/typo3t...')
#2 t3lib/cache/frontend/class.t3lib_cache_frontend_abstractfrontend.php(63): t3lib_cache_backend_FileBackend->setCache(Object(t3lib_cache_frontend_PhpFrontend))
#3 t3lib/cache/frontend/class.t3lib_cache_frontend_phpfrontend.php(45): t3lib_cache_frontend_AbstractFrontend->__construct('cache_phpcode', Object(t3lib_cache_backend_FileBackend))
#4 [internal function]: t3lib_cache_frontend_PhpFrontend->__construct('cache_phpcode', Object(t3lib_cache_backend_FileBackend))
#5 /var/www/typo3_sr in t3lib/cache/backend/class.t3lib_cache_backend_filebackend.php on line 203

The bad thing is that modern browsers dont't show that Exception, but show just a Server Error page.

If possible, we should check, whether the directory is writable and then output a message, which finds its way to the user!

In doubt I'm fine with taking this from the 4.6.0 target.

31255.diff Magnifier (1.3 kB) Steffen Gebert, 2011-10-25 12:07


Related issues

related to Core - Feature #11771: Check for write-permissions before installation Resolved 2010-12-29
duplicated by Core - Bug #32306: Install tool fails silently if typo3temp is not writable Rejected 2011-12-05
duplicated by Core - Bug #32842: Missing write permissions cause HTTP 500 error Closed 2011-12-27

History

#1 Updated by Steffen Gebert almost 4 years ago

  • Target version set to 4.6.0

#2 Updated by Steffen Gebert almost 4 years ago

Few things missing:

  • Exceptions should be caught in a callee few levels outside the CF
  • Redirection after creating ENABLE_INSTALL_TOOL is wrong, it redirects to install/ subdirectory of typo3/install/

#3 Updated by Steffen Gebert almost 4 years ago

  • Priority changed from Must have to Should have
  • Target version changed from 4.6.0 to 4.6.1

#4 Updated by Christian Kuhn almost 4 years ago

Mmh,

if a system is already set up and this error is thrown, I'd say there is the install tool that comes with checks for those things. From a production perspective I'd not handle this error in the cf.

Since this message is much more likely to be thrown in the install tool during first installation, the issue occurs because the install tool is interweaved with the default TYPO3 bootstrap, so the autoloader is instantiated and wants to create the cache file. At the moment we can not solve this issue systematically.

So, best solution at the moment is probably to catch the error at a higher level in the install process itself and write a happy little error message that at least typo3temp/ must be writable to continue.

#5 Updated by Steffen Gebert almost 4 years ago

To be precise: It's before the install process. Before even detecting that we have to redirect to the Install Tool.

#6 Updated by Chris topher over 3 years ago

  • Target version changed from 4.6.1 to 4.6.2

#7 Updated by Xavier Perseguers over 3 years ago

  • Target version deleted (4.6.2)

#8 Updated by Yan Guy over 3 years ago

With typo3 version 4.6.8,
under OS X (10.6.8) the solution is to

cd /Library/WebServer/Documents/(sitedirectory)
sudo chgrp -R _www fileadmin typo3temp typo3conf uploads

Would be good to add to the INSTALL.txt file that

under OS X (at least 10.6)
the apache server root directory is /Library/WebServer/Documents
and the group of the apache web server included with OS X is _www

#9 Updated by Christian Kuhn almost 2 years ago

  • Status changed from New to Resolved
  • Target version set to 6.2.0
  • % Done changed from 0 to 100
  • Is Regression set to No

The "folder structure" in 6.2 install tool takes care of this permission issue now.

Also available in: Atom PDF