<p>See this issue: <a href="https://github.com/craftcms/cms/issues/4355#issuecomment-498829513" rel="nofollow noreferrer">https://github.com/craftcms/cms/issues/4355#issuecomment-498829513</a></p>

<p>reproduced here for completeness:</p>

<blockquote>
  <p>A yii variable 'isWindows' is apparently the way to correct this issue, but I haven't been able to find any documentation describing where/how to set this.</p>
</blockquote>

<p>From your Craft config/app.php file, you can use this to set the isWindows property of the FileMutex class to true.</p>

<pre class="lang-php prettyprint-override"><code>return [
    'components' =&gt; [
        'mutex' =&gt; function() {
            $config = craft\helpers\App::mutexConfig();
            $config['isWindows'] = true;
            return Craft::createObject($config);
        },
    ],
];
</code></pre>

CC BY-SA 4.0
2019-06-04T20:52:15.710Z
2019-06-04T20:52:15.710Z
Ethan Davidson
<p>I am trying to run craft inside a homestead box. The box boots and installs everything correctly, and when I navigate to <a href="http://localhost:8000/admin" rel="nofollow noreferrer">http://localhost:8000/admin</a> I see the install screen and can click through the prompts. However, after clicking through the final screen I always get "Install failed  Please check your logs for more info.".</p>

<p>Here are the details for my setup:</p>

<ul>
<li>Host OS: Windows 10 1809</li>
<li>Vagrant version: 2.2.4</li>
<li>Virtualbox version: 6.0.8</li>
<li>Homestead version: 8.5.5 (vagrant box 8.0.0-alpha2)</li>
<li>Guest OS: Ubuntu 18.04.2</li>
<li>Guest PHP version: 7.3.5-1</li>
</ul>

<p>phperrors.log has this to say:</p>

<pre><code>[03-Jun-2019 19:56:07 UTC] PHP Fatal error:  Uncaught yii\base\ErrorException: unlink(/home/vagrant/code/storage/runtime/mutex/a78d6a4ecc5877cd5617ca990a2be38b.lock): Text file busy in /home/vagrant/code/vendor/yiisoft/yii2/mutex/FileMutex.php:161
Stack trace:
#0 /home/vagrant/code/vendor/yiisoft/yii2/mutex/FileMutex.php(161): ::unlink()
#1 /home/vagrant/code/vendor/yiisoft/yii2/mutex/Mutex.php(88): yii\mutex\FileMutex-&gt;releaseLock()
#2 /home/vagrant/code/vendor/yiisoft/yii2/mutex/Mutex.php(57): yii\mutex\FileMutex-&gt;release()
#3 {main}
  thrown in /home/vagrant/code/vendor/yiisoft/yii2/mutex/FileMutex.php on line 161
</code></pre>

<p>I've googled this error message but didn't find anyone with the same problem. The referenced line of code (<a href="https://github.com/yiisoft/yii2/blob/91c96ff4525b498b6849abd986e9dcaad2883043/framework/mutex/FileMutex.php#L161" rel="nofollow noreferrer">FileMutex.php:161</a>) offers the clue that it may be an issue with operating systems (a different file unlock/delete procedure is used on windows). </p>

<p>In the vagrant box, the permissions on that file are wide open and I can delete the file with no problem.</p>

<pre><code>vagrant@craftycoffee:/vagrant/storage/runtime/mutex$ ls -al
total 8
drwxrwxrwx 1 vagrant vagrant 4096 Jun  3 02:39 .
drwxrwxrwx 1 vagrant vagrant 4096 Jun  3 02:35 ..
-rwxrwxrwx 1 vagrant vagrant    0 Jun  3 02:35 4f99fda3d17d57459c4105d023bcba69.lock
-rwxrwxrwx 1 vagrant vagrant    0 Jun  3 02:35 52fa75c9044f6df80d2103fad929036e.lock
-rwxrwxrwx 1 vagrant vagrant    0 Jun  3 19:56 a78d6a4ecc5877cd5617ca990a2be38b.lock
vagrant@craftycoffee:/vagrant/storage/runtime/mutex$ rm a78d6a4ecc5877cd5617ca990a2be38b.lock
vagrant@craftycoffee:/vagrant/storage/runtime/mutex$ ls
4f99fda3d17d57459c4105d023bcba69.lock  52fa75c9044f6df80d2103fad929036e.lock
</code></pre>

<p>My best guess is that there is some weird interaction between windows and ubuntu when vagrant mounts that folder. However, I use vagrant for several other projects (all with windows host and linux guest) and have never seen any problems like this. I'm a complete noob with homestead/craft/php so I'm not really sure where to go from here; Any guidance on troubleshooting is appreciated. If there is any more info I can provide please let me know.</p>

