Skip to content

Instantly share code, notes, and snippets.

@hubgit
Created January 27, 2020 13:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hubgit/108f94802c085747ea93d136c44bb3e9 to your computer and use it in GitHub Desktop.
Save hubgit/108f94802c085747ea93d136c44bb3e9 to your computer and use it in GitHub Desktop.
Deploy a PHP endpoint to now.sh
# Install `now`
yarn global add now
# Install `jo`
brew install jo
# Create a new folder for the project
mkdir now-php-example && cd $_
# Create now.json
jo -p 'functions[api/*.php]/runtime=now-php@0.0.9' > now.json
# Create a minimal PHP script in the API folder
mkdir api
echo -e "<?php\nphpinfo();" > api/test.php
# Deploy the project
now
# open https://{name}.now.sh/api/test in a browser
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment