Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

chmod(): Operation not permitted

Tags:

composer-php

on composer install on my smfony project, I get always this message. Seems that all permissions are well done.

user@ubuntu:/var/www/html/sf-test$ composer install
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Nothing to install or update
Generating autoload files
ocramius/package-versions:  Generating version class...


  [ErrorException]                  
  chmod(): Operation not permitted  


install [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-dev] [--no-custom-installers] [--no-autoloader] [--no-scripts] [--no-progress] [--no-suggest] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--apcu-autoloader] [--ignore-platform-reqs] [--] [<packages>]...

The permissions

user@ubuntu:/var/www/html/sf-test$ ls -la
insgesamt 300
drwxrwxr-x 14 www-data www-data   4096 Jul  4 09:53 .
drwxrwxr-x  3 www-data www-data   4096 Jul  4 09:50 ..
drwxrwxr-x  2 www-data www-data   4096 Jul  4 09:50 assets
drwxrwxr-x  2 www-data www-data   4096 Jul  4 09:50 bin
-rwxrwxr-x  1 www-data www-data   2033 Jul  4 09:50 composer.json
-rwxrwxr-x  1 www-data www-data 208091 Jul  4 09:50 composer.lock
drwxrwxr-x  4 www-data www-data   4096 Jul  4 09:50 config
-rwxrwxr-x  1 www-data www-data   1231 Jul  4 09:50 .env
-rwxrwxr-x  1 www-data www-data   1231 Jul  4 09:50 .env.dist
drwxrwxr-x  7 www-data www-data   4096 Jul  4 09:57 .git
-rwxrwxr-x  1 www-data www-data    416 Jul  4 09:50 .gitignore
drwxrwxr-x  3 user      user        4096 Jul  4 09:58 .idea
-rwxrwxr-x  1 www-data www-data    302 Jul  4 09:50 package.json
-rwxrwxr-x  1 www-data www-data   1116 Jul  4 09:50 phpunit.xml.dist
drwxrwxr-x  2 www-data www-data   4096 Jul  4 09:50 public
drwxrwxr-x  6 www-data www-data   4096 Jul  4 09:50 src
-rwxrwxr-x  1 www-data www-data   9881 Jul  4 09:50 symfony.lock
drwxrwxr-x  3 www-data www-data   4096 Jul  4 09:55 templates
drwxrwxr-x  2 www-data www-data   4096 Jul  4 09:50 tests
drwxrwxr-x  2 www-data www-data   4096 Jul  4 09:50 translations
drwxrwxr-x  4 www-data www-data   4096 Jul  4 09:50 var
drwxrwxr-x 20 www-data www-data   4096 Jul  4 09:50 vendor
-rwxrwxr-x  1 www-data www-data    852 Jul  4 09:50 webpack.config.js

And this is my user:

user@ubuntu:/var/www/html/sf-test$ id
uid=1000(user) gid=1000(user) Gruppen=1000(user),0(root),4(adm),24(cdrom),27(sudo),30(dip),33(www-data),46(plugdev),118(lpadmin),128(sambashare)

Has anybody a hint for me, what I am failing with? Regards n00n

like image 272
n00n Avatar asked Dec 06 '22 11:12

n00n


2 Answers

I have had the same problem, but I solve it by deleting the /vendor folder and then run the composer install.

In your project folder you can run if you use ubuntu or other Linux distribution:

rm -rf vendor && composer install
like image 182
Darius Tsafack Avatar answered Mar 10 '23 22:03

Darius Tsafack


Same problem for me.

I fix this by deleting the cache directory of my user (who has to use composer) :

sudo rm -R /home/$USER/.cache/

and the vendor directory of this package :

sudo rm -R /PATH/TO/YOUR_PROJECT/vendor/ocramius

I also use ACL, don't know if its really important.

But after that composer update/install don't throw error anymore.

like image 44
chikken001 Avatar answered Mar 10 '23 23:03

chikken001