<p>EDIT: I tried using <a href="https://www.vagrantup.com/docs/synced-folders/smb.html" rel="nofollow noreferrer">SMB</a> to do the file mounting (I believe NFS is the default?) and it worked. However, this isn't an optimal solution because I have to put in my username and password every time I boot the box.</p>

<php><yii><filesystem>
PHP Fatal error during installation
# PHP Fatal error during installation

(Asked by: username_0 on 2019-06-03)

I am trying to run craft inside a homestead box. The box boots and installs everything correctly, and when I navigate to http://localhost:8000/admin I see the install screen and can click through the prompts. However, after clicking through the final screen I always get "Install failed  Please check your logs for more info.".
Here are the details for my setup:

Host OS: Windows 10 1809
Vagrant version: 2.2.4
Virtualbox version: 6.0.8
Homestead version: 8.5.5 (vagrant box 8.0.0-alpha2)
Guest OS: Ubuntu 18.04.2
Guest PHP version: 7.3.5-1

phperrors.log has this to say:
[03-Jun-2019 19:56:07 UTC] PHP Fatal error:  Uncaught yii\base\ErrorException: unlink(/home/vagrant/code/storage/runtime/mutex/a78d6a4ecc5877cd5617ca990a2be38b.lock): Text file busy in /home/vagrant/code/vendor/yiisoft/yii2/mutex/FileMutex.php:161
Stack trace:
#0 /home/vagrant/code/vendor/yiisoft/yii2/mutex/FileMutex.php(161): ::unlink()
#1 /home/vagrant/code/vendor/yiisoft/yii2/mutex/Mutex.php(88): yii\mutex\FileMutex->releaseLock()
#2 /home/vagrant/code/vendor/yiisoft/yii2/mutex/Mutex.php(57): yii\mutex\FileMutex->release()
#3 {main}
  thrown in /home/vagrant/code/vendor/yiisoft/yii2/mutex/FileMutex.php on line 161

I've googled this error message but didn't find anyone with the same problem. The referenced line of code (FileMutex.php:161) offers the clue that it may be an issue with operating systems (a different file unlock/delete procedure is used on windows). 
In the vagrant box, the permissions on that file are wide open and I can delete the file with no problem.
vagrant@craftycoffee:/vagrant/storage/runtime/mutex$ ls -al
total 8
drwxrwxrwx 1 vagrant vagrant 4096 Jun  3 02:39 .
drwxrwxrwx 1 vagrant vagrant 4096 Jun  3 02:35 ..
-rwxrwxrwx 1 vagrant vagrant    0 Jun  3 02:35 4f99fda3d17d57459c4105d023bcba69.lock
-rwxrwxrwx 1 vagrant vagrant    0 Jun  3 02:35 52fa75c9044f6df80d2103fad929036e.lock
-rwxrwxrwx 1 vagrant vagrant    0 Jun  3 19:56 a78d6a4ecc5877cd5617ca990a2be38b.lock
vagrant@craftycoffee:/vagrant/storage/runtime/mutex$ rm a78d6a4ecc5877cd5617ca990a2be38b.lock
vagrant@craftycoffee:/vagrant/storage/runtime/mutex$ ls
4f99fda3d17d57459c4105d023bcba69.lock  52fa75c9044f6df80d2103fad929036e.lock

My best guess is that there is some weird interaction between windows and ubuntu when vagrant mounts that folder. However, I use vagrant for several other projects (all with windows host and linux guest) and have never seen any problems like this. I'm a complete noob with homestead/craft/php so I'm not really sure where to go from here; Any guidance on troubleshooting is appreciated. If there is any more info I can provide please let me know.
EDIT: I tried using SMB to do the file mounting (I believe NFS is the default?) and it worked. However, this isn't an optimal solution because I have to put in my username and password every time I boot the box.

**Tags:** php, yii, filesystem


---

## 1 answers

### Answer by username_0 on 2019-06-04. Score: 4 | Accepted answer

See this issue: https://github.com/craftcms/cms/issues/4355#issuecomment-498829513
reproduced here for completeness:

A yii variable 'isWindows' is apparently the way to correct this issue, but I haven't been able to find any documentation describing where/how to set this.

From your Craft config/app.php file, you can use this to set the isWindows property of the FileMutex class to true.
return [
    'components' => [
        'mutex' => function() {
            $config = craft\helpers\App::mutexConfig();
            $config['isWindows'] = true;
            return Craft::createObject($config);
        },
    ],
];


---

