Giter VIP home page Giter VIP logo

now-php's Introduction

ZEIT Now PHP

Enjoyable & powerful 🐘 PHP Runtime for ZEIT Now.

πŸ•Ή f3l1x.io | πŸ’» f3l1x | 🐦 @xf3l1x

npm npm (latest)

πŸ‹οΈβ€β™€οΈ It works with these frameworks and tools.


🐣 Versions

Pkg Tag Stability Info
βœ… now-php latest production Rock-solid stable.
πŸ”₯ now-php canary testing For early-adopters.
⚠️ now-php experimental development Testing and high danger.

Need to know how things are changing? Here is changelog.

πŸ€— Features

  • Architecture: PHP development server (πŸš€ fast enough)
  • PHP version: 7.3.8
  • Extensions: apcu, bcmath, bz2, calendar, Core, ctype, curl, date, dom, ds, exif, fileinfo, filter, ftp, gettext, hash, iconv, json, libxml, mbstring, mysqli, mysqlnd, openssl, pcntl, pcre, PDO, pdo_mysql, pdo_pgsql, pdo_sqlite, phalcon, Phar, readline, Reflection, session, SimpleXML, soap, sockets, sodium, SPL, sqlite3, ssh2, standard, swoole, tokenizer, xml, xmlreader, xmlrpc, xmlwriter, xsl, Zend OPcache, zlib
  • Speed: cold ~250ms / warm ~5ms
  • Memory: ~90mb
  • Frameworks: Nette, Symfony, Lumen, Slim, Phalcon

List of all installable extensions is on this page https://blog.remirepo.net/pages/PECL-extensions-RPM-status.

βš™οΈ Usage

Take a look at ZEIT's blogpost about Serverless Functions.

You should define functions property in now.json and list PHP files directly or using wildcard (*).

{
  "functions": {
    "api/*.php": {
      "runtime": "[email protected]"
    }
  }
}

If you need to show index page define routes properly.

{
  "functions": {
    "api/index.php": {
      "runtime": "[email protected]"
    }
  },
  "routes": [
    { "src": "/(.*)",  "dest": "/api/index.php" }
  ]
}

Additional function properties are memory, maxDuration.

{
  "functions": {
    "api/*.php": {
      "runtime": "[email protected]",
      "memory": 3008,
      "maxDuration": 500
    }
  }
}

πŸ‘¨β€πŸ’»now dev

For running now dev properly, you need to have PHP installed on your computer, learn more.

πŸ‘€ Demo

🎯Examples

Browse more examples. πŸ‘€

πŸ“œ Resources

🚧 Roadmap

  • next-gen PHP runtime βœ…
  • Composer
    • config.composer: true βœ…
    • composer.json detection βœ…
  • zero config βœ…
  • now dev βœ…
  • rewrite to typescript βœ…
  • setup CI βœ…
  • configure php.ini 🚧
    • using builds.config βœ…
    • using build.env 🚧

Help wanted

  • create many examples (majority frameworks and other use-cases)
  • cover by tests
  • adopt PHP 7.4

πŸ‘¨πŸ»β€πŸ’»CHANGELOG

Show me CHANGELOG

πŸ“ License

Copyright Β© 2019 f3l1x. This project is MIT licensed.

now-php's People

Contributors

f3l1x avatar ties-v avatar dominikvisek avatar dependabot[bot] avatar agdholo avatar andybitz avatar styfle avatar eiriksm avatar itsgoingd avatar

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.