is_dir(): Unable to find the wrapper "unix"

Permalink Browser Info Environment
We are experiencing c5 installation issue, where the installation stops with an error:

is_dir(): Unable to find the wrapper "unix" - did you forget to enable it when you configured PHP?.
Trace:
#0 [internal function]: Whoops\Run->handleError(2, 'is_dir(): Unabl...', '/data/web/e4902...', 51, Array) #1 /data/web/e49027/html/c5/concrete/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/Handler/NativeFileSessionHandler.php(51): is_dir('unix:///data/so...') #2 /data/web/e49027/html/c5/concrete/src/Session/Session.php(34): Symfony\Component\HttpFoundation\Session\Storage\Handler\NativeFileSessionHandler->__construct() #3 /data/web/e49027/html/c5/concrete/src/Session/SessionServiceProvider.php(15): Concrete\Core\Session\Session::start() #4 /data/web/e49027/html/c5/concrete/vendor/illuminate/container/Illuminate/Container/Container.php(498): Concrete\Core\Session\SessionServiceProvider->Concrete\Core\Session\{closure}(Object(Concrete\Core\Application\Application), Array) #5 /data/web/e49027/html/c5/concrete/vendor/illuminate/container/Illuminate/Container/Container.php(425): Illuminate\Container\Container->build(Object(Closure), Array) #6 /data/web/e49027/html/c5/concrete/vendor/illuminate/container/Illuminate/Container/Container.php(809): Illuminate\Container\Container->make('session') #7 /data/web/e49027/html/c5/concrete/src/Support/Facade/Facade.php(43): Illuminate\Container\Container->offsetGet('session') #8 /data/web/e49027/html/c5/concrete/src/Support/Facade/Facade.php(105): Concrete\Core\Support\Facade\Facade::resolveFacadeInstance('session') #9 /data/web/e49027/html/c5/concrete/src/User/User.php(203): Concrete\Core\Support\Facade\Facade::__callStatic('has', Array) #10 /data/web/e49027/html/c5/concrete/src/User/User.php(203): Concrete\Core\Support\Facade\Session::has('uID') #11 /data/web/e49027/html/c5/concrete/src/User/User.php(52): Concrete\Core\User\User->__construct() #12 /data/web/e49027/html/c5/concrete/src/Package/StartingPointPackage.php(341): Concrete\Core\User\User::getByUserID(1, true, false) #13 [internal function]: Concrete\Core\Package\StartingPointPackage->add_users() #14 /data/web/e49027/html/c5/concrete/controllers/install.php(264): call_user_func(Array) #15 [internal function]: Concrete\Controller\Install->run_routine('elemental_blank', 'add_users') #16 /data/web/e49027/html/c5/concrete/src/Controller/AbstractController.php(156): call_user_func_array(Array, Array) #17 /data/web/e49027/html/c5/concrete/src/Routing/ControllerRouteCallback.php(25): Concrete\Core\Controller\AbstractController->runAction('run_routine', Array) #18 /data/web/e49027/html/c5/concrete/src/Routing/Router.php(59): Concrete\Core\Routing\ControllerRouteCallback->execute(Object(Concrete\Core\Http\Request), Object(Concrete\Core\Routing\Route), Array) #19 /data/web/e49027/html/c5/concrete/src/Support/Facade/Facade.php(119): Concrete\Core\Routing\Router->execute(Object(Concrete\Core\Routing\Route), Array) #20 /data/web/e49027/html/c5/concrete/src/Application/Application.php(366): Concrete\Core\Support\Facade\Facade::__callStatic('execute', Array) #21 /data/web/e49027/html/c5/concrete/src/Application/Application.php(366): Concrete\Core\Support\Facade\Route::execute(Object(Concrete\Core\Routing\Route), Array) #22 /data/web/e49027/html/c5/concrete/bootstrap/start.php(217): Concrete\Core\Application\Application->dispatch(Object(Concrete\Core\Http\Request)) #23 /data/web/e49027/html/c5/concrete/dispatcher.php(36): require('/data/web/e4902...') #24 /data/web/e49027/html/c5/index.php(2): require('/data/web/e4902...') #25 {main}


The issue seems to happen because of alternative session handler configured in php.ini, where session.save_path does not contain a valid file system directory. In our case we are using memcache:

[Session]
session.save_handler = memcache
session.save_path = "unix:///run/memcached/memcached.sock"


I had a look at the source code of concrete/src/Session/Storage/Handler/NativeFileSessionHandler.php and it looks like concrete5.7.5.1 requires session handler to be set to 'files' during installation, as session.save_path must point to a valid file system path by default, no matter which handler is configured in php ini:

