cancel
Showing results for 
Search instead for 
Did you mean: 

touch(): Utime failed: Permission denied

touch(): Utime failed: Permission denied

Hello,

When I try to install a composer module I get this ErrorException:
touch(): Utime failed: Permission denied

 

* Composer version 1.9.3

** Magento 2.2.10

3 REPLIES 3

Re: touch(): Utime failed: Permission denied

@alain_picardSeems like permission issue. Either tmp folder or one of the Magento folder does not have enough permission to write. Please check the permission (user & user group as well) on Magento and it's folder to resolve the issue.

- Tarandeep
Problem solved?Please give 'Kudos' and accept 'Answer as Solution'.

Re: touch(): Utime failed: Permission denied

Hello @alain_picard 

 

Try running sudo composer clear-cache and then run the composer install , because touch is required when it reads from cache & when cache is cleared, that is not executed at all.

 

Manish Mittal
https://www.manishmittal.com/

Re: touch(): Utime failed: Permission denied

Run :

 

$composer install -v

output should be : 

Generating autoload files
84 packages you are using are looking for funding.
Use the `composer fund` command to find out more!

                                            
  [ErrorException]                          
  touch(): Utime failed: Permission denied  
                                            

Exception trace:
 () at /home/lxc/magento24/mage24ee/magento/vendor/magento/magento-composer-installer/src/MagentoHackathon/Composer/Magento/Plugin.php:335
 Composer\Util\ErrorHandler::handle() at n/a:n/a
 touch() at /home/lxc/magento24/mage24ee/magento/vendor/magento/magento-composer-installer/src/MagentoHackathon/Composer/Magento/Plugin.php:335
 MagentoHackathon\Composer\Magento\Plugin->requestRegeneration() at /home/lxc/magento24/mage24ee/magento/vendor/magento/magento-composer-installer/src/MagentoHackathon/Composer/Magento/Plugin.php:159
 MagentoHackathon\Composer\Magento\Plugin->onNewCodeEvent() at n/a:n/a
 call_user_func() at phar:///usr/bin/composer/src/Composer/EventDispatcher/EventDispatcher.php:164
 Composer\EventDispatcher\EventDispatcher->doDispatch() at phar:///usr/bin/composer/src/Composer/EventDispatcher/EventDispatcher.php:96
 Composer\EventDispatcher\EventDispatcher->dispatchScript() at phar:///usr/bin/composer/src/Composer/Installer.php:338
 Composer\Installer->run() at phar:///usr/bin/composer/src/Composer/Command/InstallCommand.php:122
 Composer\Command\InstallCommand->execute() at phar:///usr/bin/composer/vendor/symfony/console/Command/Command.php:245
 Symfony\Component\Console\Command\Command->run() at phar:///usr/bin/composer/vendor/symfony/console/Application.php:835
 Symfony\Component\Console\Application->doRunCommand() at phar:///usr/bin/composer/vendor/symfony/console/Application.php:185
 Symfony\Component\Console\Application->doRun() at phar:///usr/bin/composer/src/Composer/Console/Application.php:281
 Composer\Console\Application->doRun() at phar:///usr/bin/composer/vendor/symfony/console/Application.php:117
 Symfony\Component\Console\Application->run() at phar:///usr/bin/composer/src/Composer/Console/Application.php:113
 Composer\Console\Application->run() at phar:///usr/bin/composer/bin/composer:61
 require() at /usr/bin/composer:24

Then see on the trace what file does have bad permissions ! 

in my case it was the var/.regenrate file
to fix the issue i did : 

sudo rm var/.regenerate
touch var/.regenerate
composer install -v

No more issue with permisions