While on windows,this command: composer require drupal/field_group -w results in an error:
[ErrorException]
rename(F:\Documents\work\projects\x2/vendor/composer/tmp-bb22b878ca9a5a45c963cc69e990dcf4.zip~,
F:\Documents\work\projects\x2/vendor/composer/tmp-bb22b878ca9a5a45c963cc69e990dcf4.zip):
Access is denied. (code: 5)
The command window was 'Run as Administrator'.
The vendor folder, composer.json and composer.lock are not hidden.
Any thoughts?
thanks,
-dave.
Are you sure that you are using adminitrator to execute the cmd?
You shouldnt use Administrator role to run composer commands.
But, you can try to run the next command, and execute the composer require again
chmod -R 777 F:\Documents\work\projects\x2/vendor/composer
Related
During running a dotnet console application I encountered this error. I ran it from a directory that had the .dll and .pdb file copied into it.
What is the cause of this error?
Please check chmod of application folder. When I change folder access mode, problem was resolved. I know it is a little weird but sometimes it can be related to that :)
You have to determine them like that;
sudo chown -R yourusername:yourusername /var/www/
sudo setfacl -R -d -m u:yourusername:rwx,g:yourusername:rwx,o::r /var/www/
If you don't have setfacl command please install ACL package via this command;
sudo apt install acl
If this doesn't work, please use this command when publishing your project(in Package Manager Console of Visual Studio);
dotnet publish -c Release --self-contained --runtime linux-x64 -o out
And it will create "out" folder in your solution directory, you can copy its contain to server.
the deps.json and runtimeconfig.json must also be copied into the directory that the .dll is invoked in. Without these files you will encounter this error.
If you're doing post-build copies, make sure to include these files.
I receive this error when I had compiled the dll using the incorrect runtime.
Running a linux-x64 binary on a linux-arm64 system will show this error and vice versa.
If you are running a solution that has multiple projects, check to make sure the correct startup project is set.
When I deploy my project with capistrano (for Symfony), I have this error :
INFO [72050b7f] Running /usr/bin/env composer install --no-dev --prefer-dist --no-interaction --quiet --optimize-autoloader as dome#XX.XXX.XXX.XXX
DEBUG [72050b7f] Command: cd /var/www/dev/Dome/releases/20160812073355 && ( export SYMFONY_ENV="prod" ; /usr/bin/env composer install --no-dev --prefer-dist --no-interaction --quiet --optimize-autoloader )
DEBUG [72050b7f] The disk hosting /var/www/.composer is full, this may be the cause of the following exception
DEBUG [72050b7f]
DEBUG [72050b7f]
[ErrorException]
ZipArchive::extractTo(): No space left on device
Can you help me ?
Just clear cache of composer use composer clear-cache
Reference
Use df -h to check all partitions (make sure to check the relevant partition, there can be multiple) and free space if possible.
Alternative options;
You can try changing the Composer home directory to another partition/location using the environment variable COMPOSER_HOME=/new/path.
You can disable the cache directory by using COMPOSER_CACHE_DIR=/dev/null.
The disk hosting /var/www/.composer is full.
The message is quite expressive, you have run out of ROM memory on your disk / partition, and can no longer download even source-code packages with composer.
I suggest you to either change of disk, or if it is a virtual partition, to improve the memory-size.
This does not seem to be related with either Capistrano, Symfony, Composer or PHP.
You have no permission to run the commands, if it works with sudo you did your deploy with root privilegies in the first place.
How do I install/setup Drupal Console on Windows 7? In the video by the author, the environment used is Linux.
I tried to install it on Windows 7, but I wasn't able to use it to generate a module code.
You can download the drupal console either using Git Bash
$curl https://drupalconsole.com/installer -L -o drupal
Or using windows command prompt
c:\>php -r "readfile('https://drupalconsole.com/installer');" > drupal
After downloading this file, place it beside php.exe file within your php folder (not project folder), restart your terminal/cmd-prompt and type
$drupal
to get started.
Besides downloading Drupal Console .phar file, you can also install Drupal Console using composer on windows.
First Download and install composer in your system.
Then on your windows command prompt or git terminal
$composer global require drupal/console:#stable
Create a file called drupal.bat
#php "%~dp0drupal.phar" %*
Here's the full list of steps I took:
php -r "readfile('https://drupalconsole.com/installer');" > drupal.phar
added installation location to the global PATH
created a drupal.bat file in the same directory as drupal.phar. drupal.bat contains: #php "%~dp0drupal.phar" %*
Now you can call >drupal from any location. I would upvote #Nate's answer, but this is a new account.
Open Git bash (or any terminal with curl capability)
Run curl https://drupalconsole.com/installer -L -o drupal.phar
Create file drupal.bat with content #php "%~dp0drupal.phar" %*
Copy both files (drupal.phar and drupal.bat) into C:\WINDOWS
Open new Command prompt window then try typing drupal list.
This steps assume:
Your PHP is on Path environment variables and you can run php --version.
You have Git for Windows installed.
you can install drupal console using composer
open the command line on windows then go to :
cd /path/to/drupal8.dev
now you can install drupal console :
composer require drupal/console:~1.0 --prefer-dist --optimize-autoloader
after that you installed drupal console you can use it from drupal root directory where composer.json exist as follow:
vendor/bin/drupal <the_command>
you should replace <the_command> with one of the drupal console commands. you can see complete list of the commands here: drupal console commands
Find a php.exe
Add this path to the environnement variable path
from terminal run
php -r "readfile('https://drupalconsole.com/installer');" > drupal.phar
i then use php-storm IDE :
file/settings/command line
add tool based on symfony console
fill php path and drupal.phar path
console is now set
tools/run command
drupal list
if you have php and composer all setup
make sure you're in your drupal root folder..open powershell (anyother cli) and do '
composer require drupal/console
'after this add.
'C:\<path to your drupalwebsite root folder>\vendor\bin'
to your paths Environment variables
and you have composer installed: Remember to install and add composer to path variables for every local drupal installation.
I install Symfony 2.3.0-DEV this way:
composer self-update
git clone https://github.com/symfony/symfony-standard test1
copy .\test1\app\config\parameters.yml .\test1\app\config\parameters.yml.dist
composer install
But, Every time I've had to rename (ie. to "test2") the project folder. My installation breaks and shows errors:
Warning: require_once(C:\xampp\htdocs\symfony-projects\test1\web/../app/bootstrap.php.cache): failed to open stream: No such file or directory in C:\xampp\htdocs\symfony-projects\test1\web\app_dev.php on line 19
Fatal error: require_once(): Failed opening required 'C:\xampp\htdocs\symfony-projects\test1\web/../app/bootstrap.php.cache' (include_path='.;\xampp\php\PEAR') in C:\xampp\htdocs\symfony-projects\test1\web\app_dev.php on line 19
I tried, deleting cache folders, deleting the bootstrap.cache.php file, and re-installing/updating vendors, including the autoloader, also with cache:warmup and cache:clear, changing permissions. And still nothing...
Finally solved it ! That's what I've done.
composer self-update
git clone https://github.com/symfony/symfony-standard test1
copy .\test1\app\config\parameters.yml .\test1\app\config\parameters.yml.dist
composer install
Loaded http://localhost/symfony-projects/test1/web/app_dev.php once.
Closed the browser (chrome), stopped xampp (apache/mysql), and the powershell
Deleted /app/cache/* and /app/bootstrap.php.cache file
Closed the IDE, Logoff my user session in Windows 8 (starting feeling paranoid)
Renamed the folder test1 to test2
Executed composer update command to call post-update-cmd scripts to be sure that bootstrap.php.cache is rebuild
Went to http://localhost/symfony-projects/test2/web/app_dev.php
And then works. Probably that issue was due to locked files...
#Touki Thanks, the APC thing was a good insight but not needed it ;)
this topic is quite old but I just had the same problem. The problem was: I installed symfony2 using command:
php composer.phar create-project symfony/framework-standard-edition myProject 2.1.x-dev
but I had the same fatal error. However, my solution was to go myProject directory and run command:
composer update
And that is all, project was rebuilded and file "bootstrap.php.cache" appeard :)
I hope this helps.
Next time, just restart your machine.
I am trying to install Symfony 2.1.3 (latest). I am running composer and installs everything okay. The only error that I get is:
Script Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::clearCache
handling the post-install-cmd event terminated with an exception
[RuntimeException]
An error occurred when executing the "'cache:clear --no-warmup'" command.
It's being installed under www folder. I am running nginx and followed the composer approach. I read on internet that apache should be run manually not as a service, however I am using nginx instead. Does apache still have any bearing on it? I'm using debian squeeze.
Edit: As per AdrienBrault's suggestion the error was because the timezone was not set in the php.ini. Only with --verbose I could see the warning. Thanks guys.
Apache is not related - PHP is called via command line.
Most likely is the permission in the cache folder: did you check if the user that runs the composer update can actually write the cache folder?
Try to manually run rm -Rf app/cache/dev (for production environment replace dev with prod) and see if you get any permission error.
Also you will get this error if the default.timezone setting is not configured in php when running in CLI. To verify just run
php --info | grep timezone
and check that the setting date.timezone is correctly configured.
On the security side, setting 777 to the folder is not the optimal solution - if you have ACL enabled you could use that to correctly set up the permission for the cache and logs folder. Read more at the Symfony2 official installation page
I had this same issue for a while and after hours of face to brick wall pounding I realized... I have a .gitmodule in my project, and on initial checkout these submodules are NOT initialized and as such are not there for your composer to update, which results in the above error.
Make sure you run the following
git submodule update --init src/Acme/Sadness/Bundle
of course replace src/Acme/Sadness/Bundle with YOUR project namespace.
Hope this helps someone not go through the same pain I just did.
If you have vendor folder already I would remove it and install symfony 2.1.3 again via "composer.phar install". Problem might be coming from outdated version of composer
I had the same problem and I resolve in this way.
execute this on the console
and you should see something like this
$ locate php.ini
/etc/php5/apache2/php.ini
/etc/php5/cli/php.ini
/etc/php5/fpm/php.ini
the first line is probably your php.ini that appear when you do a phpinfo();
the problem is that when you execute composer update this no check the same php.ini
in my case the second line
all my sites work fine but always I had problems not now
after edit the second file and put the same time zone that you set in the first one
run
$ sudo service apache2 reload
and now
$ composer update
I hope that this work for you like work for me
regards
Emiliano