I want to use LaravelAdmin so I tried running the command composer require encore/laravel-admin at my Laravel 8 project.
Then I keep getting this error at the terminal:
Cloning failed using an ssh key for authentication, enter your GitHub credentials to access private repos Head to https://github.com/settings/tokens/new?scopes=repo&description=Composer+on+DESKTOP-MB1VP3M+2022-10-22+1844 to retrieve a token. It will be stored in "C:/Users/PV/AppData/Roaming/Composer/auth.json" for future use by Composer. Token (hidden):
So I tried defining a key for myself in Github (Personal access tokens (classic) with repo checkbox turned on) and ran this command:
composer config --global --auth github-oauth.github.com [key]
Then I tried one more time to download Laravel Admin but another error came up:
Installation failed, reverting ./composer.json and ./composer.lock to their original content.
[RuntimeException]
Failed to execute git clone --mirror -- "https://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:x-oauth-basic#github.com/doctrine/cache.git" "C:/Users/PV/AppData/Local/C
omposer/vcs/https---github.com-doctrine-cache.git/"
Cloning into bare repository 'C:/Users/PV/AppData/Local/Composer/vcs/https---github.com-doctrine-cache.git'...
fatal: unable to access 'https://github.com/doctrine/cache.git/': OpenSSL SSL_connect: Connection was reset in connection to github.com:443
So what on earth is going wrong here?
I'm really confused now, please help me to solve this issue... thanks.
Related
so I'm new to azure deployment and I try my best to use the microsoft documentation tutorial
https://learn.microsoft.com/en-us/azure/app-service/tutorial-php-mysql-app?pivots=platform-windows
everything is fine until "Deploy to Azure" Step in :
git push azure main
remote: [ErrorException]
remote: Trying to access array offset on value of type null
remote: An error has occurred during web site deployment.
remote:
remote: composer failed
remote:
remote:
remote: Error - Changes committed to remote repository but deployment to website failed.
To https://phpmysqldemogs.scm.azurewebsites.net/phpMysqlDemoGS.git
The log detail from Deployment Center > Logs show I have failed commit with detail log
Command: bash deploy.sh
Creating app_offline.htm
KuduSync.NET from: 'C:\home\site\repository' to: 'C:\home\site\wwwroot'
Deleting app_offline.htm
Running composer install
[ErrorException]
Trying to access array offset on value of type null
An error has occurred during web site deployment.
composer failed
[ErrorException] \r\n Trying to access array offset on value of type null\r\nC:\Program Files (x86)\SiteExtensions\Kudu\95.30831.5373\bin\Scripts\starter.cmd bash deploy.sh
I tried to push again, it says "already up to date"
I tried to clone repo from azure, do composer install then php artisan serve ... it worked locally, so I assume that the problem is in deployment configuration. Can anyone help the production problem?
Thanks in advance.
This error Error - Changes committed to remote repository but deployment to website failed. occurs when you push a local branch that doesn't match the app deployment branch on 'azure'.
To resolve this error, Verify that the current branch is master. To change the default branch, use DEPLOYMENT_BRANCH application setting (refer to Change deployment branch).
You are also getting Trying to access array offset on value of type null error and that is failing composer.
To resolve this error, you need to updater the composer.
composer update
OR
php composer.phar update
You can refer to Troubleshoot deployment and Error "Trying to access array offset on value of type null"
I am trying to create a new Laravel project in PhpStorm using the below steps.
Chosen option "Download composer from composer.org".
In the package list i have selected laravel/laravel with default version.
Create project.
After loading all the files it displays a short message in the bottom right corner of the IDE "Failed to run composer create-project" and I am unable to see that first page that comes when we run server.
I have also tried it using terminal by going into xampp/htdocs in VSCode and then running the below command
composer new laravel/installer
Changed current directory to /Users/abhishekabhishek/.composer
But it gives me the following error
The "https://repo.packagist.org/packages.json" file could not be downloaded: failed to open stream: Operation timed out
Retrying with degraded mode, check https://getcomposer.org/doc/articles/troubleshooting.md#degraded-mode for more info
I have no idea what is going on. Can anyone please help me resolve this issue. I am running this on Mac, there is nothing that I came across that can resolve this problem.
Step 1:
Download composer
Step 2:
Download the Laravel installer using Composer.
composer global require laravel/installer
Step 3:
laravel new blog
Step 4:
php artisan serve
This command will start a development server at http://localhost:8000
Tips:
After installing Laravel, you may need to configure some permissions. Directories within the storage and the bootstrap/cache directories should be writable by your web server or Laravel will not run.
sudo chmod 777 -Rf /folder/bootstrapdirectoryorcachedirectory
You dont need any VSCode or PHP Storm to do that.
I added a wrong github token to my global composer configuration and cannot remove it again.
I did
composer config --global --auth github-oauth.github.com myWrongTokenDamn
Now I cannot overwrite it by executing it again with the correct token and I don't know where this information is stored to remove it manually.
The command to show where it is stored just gives me the error, that I am using the wrong token. Thanks I know that....
I use Ubuntu 18.04 and installed composer following these instructions and then moving the binary to /usr/bin/composer.
Reinstalling didn't help either, so the information clearly is not stored at /usr/bin/composer
Weird solution:
I noticed that the behaviour did only occur, when I was within my current project, which had of course a composer.json file
What I did then I moved to my home directory and executed the the command again this time with the correct token:
composer config --global --auth github-oauth.github.com myCorrectLongToken
And the error message is gone.
While I am happy about the fix, it would be good if someone could explain what happened in the background.
Now
$ composer config --list
gives me the list of all settings including [home]
[home] /home/myUser/.config/composer
where everything is stored.
I've been trying to troubleshoot this error in many ways (including re-installing composer, clearing the cache, diagnosing composer, checking for an empty AutoRun folder in the registry etc.) I've also tried installing Drush first but get the same error.
For clarity this is my first Drupal install, but I've been very careful up to this point and no warnings or errors are showing up in my php.
I've been running the following from the admin (and default) command line:
composer create-project drupal-composer/drupal-project:8.x-dev
The full error message is as follows:
Installing drupal-composer/drupal-project (8.x-dev 3b9ee0d3a1c9363d53fc6da4111701269496e9ca)
- Installing drupal-composer/drupal-project (8.x-dev 3b9ee0d)
Cloning 3b9ee0d3a1c9363d53fc6da4111701269496e9ca
Failed to download drupal-composer/drupal-project from source: RecursiveDirectoryIterator::__construct(C:\drupal-project,C:\drupal-project): The system cannot find the file specified. (code: 2)
Now trying to download from dist
- Installing drupal-composer/drupal-project (8.x-dev 3b9ee0d)
[UnexpectedValueException]
RecursiveDirectoryIterator::__construct(C://drupal-project/,C://drupal-project/):
The system cannot find the file s pecified. (code: 2)
So far I haven't come across the same error posted anywhere; any help would be hugely appreciated. My next move would be to install Drupal directly from Git but I understand this is not recommended for maintainability.
Try this following command :
composer create-project drupal-composer/drupal-project:8.x-dev ./ --stability dev -vv
This can display an error token message , github have protection from web crawling, so you need to create a token on github like was indicated in message
I have a laravel 4.1 modular system and when I try to add a package to system and update using composer's "composer update" command in console, I get the following error:
[RuntimeException]
Could not completely delete /var/www/panel.uygulamam2.com/vendor/phpseclib/phpseclib, aborting.
Why do I get phpseclib error?
Check the permission over vendor folder and make sure your current user is the owner