if (null === $savePath) {
            $savePath = ini_get('session.save_path');
        }
        $baseDir = $savePath;
        if ($count = substr_count($savePath, ';')) {
            if ($count > 2) {
                throw new \InvalidArgumentException(sprintf('Invalid argument $savePath \'%s\'', $savePath));
            }
            // characters after last ';' are the path
            $baseDir = ltrim(strrchr($savePath, ';'), ';');
        }
        ini_set('session.save_handler', 'files');
        try {
            if ($baseDir && !is_dir($baseDir)) {
                mkdir($baseDir, 0777, true);


Status: Postponed
locojohn
sulate replied on at Permalink Reply
sulate
Same here. Using tcp-save_path:

php.ini:
session.save_handler = memcache
session.save_path = "tcp://localhost:11211"


And it's not just during installation, the bug prevents using alternative handler altogether.
andrew replied on at Permalink Reply
andrew
We've got an open issue to do something about this, I think it would be useful to bundle it up with this one:

https://github.com/concrete5/concrete5/issues/1180...

Thoughts? A fix for this would be nice
locojohn replied on at Permalink Reply
locojohn
Still not fixed? Come on!
losttheplot replied on at Permalink Reply
Oh dear; this is a major issue for an otherwise great CMS. Such a shame; looks like I'll have to abandon c5 now and switch to Joomla, which I really don't want to have to do :(

If I change the server config for the installation, will c5 work if I then switch everything back to this?..

session.save_handler = redis
session.save_path = "unix:///var/run/redis/redis.sock?persistent=1"
losttheplot replied on at Permalink Reply
To answer my own question, you can get c5 to instal by commenting out the custom session file handler, but once you enable it again, the error displays and disables the site.

I'm staggered that so many reported c5 websites are being used worldwide, yet the new version won't run with anything other than the default file handler.

Has anyone found a workaround for this issue please? I so want to keep using c5 but this is a showstopper!
losttheplot replied on at Permalink Reply
OK, so I have been able to get my site to work (initialy at least) by setting the session handler to 'database' on line 620 of /concrete/config/concrete.php :)
lineinthesand replied on at Permalink Reply
Solution to the problem is still valid – can this answer be made more prominent somehow?
For concrete5-8.3.2, it's on line 649, btw.
Lovic replied on at Permalink Reply
Lovic
I set 'database' in line 658 and it made the site work without any problems (c5 8.4.3 with Redis Server)

concrete5 Environment Information

# concrete5 Version
Core Version - 5.7.5.1
Version Installed - 5.7.5.1
Database Version - 20150713000000

# concrete5 Packages
None

# concrete5 Overrides
languages/fi_FI/LC_MESSAGES/messages.mo, languages/fi_FI/LC_MESSAGES, languages/fi_FI, languages/pl_PL/LC_MESSAGES/messages.mo, languages/pl_PL/LC_MESSAGES, languages/pl_PL, languages/el_GR/LC_MESSAGES/messages.mo, languages/el_GR/LC_MESSAGES, languages/el_GR, languages/ja_JP/LC_MESSAGES/messages.mo, languages/ja_JP/LC_MESSAGES, languages/ja_JP, languages/fr_FR/LC_MESSAGES/messages.mo, languages/fr_FR/LC_MESSAGES, languages/fr_FR, languages/de_DE/LC_MESSAGES/messages.mo, languages/de_DE/LC_MESSAGES, languages/de_DE, languages/it_IT/LC_MESSAGES/messages.mo, languages/it_IT/LC_MESSAGES, languages/it_IT, languages/nl_NL/LC_MESSAGES/messages.mo, languages/nl_NL/LC_MESSAGES, languages/nl_NL, languages/pt_BR/LC_MESSAGES/messages.mo, languages/pt_BR/LC_MESSAGES, languages/pt_BR, languages/ru_RU/LC_MESSAGES/messages.mo, languages/ru_RU/LC_MESSAGES, languages/ru_RU, languages/tr_TR/LC_MESSAGES/messages.mo, languages/tr_TR/LC_MESSAGES, languages/tr_TR, languages/da_DK/LC_MESSAGES/messages.mo, languages/da_DK/LC_MESSAGES, languages/da_DK, languages/sv_SE/LC_MESSAGES/messages.mo, languages/sv_SE/LC_MESSAGES, languages/sv_SE, themes/obl/thumbnail.png, themes/obl/description.txt, themes/obl, languages/fi_FI/LC_MESSAGES/messages.mo, languages/fi_FI/LC_MESSAGES, languages/fi_FI, languages/pl_PL/LC_MESSAGES/messages.mo, languages/pl_PL/LC_MESSAGES, languages/pl_PL, languages/el_GR/LC_MESSAGES/messages.mo, languages/el_GR/LC_MESSAGES, languages/el_GR, languages/ja_JP/LC_MESSAGES/messages.mo, languages/ja_JP/LC_MESSAGES, languages/ja_JP, languages/fr_FR/LC_MESSAGES/messages.mo, languages/fr_FR/LC_MESSAGES, languages/fr_FR, languages/de_DE/LC_MESSAGES/messages.mo, languages/de_DE/LC_MESSAGES, languages/de_DE, languages/it_IT/LC_MESSAGES/messages.mo, languages/it_IT/LC_MESSAGES, languages/it_IT, languages/nl_NL/LC_MESSAGES/messages.mo, languages/nl_NL/LC_MESSAGES, languages/nl_NL, languages/pt_BR/LC_MESSAGES/messages.mo, languages/pt_BR/LC_MESSAGES, languages/pt_BR, languages/ru_RU/LC_MESSAGES/messages.mo, languages/ru_RU/LC_MESSAGES, languages/ru_RU, languages/tr_TR/LC_MESSAGES/messages.mo, languages/tr_TR/LC_MESSAGES, languages/tr_TR, languages/da_DK/LC_MESSAGES/messages.mo, languages/da_DK/LC_MESSAGES, languages/da_DK, languages/sv_SE/LC_MESSAGES/messages.mo, languages/sv_SE/LC_MESSAGES, languages/sv_SE, themes/obl/js/jquery.vide.js, themes/obl/js/markerclusterer.js, themes/obl/js/script_art.js, themes/obl/js/jquery-1.11.3.min.js, themes/obl/js/script.js, themes/obl/js/modernizr.js, themes/obl/js, themes/obl/thumbnail.png, themes/obl/vid/bg.jpg, themes/obl/vid/bg.webm, themes/obl/vid/bg.mp4, themes/obl/vid/bg.ogv, themes/obl/vid, themes/obl/css/typo.css, themes/obl/css/styles.css, themes/obl/css, themes/obl/img/bg_offer_3.jpg, themes/obl/img/c_3.svg, themes/obl/img/c_4.svg, themes/obl/img/logo.svg, themes/obl/img/c_2.svg, themes/obl/img/bg_tool.jpg, themes/obl/img/circle.svg, themes/obl/img/bg_comp_2.jpg, themes/obl/img/bg_news_2.jpg, themes/obl/img/play.svg, themes/obl/img/bg_comp.jpg, themes/obl/img/bg_ap_2.jpg, themes/obl/img/logo_fb.svg, themes/obl/img/cache_white.svg, themes/obl/img/bg_footer.jpg, themes/obl/img/bg_map.jpg, themes/obl/img/bg_offer.jpg, themes/obl/img/bg_offer_2.jpg, themes/obl/img/boat.svg, themes/obl/img/bg_news.jpg, themes/obl/img/arrow_bottom.svg, themes/obl/img/bg_footer_small.png, themes/obl/img/bg_tool_2.jpg, themes/obl/img/logo_tw.svg, themes/obl/img/bg_comp_3.jpg, themes/obl/img/bg_ap.jpg, themes/obl/img/contact_1.jpg, themes/obl/img/img_news.jpg, themes/obl/img/map.png, themes/obl/img/arrow.svg, themes/obl/img/cache_blue.svg, themes/obl/img/bg_ap_3.jpg, themes/obl/img/bg_news_3.jpg, themes/obl/img/map/m5.png, themes/obl/img/map/m4.png, themes/obl/img/map/m2.png, themes/obl/img/map/m3.png, themes/obl/img/map/m1.png, themes/obl/img/map, themes/obl/img/menu.svg, themes/obl/img/img_1.jpg, themes/obl/img/c_1.svg, themes/obl/img, themes/obl/data.json, themes/obl/description.txt, themes/obl/default.php, themes/obl

# concrete5 Cache Settings
Block Cache - On
Overrides Cache - On
Full Page Caching - Off
Full Page Cache Lifetime - Every 6 hours (default setting).

# Server Software
nginx/1.9.5

# Server API
fpm-fcgi

# PHP Version
5.6.13-pl0-gentoo

# PHP Extensions
bcmath, bz2, cgi-fcgi, Core, ctype, curl, date, dom, ereg, fileinfo, filter, ftp, gd, geoip, gettext, hash, iconv, imagick, intl, json, ldap, libxml, mbstring, mcrypt, memcache, mysql, mysqli, mysqlnd, openssl, pcntl, pcre, PDO, pdo_mysql, Phar, posix, readline, Reflection, session, shmop, SimpleXML, SPL, standard, sysvmsg, sysvsem, sysvshm, tokenizer, xdebug, xml, xmlreader, xmlwriter, zip, zlib.

# PHP Settings
max_execution_time - 30
log_errors_max_len - 1024
max_file_uploads - 20
max_input_nesting_level - 64
max_input_time - 60
max_input_vars - 1000
memory_limit - 512M
post_max_size - 128M
sql.safe_mode - Off
upload_max_filesize - 250M
ldap.max_links - Unlimited
memcache.max_failover_attempts - 20
mysql.max_links - Unlimited
mysql.max_persistent - Unlimited
mysqli.max_links - Unlimited
mysqli.max_persistent - Unlimited
pcre.backtrack_limit - 1000000
pcre.recursion_limit - 100000
session.cache_limiter - <i>no value</i>
session.gc_maxlifetime - 1440
xdebug.max_nesting_level - 100
xdebug.max_stack_frames - -1
xdebug.var_display_max_children - 128
xdebug.var_display_max_data - 512
xdebug.var_display_max_depth - 2

Browser User-Agent String

Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_5) AppleWebKit/600.8.9 (KHTML, like Gecko) Version/7.1.8 Safari/537.85.17