Git Product home page Git Product logo

php-getting-started's Introduction

php-getting-started

A barebones PHP app that makes use of the Slim web framework, which can easily be deployed to Heroku.

This application supports the Getting Started with PHP on Heroku article - check it out.

Deploying

Using resources for this example app counts towards your usage. Delete your app and database as soon as you are done experimenting to control costs.

By default, apps use Eco dynos if you are subscribed to Eco. Otherwise, it defaults to Basic dynos. The Eco dynos plan is shared across all Eco dynos in your account and is recommended if you plan on deploying many small apps to Heroku. Learn more about our low-cost plans here.

Eligible students can apply for platform credits through our new Heroku for GitHub Students program.

Install the Heroku Toolbelt.

$ git clone [email protected]:heroku/php-getting-started.git # or clone your own fork
$ cd php-getting-started
$ heroku create
$ git push heroku main
$ heroku open

or

Deploy to Heroku

Documentation

For more information about using PHP on Heroku, see these Dev Center articles:

php-getting-started's People

Contributors

amerine avatar dependabot[bot] avatar djmattyg007 avatar dzuelke avatar edmorley avatar jonmountjoy avatar jonnymacs avatar joshwlewis avatar mbren avatar ntassone avatar schneems avatar silverbux avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

php-getting-started's Issues

no longer compatible with app setup API?

this used to work, or the problem is on the API?

curl -n -X POST https://api.heroku.com/app-setups \
-H "Content-Type:application/json" \
-H "Accept:application/vnd.heroku+json; version=3" \
-d '{"source_blob": { "url":"https://github.com/heroku/php-getting-started/tarball/master/"} }'

A

J

Add example tests, that can be run by Heroku CI

I tried enabling Heroku CI on a Heroku pipeline linked to this repository, however the CI run failed with:

-----> Running PHP buildpack tests...
realpath: vendor/bin: No such file or directory
Trying to auto-detect test framework; first match will be found. You may use composer script 'test', or app.json, to specify what to run.
No tests found. Please use composer script 'test', or app.json, to specify what to run.
-----> PHP buildpack tests failed with exit status 1

(see https://dashboard.heroku.com/pipelines/fd8213bf-4356-40a1-aab8-c7042a64713e/tests/1)

I think it would be useful to add some example tests to this repo, since:

  1. It gives people something on which they can base their own tests
  2. They can help verify the correctness of this example project, so we're not just relying on Review Apps.

Running the 'getting started' process will fail with current composer.lock

https://devcenter.heroku.com/articles/getting-started-with-php#deploy-the-app

Probably because PHP 7.0.2 will be used in combination with some dependencies that are not compatible. Removing composer.lock, running composer install and pushing changes fixed this for me.

Complete error log:

git push heroku master                                     
Counting objects: 140, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (75/75), done.
Writing objects: 100% (140/140), 28.30 KiB | 0 bytes/s, done.
Total 140 (delta 51), reused 140 (delta 51)
remote: Compressing source files... done.
remote: Building source:
remote: 
remote: -----> PHP app detected
remote: -----> Bootstrapping...
remote: -----> Installing system packages...
remote:        NOTICE: No runtime required in composer.json; requirements
remote:        from dependencies in composer.lock will be used for selection
remote:        - php (7.0.2)
remote: 
remote:  !     ERROR: Failed to install system packages.
remote:        
remote:        Your platform requirements (for runtimes and extensions) could
remote:        not be resolved to an installable set of dependencies, or a
remote:        repository was unreachable.
remote:        
remote:        Full error information from installation attempt:
remote:        
remote:        > Loading repositories with available runtimes and extensions
remote:        > 
remote:        >   - Installing heroku/installer-plugin (1.0.0)
remote:        >     Symlinked from /app/tmp/buildpacks/php/support/installer/
remote:        > 
remote:        >   - Installing php (7.0.2)
remote:        >     Downloading: 100%
remote:        > 
remote:        > 
remote:        >                                                                                                                                                                                                                     
remote:        >   [RuntimeException]                                                                                                                                                                                                
remote:        >   Failed to execute 'tar -xzf '/tmp/build_fd02994fae740c7dae969cf216197376/.heroku/php/vendor/composer/9b653c79/1f67e6a0d367af0e0cdd9923f4b2e113.gz' -C '/tmp/build_fd02994fae740c7dae969cf216197376/.heroku/php''  
remote:        >                                                                                                                                                                                                                     
remote:        >                                                                                                                                                                                                                     
remote:        >   gzip: stdin: unexpected end of file                                                                                                                                                                               
remote:        >   tar: Unexpected EOF in archive                                                                                                                                                                                    
remote:        >   tar: Unexpected EOF in archive                                                                                                                                                                                    
remote:        >   tar: Error is not recoverable: exiting now                                                                                                                                                                        
remote:        >                                                                                                                                                                                                                     
remote:        >                                                                                                                                                                                                                     
remote:        > 
remote:        > 
remote:        > install [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-dev] [--no-plugins] [--no-custom-installers] [--no-autoloader] [--no-scripts] [--no-progress] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--ignore-platform-reqs] [--] [<packages>]...
remote:        > 
remote:        > 
remote:        
remote:        Please verify that all requirements for runtime versions in
remote:        'composer.lock' are compatible with the list below, and ensure
remote:        all required extensions are available for the desired runtimes.
remote:        
remote:        For reference, the following runtimes are currently available:
remote:        
remote:        PHP:  7.0.2, 7.0.1, 7.0.0, 5.6.17, 5.6.16, 5.5.31, 5.5.30
remote:        HHVM: 3.5.1
remote:        
remote:        For a list of supported runtimes & extensions on Heroku, please
remote:        refer to: https://devcenter.heroku.com/articles/php-support
remote: 
remote: 
remote:  !     Push rejected, failed to compile PHP app

