composer: composer.json is not writable
Hi there, I have Ubuntu/VPS, nginx, mariadb, /var/www/html/test.com/composer.json: permission=755, chown/chgrp=www-data/www-data
oldy: composer update/upgrade Code:
Update symfony/polyfill-ctype (v1.17.0 => v1.18.1) : Update failed (Could not delete /vendor/symfony/polyfill-ctype/README.md) Code:
./composer.json is not writable. |
You don't say what name you were working in. 755 means that the owner of the file has read, write and execute rights (4+2+1) but everyone else has read and execute only (4+1). So if you were working as www-data, you should have had write access, but not if you were logged on as yourself.
Similarly with your failed update. /vendor isn't a standard Linux directory but, as it's a top-level directory, I assume that it is owned by root. So you would have to be root to do an update. |
You don't say what name you were working in.
nginx, mariadb and Ubuntu/VPS. Or 'oldy: sudo root' Is that correct? oldy: composer require symfony/polyfill-ctype /var/www/html/test.com/vendor perm 755 Summary: - permission is 755 (ex. vendor and composer.json) - chown/chgrp: www-data/www-data - user is oldy, super user is root How can I do it now? |
If you want to update a software package, you must be root. In your case, that means using sudo with your own password. Once the update is done, the other problem may resolve itself.
If not, we'll deal with it then. |
oldy: sudo composer upgrade
or oldy: sudo composer require symfony/polyfill-ctype Quote:
|
OK, let's try something else. When you used "composer require" you were told:
./composer.json is not writable. So it looks as if you have a composer.json file in your home directory. Correct? In that case, just make it writable and see if that solves the problem. You can do it with chmod: Code:
chmod u+w composer.json |
oldy $ chown u+w composer.json
Quote:
oldy $ composer require symfony/polyfill-ctype Quote:
|
Sorry, instead of chowning and chmodding, shouldn't you run composer as www-data?
Code:
sudo -u www-data composer ... |
Yes, one step further.
composer update or upgrade, ok sudo -u www-data composer update or upgrade, ok composer require symfony/polyfill-ctype, ok Here is mariadb so I should have database/host/user/pass, but it fails: Something went wrong: SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo failed: Name or service not known Possibly I read this: /storage/logs/flarum-installer.log Quote:
|
The information you provide is patchy; all I can gather from it is that
|
ping archive.org
Quote:
One step further. I tested database (access_tokens.frm, access_tokens.ibd, api_keys.frm, api_keys.ibd, clarkwinkelmann_group_invitations.frm etc) with new server. oldy$ php --version PHP 7.4.3 user is only me. oldy$ sudo systemctl restart mariadb, ok oldy$ sudo systemctl restart php7.4-fpm.service, ok oldy$ sudo systemctl restart nginx, ok oldy$ sudo service mariadb restart, ok oldy$ sudo service php7.4-fpm restartm, ok oldy$ sudo service nginx restart, ok oldy$ sudo apt clean, ok oldy$ sudo apt update, ok oldy$ sudo apt upgrade, ok oldy$ sudo apt install, ok oldy$ sudo -u www-data composer update, ok oldy$ sudo -u www-data composer upgrade, ok oldy$ php flarum cache:clear, oldy$ php flarum migrate -vvv, oldy$ php flarum install -vvv Quote:
oldy$ sudo -u www-data php flarum migrate -vvv, ok oldy$ sudo -u www-data php flarum install -vvv, ok oldy$ pwd /var/www/html/test.com oldy$ sudo systemctl status mariadb (yellow font) Quote:
oldy$ mariadb -u root -p <password> Quote:
oldy$ sudo -u www-data systemctl status mariadb, ok Edit: I must have now 'sudo -u www-data composer/php ...<and password>' (long sentence every day from now) rather then short 'composer/php ...' |
All times are GMT -5. The time now is 11:47 PM. |