Azure php Error Deployment from local git - using tutorial - php

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"

Related

Adding LaravelAdmin To Laravel 8 project Gone Wrong

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.

`git push heroku master` returns error

I am trying to create a simple project on Heroku by pushing a git which contains only a php ('Hello World') file, am empty README file and an empty json file.
When I enter git push heroku master in the terminal to do this I (partly) get the following response:
remote: ! Push failed due to an unrecognized error, and we've been notified.
remote:
remote: ! Please try pushing again.
remote: ! If the problem persists, see http://help.heroku.com/ and provide Request ID *my_project_id*.
remote:
remote:
remote: Verifying deploy...
remote:
remote: ! Push rejected to *my_project_name*.
remote:
To https://git.heroku.com/*my_project_name*.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/*my_project_name*.git'
Because of this I cannot properly run any new Heroku app (which may include only a php 'Hello World' file).
This error was presented suddenly after I have already used successfully git push heroku master for dozens of heroku apps (the same day).
Actually, this error was presented to me also when I tried to edit an app which was already running properly.
How can I fix this?
I am pretty sure that I was affected by deployment failures occurring on Heroku itself and it was not anything about what I did which caused this error.
When something goes wrong I tend to think that I am doing something wrong but sometimes it may be that something wrong is occurring at the other side of my computer.

Error using composer to install Drupal: The system cannot find the file specified. (code: 2)

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

Openshift - PHP Fatal error: require(): Failed opening required

I want to push my php(laravel) project to openshift but I get the following errors from git bash:
This is what I did:
Created a brand new laravel application from openshift's website
Cloned the app to my local machine
Made some changes
Committed
Pushed
This is what I get when I attempt to access my url:
Any suggestions?
the vendor folder was not committed. Check your .gitignore you will notice that the vendor folder is ignored

Heroku Push rejected, failed to compile PHP app

Deployment to Heroku for my project has been working fine until today. Last update to my composer file was including a php class to my class map in composer.json. Now Heroku Deployment fails with this error message
-----> Removing .DS_Store files
-----> Fetching custom git buildpack... done
-----> PHP app detected
-----> No runtime required in composer.json, defaulting to PHP 5.6.11.
-----> Installing system packages...
- PHP 5.6.11
gzip: stdin: unexpected end of file
tar: Child returned status 1
tar: Error is not recoverable: exiting now
! Push rejected, failed to compile PHP app
I have tried updating composer, but updating composer.lock doesn't solve this issue for me.
Any help would be appreciated.
Heroku is having problems at the moment: https://status.heroku.com/incidents/792
Don't worry, it's not just you!

Categories