Issues with Ubuntu 14.04 LTS

I tried to get the app running locally with foreman before pushing to Heroku (which worked like a charm) and hit a lot of issues that I fully described on my blog (https://berezovskiy.me/2015/02/deploying-sample-silex-app-to-heroku/). Here is a short list:

  • Ubuntu 14.04 doesn't provide PHP 5.5.11 & Apache 2.4.10 by default
  • Script uses completely wrong executable names (see heroku/heroku-buildpack-php#55) etc.

I am surprised to be the first to report this issue: either I was doing something terribly wrong or nobody tried to do this on Ubuntu LTS before.

permission denied when installing heroku cgi standalone

The following commands in the standalone installation section require root.

  • mkdir -p /usr/local/lib /usr/local/bin
  • tar -xvzf heroku-OS-ARCH.tar.gz -C /usr/local/lib
  • ln -s /usr/local/lib/heroku/bin/heroku /usr/local/bin/heroku

Composer self-update

First, the php-getting-started example is totally fine and works good to me, this is just a "notice".
During the tutorial, the Heroku console is telling me that I should update the composer itself. I've read the docs, but I still don't geht how to run composer self-update on heroku?

(...)
remote: -----> Installing dependencies...
remote:        Composer version 1.0-dev (c5cd184767001f34177da99e91f7a6dcf8ad27f6) 2015-03-24 01:36:30
remote:        Warning: This development build of composer is over 30 days old. It is recommended to update it by running "/app/.heroku/php/bin/composer self-update" to get the latest version.
remote:        Loading composer repositories with package information
(...)

Is currently unable to handle request [HTTP ERROR 500]

For the past week i have trying to deploy on heroku and get an handle on the system and how it works, build after build debugs after debugs, now i have reached an error that kind of baffles and i dont know which direction to take, i have setup a symfony/Bootstrap aoo deployed on Heroku, the build goes well, now that im trying to accept the app url i get a.

'This page isn’t working interfaceapp.herokuapp.com is currently unable to handle this request.
HTTP ERROR 500 ', nothing shows up on the deploy log i have to way to understand why am i getting this error.

Action '-D NO_DETACH -C Include 'path/to/clone/php-getting-started/vendor/heroku/heroku-buildpack-php/conf/apache2/heroku.conf' failed on Ubuntu 14.04

Having issues with running the getting-started app locally. I symlinked apachectl to httpd to get to the point that I could start httpd, but didn't get any further after that.

 $ /usr/sbin/apachectl -v
 Server version: Apache/2.4.16 (Ubuntu) 
 Server built:   2015-09-08T00:00:00

 $ php-fpm -v
 PHP 5.5.30-1+deb.sury.org~trusty+1 (fpm-fcgi) (built: Oct  4 2015 16:27:23)

When running the following command:

vendor/bin/heroku-php-apache2 web/

I get:

DOCUMENT_ROOT changed to 'web/'
4 processes at 128MB memory limit.
Starting php-fpm...
Starting httpd...
Application ready for connections on port 19661.
Usage: /usr/sbin/apache2 [-D name] [-d directory] [-f file]
[-C "directive"] [-c "directive"]
[-k start|restart|graceful|graceful-stop|stop]
[-v] [-V] [-h] [-l] [-L] [-t] [-T] [-S] [-X]
Options:
-D name : define a name for use in directives
-d directory : specify an alternate initial ServerRoot
-f file : specify an alternate ServerConfigFile
-C "directive" : process directive before reading config files
-c "directive" : process directive after reading config files
-e level : show startup errors of level (see LogLevel)
-E file : log startup errors to file
-v : show version number
-V : show compile settings
-h : list available command line options (this page)
-l : list compiled in modules
-L : list available configuration directives
-t -D DUMP_VHOSTS : show parsed vhost settings
-t -D DUMP_RUN_CFG : show parsed run settings
-S : a synonym for -t -D DUMP_VHOSTS -D DUMP_RUN_CFG
-t -D DUMP_MODULES : show all loaded modules
-M : a synonym for -t -D DUMP_MODULES
-t : run syntax check for config files
-T : start without DocumentRoot(s) check
-X : debug mode (only one worker, do not detach)
Action '-D NO_DETACH -c Include /home/johan/src/heroku/php-getting-started/vendor/heroku/heroku-buildpack-php/conf/apache2/heroku.conf' failed.
The Apache error log may have more information.
Process exited unexpectedly: httpd
Going down, terminating child processes...

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.