Based on this article: https://mattstauffer.co/blog/installing-a-laravel-app-on-heroku
Im trying to deploy my app to Heroku but when I do the push I get this error:
remote: -----> Preparing runtime environment...
remote: ln: failed to create symbolic link ‘./heroku-hhvm-apache2’: File exists
remote: ln: failed to create symbolic link ‘./heroku-hhvm-nginx’: File exists
remote: ln: failed to create symbolic link ‘./heroku-php-apache2’: File exists
remote: ln: failed to create symbolic link ‘./heroku-php-nginx’: File exists
remote:
remote: ! Push rejected, failed to compile PHP app
remote:
remote: Verifying deploy....
remote:
remote: ! Push rejected to studapp-stage.
remote:
To https://git.heroku.com/studapp-stage.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/studapp-stage.git'
I made this change on Heroku:
heroku config:set BUILDPACK_URL=https://github.com/heroku/heroku-buildpack-php
Can someone help me?
Thanks in advance!
Related
I am getting the below error when trying to deploy my Laravel app to heroku. Has anyone experienced this error before?
Running 'composer compile'...
remote: > #php -dphar.readonly=0 bin/compile
remote: Could not open input file: bin/compile
remote: Script #php -dphar.readonly=0 bin/compile handling the compile event returned with error code 1
remote:
remote: ! ERROR: Compile step failed!
remote: !
remote: ! Installation of dependencies was successful, but the custom
remote: ! script you're using to perform actions after 'composer install'
remote: ! failed with the error above.
remote: !
remote: ! Check that the 'compile' command(s) in the 'scripts' section of
remote: ! your 'composer.json' are working properly and not running into
remote: ! timeouts or memory limits.
remote: !
remote: ! For more information on the 'composer compile' step, refer to
remote: ! https://devcenter.heroku.com/articles/php-support
remote: !
remote: ! REMINDER: the following warnings were emitted during the build;
remote: ! check the details above, as they may be related to this error:
remote: ! - Your 'composer.lock' is out of date!
remote:
remote: ! Push rejected, failed to compile PHP app.
Compile Script:
"scripts": {
"compile": "#php -dphar.readonly=0 bin/compile"
}
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.
I'm trying to push a test Laravel application to Heroku but whenever I try to do so I get an error and the deployment stops. This is whats displayed when I do a deploy:
remote: Generating optimized autoload files
remote: > Illuminate\Foundation\ComposerScripts::postInstall
remote: > php artisan optimize
remote:
remote:
remote: [InvalidArgumentException]
remote: Please provide a valid cache path.
remote:
remote:
remote: Script php artisan optimize handling the post-install-cmd event returned with error code 1
remote: ! Push rejected, failed to compile PHP app.
remote:
remote: ! Push failed
remote: Verifying deploy...
What's the issue here? The storage/framework folder has all the needed folders and they're included in the repository. So whats wrong here?
Just check the gitignore file if has /storage/.key or /storage/ remove it and again run commit and push.
If I push my PHP app from Cloud9 to Heroku, my application will be deployed on Heroku. The question is that in the future, if I have to perform some bug fixing or update etc., will I be able to edit the application hosted/deployed on Heroku?
EDIT:
zeldish:~/workspace/appzeld (master) $ git push heroku master
Counting objects: 3, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (3/3), done.
Writing objects: 100% (3/3), 381 bytes | 0 bytes/s, done.
Total 3 (delta 2), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Using set buildpack heroku/php
remote: -----> PHP app detected
remote:
remote: ! WARNING: No 'composer.json' found.
remote: Using 'index.php' to declare app type as PHP is considered legacy
remote: functionality and may lead to unexpected behavior.
remote:
remote: -----> Bootstrapping...
remote: -----> Installing platform packages...
remote: NOTICE: No runtime required in composer.lock; using PHP ^5.5.17
remote: - apache (2.4.20)
remote: - nginx (1.8.1)
remote: - php (5.6.22)
remote: -----> Installing dependencies...
remote: Composer version 1.1.2 2016-05-31 19:48:11
remote: -----> Preparing runtime environment...
remote: NOTICE: No Procfile, using 'web: vendor/bin/heroku-php-apache2'.
remote: -----> Checking for additional extensions to install...
remote:
remote: -----> Discovering process types
remote: Procfile declares types -> web
remote:
remote: -----> Compressing...
remote: Done: 13.9M
remote: -----> Launching...
remote: Released v4
remote: https://*******.herokuapp.com/ deployed to Heroku
remote:
remote: Verifying deploy... done.
To https://git.heroku.com/********.git
59f63a5..4375225 master -> master
Simple answer is yes. You will be able to push every changes you make to your application. in order to do that you can simply run below command and you will be able to see all the changes you have made after you push to your repository.
$ git init
$ heroku create
$ echo '{}' > composer.json
$ heroku buildpacks:set heroku/php
(you will need to run above commands when you deploying your app first time. This command will create repository on heroku for you and it will set php buildpack on heroku.)
$ git add .
$ git commit -am "some comment"
$ git push heroku master
$ heroku open
to getting started click here
I'm trying to publish my Laravel app on Heroku.
I have excluded the composer.lock file from .gitignore, and created a Procfile containing
web: vendor/bin/heroku-php-apache2 public
I created my app with
heroku create myapp;
git push heroku master;
Then I get the following output:
git -c diff.mnemonicprefix=false -c core.quotepath=false -c credential.helper=sourcetree push -v --tags heroku master:master
Pushing to https://git.heroku.com/myapp.git
POST git-receive-pack (1914 bytes)
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Node.js app detected
remote: -----> Resetting git environment
remote:
remote: PRO TIP: Specify a node version in package.json
remote: See https://devcenter.heroku.com/articles/nodejs-support
remote:
remote: -----> Defaulting to latest stable node: 0.10.35
remote: -----> Downloading and installing node
remote: -----> Exporting config vars to environment
remote: -----> Installing dependencies
remote: npm WARN package.json myapp#0.0.0 No repository field.
remote: -----> Cleaning up node-gyp and npm artifacts
remote: -----> Building runtime environment
remote: -----> Discovering process types
remote: Procfile declares types -> web
remote:
remote: -----> Compressing... done, 9.6MB
remote: -----> Launching... done, v5
remote: https://myapp.herokuapp.com/ deployed to Heroku
remote:
remote: Verifying deploy... done.
To https://git.heroku.com/myapp.git
5b1c663..0dff021 master -> master
updating local tracking ref 'refs/remotes/heroku/master'
Completed successfully
If I browse to my app, however I get an application error.
When I look to my logs, it says
app[web.1]: bash: vendor/bin/heroku-php-apache2: No such file or directory
I suspect that somehow, Heroku didn't do composer install, as it's not in my git output, and maybe it didn't even recognize that my app is an PHP app?
To be sure, I also included an empty index.php file in my root. Didn't help.
What am I missing here?
I believe I found it. Should better read the lines ("Node.js app detected").
Solved by firing this command :
heroku config:add BUILDPACK_URL=https://github.com/heroku/heroku-buildpack-php
and pushing again
Haha, just simply drop the package.json in your laravel project.
And then Heroku will detect your app as a php project.
Be sure to include the trailing slash on public: public/. This was my issue - I am using Laravel and got a Image source not readable and NotReadableException in AbstractDecoder.php line 302: because it thought at AbstractDecoder->init('/app/public') in AbstractDriver.php line 64 was a file, not a folder.