When I try to access my heroku page it says
"Application error An error occurred in the application and your page could not be served. If you are the application owner, check your logs for details"
This is my build log:
PHP app detected ! WARNING: No 'composer.json' found. Using
'index.php' to declare app type as PHP is considered legacy
functionality and may lead to unexpected behavior. Bootstrapping...
Installing platform packages... NOTICE: No runtime required in
composer.lock; using PHP ^5.5.17 apache (2.4.20) nginx (1.8.1) php
(5.6.30) Installing dependencies... Composer version 1.4.1 2017-03-10
09:29:45 Preparing runtime environment... NOTICE: No Procfile, using
'web: heroku-php-apache2'. Checking for additional extensions to
install... Discovering process types Procfile declares types -> web
Compressing... Done: 13.9M Launching... Released v119 deployed to
Heroku Build finished Blogs Careers Documentation
========================================================================
Related
I have a PHP solution which is being moved from PHP7.4 -> PHP8.1. This required updating many packages used, such as Symfony and Doctrine. Everything seems fine, but when I go to run my deployment script, which re-generates Doctrine proxy files, I encounter an error:
Fatal error: Uncaught Symfony\Component\Console\Exception\LogicException: An option named "em" already exists. in /usr/local/store/vendor/symfony/console/Input/InputDefinition.php:232
I've tried playing with the Doctrine and Symfony versions which are required (I've tried symfony/console 5.4.16 and 6.2.5, and I had to downgrade doctrine/dbal from 3.5.1 to 2.13.9 to fix a different issue in the same deployment step), but I can't find any combination of packages that solves this issue.
The deployment is running the following:
php ./vendor/bin/doctrine-module orm:generate-proxies --em=orm_databasename
This is the log of heroku, previous version of my code was running perfect but I change some code and have this error.
Rollback is no t solution same error now...
-----> Building on the Heroku-20 stack
-----> Using buildpack: heroku/php
-----> PHP app detected
-----> Bootstrapping...
-----> Installing platform packages...
- php (8.1.0)
- ext-mbstring (bundled with php)
- composer (2.1.14)
- apache (2.4.51)
- nginx (1.20.2)
-----> Installing dependencies...
PHP Fatal error: During inheritance of ArrayAccess: Uncaught ErrorException: Return type of Illuminate\Support\Collection::offsetExists($key) should either be compatible with ArrayAccess::offsetExists(mixed $offset): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /tmp/build_3007ab05/vendor/laravel/framework/src/Illuminate/Support/Collection.php:1349
I got the exact same error recently. My local php version is 8.0.13 and it is working fine, but when I uploaded it to heroku (the php version used here is 8.1) I got the error.
To solve the problem, I specified my php version in the composer.json to the exact same local php version that I'm using like this:
{
"require": {
"php": "8.0.13"
}
}
Don't forget to update the composer.lock, then upload it to heroku. Heroku will use that exact version.
I know it is not recommended to specify the exact version per https://devcenter.heroku.com/articles/php-support, but it is working fine as a workaround.
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"
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!
I am trying to push my PHP app to Bluemix with cf push phpinfo-jbs2 -b https://github.com/cloudfoundry/php-buildpack.git and I am getting a message that says BuildpackCompileFailed (full error below).
Any ideas on how to fix this?
[08:49 AM] jsloyer#Jeffs-MacBook-Pro-2 [php]>cf push phpinfo-jbs2 -b https://github.com/cloudfoundry/php-buildpack.git
Creating app phpinfo-jbs2 in org jbsloyer#us.ibm.com / space dev as jbsloyer#us.ibm.com...
OK
Creating route phpinfo-jbs2.mybluemix.net...
OK
Binding phpinfo-jbs2.mybluemix.net to phpinfo-jbs2...
OK
Uploading phpinfo-jbs2...
Uploading app files from: /Users/jsloyer/Downloads/php
Uploading 717, 3 files
Done uploading
OK
Starting app phpinfo-jbs2 in org jbsloyer#us.ibm.com / space dev as jbsloyer#us.ibm.com...
-----> Downloaded app package (4.0K)
Cloning into '/tmp/buildpacks/php-buildpack'...
Submodule 'compile-extensions' (https://github.com/cloudfoundry-incubator/compile-extensions) registered for path 'compile-extensions'
Cloning into 'compile-extensions'...
Submodule path 'compile-extensions': checked out 'ce9345a9a6e7b00266194cadd18dbef37e791a7b'
It looks like you're deploying on a stack (currently set to *lucid64*) that's not supported by this buildpack.
That could be because you're using a recent buildpack release on a deprecated stack.
If you're using the buildpack installed by your CF admin, please let your admin know you saw this error message.
If you at one point specified a buildpack that's at git URL, please make sure you're pointed at a version that supports this stack.
Staging failed: Buildpack compilation step failed
FAILED
BuildpackCompileFailed
TIP: use 'cf logs phpinfo-jbs2 --recent' for more information
Recently the company that owns development for Ubuntu (Cannonical) just announced it is dropping support for lucid 64 which is Ubuntu 10.04 LTS. What does this mean for Cloud Foundry and the PHP buildpack?
Well nothing really but there is a couple gotcha's you should know about.
If you are pushing an app to Cloud Foundry and getting an error message like the following there is a workaround you need to do to get the PHP buildpack to work.
[08:49 AM] jsloyer#Jeffs-MacBook-Pro-2 [php]>cf push phpinfo-jbs2 -b https://github.com/cloudfoundry/php-buildpack.git
.....
It looks like you're deploying on a stack (currently set to *lucid64*) that's not supported by this buildpack.
That could be because you're using a recent buildpack release on a deprecated stack.
If you're using the buildpack installed by your CF admin, please let your admin know you saw this error message.
If you at one point specified a buildpack that's at git URL, please make sure you're pointed at a version that supports this stack.
Staging failed: Buildpack compilation step failed
FAILED
BuildpackCompileFailed
What this is saying is the instance of Cloud Foundry that you are running on the default stack is an old version of Ubuntu. The PHP buildpack expects the newer version of linux. This stack is called cflinuxfs2, also known as Ubuntu 14.04.
To work around this you just need to specify the stack you want to use.
cf push phpinfo-jbs2 -b https://github.com/cloudfoundry/php-buildpack.git -s cflinuxfs2
More information on this issue can be found at Github.
To avoid these type of issues, you can use the compatible buildpack that has been pre-installed into Bluemix.
cf push <appname> -b php_buildpack
To see all pre-installed buildpacks:
cf buildpacks