Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

boynet's avatar

getting "The bootstrap/cache directory must be present and writable" after each deployment

each time after a envoyer deployment I am getting this error:

The bootstrap/cache directory must be present and writable.

I can easily solving it by giving a write permission to this folder after each deployment

but of course it does not supposed to be this way as its need to be zero downtime deployment so whats is wrong? why envoyer doesn't auto give write permission for this directory after each deployment on its own?

0 likes
6 replies
jlrdw's avatar

php artisan cache:clear

And make sure folder permission is set correctly.

boynet's avatar

cache clear is clearing all my cache right? is obviously not the solution, i am talking about production environment where its a bad idea of clearing the cache

about

And make sure folder permission is set correctly. Report Spam Icon

yap that's the solution but I am asking why envoyer doesn't do it for me as its should be, so I think there is some deeper bug\problem here

ramdariro's avatar

i have same problem .when i run single method of test class throwing this error

In PackageManifest.php line 168:
                                                               
  The bootstrap/cache directory must be present and writable.
1 like
showFocus's avatar

I am having the same issue on Laravel 6 when running tests, Laravel 5.8 is fine.

1 like
10c56068ff's avatar

Hey guys, I'm having the same problem with Laravel 6, PackageManifest bootstrap/cache ..., where Laravel 5.8 works fine. I'm using laradock with Phpstorm and I noticed that the phpunit.xml file of 5.8 differs from 6.0. I found that 6.0 included new elements inside its <phpunit><php></php></phpunit> tag

Laravel 5.8

<?xml version="1.0" encoding="UTF-8"?>
<phpunit backupGlobals="false">
    # irrelevant code
    <php>
        <server name="APP_ENV" value="testing"/>
        <server name="BCRYPT_ROUNDS" value="4"/>
        <server name="CACHE_DRIVER" value="array"/>
        <server name="MAIL_DRIVER" value="array"/>
        <server name="QUEUE_CONNECTION" value="sync"/>
        <server name="SESSION_DRIVER" value="array"/>

        <server name="DB_CONNECTION" value="sqlite"/>
        <server name="DB_DATABASE" value=":memory:"/>
    </php>
</phpunit>

Laravel 6

<?xml version="1.0" encoding="UTF-8"?>
<phpunit backupGlobals="false">
    # irrelevant code ...
    <php>
        <server name="APP_ENV" value="testing"/>
        <server name="BCRYPT_ROUNDS" value="4"/>
        <server name="CACHE_DRIVER" value="array"/>
        <server name="MAIL_DRIVER" value="array"/>
        <server name="QUEUE_CONNECTION" value="sync"/>
        <server name="SESSION_DRIVER" value="array"/>
        <server name="APP_CONFIG_CACHE" value="bootstrap/cache/config.phpunit.php"/>
        <server name="APP_SERVICES_CACHE" value="bootstrap/cache/services.phpunit.php"/>
        <server name="APP_PACKAGES_CACHE" value="bootstrap/cache/packages.phpunit.php"/>
        <server name="APP_ROUTES_CACHE" value="bootstrap/cache/routes.phpunit.php"/>
        <server name="APP_EVENTS_CACHE" value="bootstrap/cache/events.phpunit.php"/>

        <server name="DB_CONNECTION" value="sqlite"/>
        <server name="DB_DATABASE" value=":memory:"/>
    </php>
</phpunit>

A temporary workaround I found is commenting out the APP_* server names:

<!--        <server name="APP_CONFIG_CACHE" value="bootstrap/cache/config.phpunit.php"/>-->
<!--        <server name="APP_SERVICES_CACHE" value="bootstrap/cache/services.phpunit.php"/>-->
<!--        <server name="APP_PACKAGES_CACHE" value="bootstrap/cache/packages.phpunit.php"/>-->
<!--        <server name="APP_ROUTES_CACHE" value="bootstrap/cache/routes.phpunit.php"/>-->
<!--        <server name="APP_EVENTS_CACHE" value="bootstrap/cache/events.phpunit.php"/>-->

I'm not really sure what is affected by commenting this out. If anyone can explain what these files are for and how to generate them (since they seem to be missing in the bootstrap/cache folder) or how to properly use them it would be greatly appreciated.

Please or to participate in this conversation.