Skip to content

danielroe/now-php

 
 

Repository files navigation

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": "now-php@0.0.7"
    }
  }
}

If you need to show index page define routes properly.

{
  "functions": {
    "api/index.php": {
      "runtime": "now-php@0.0.7"
    }
  },
  "routes": [
    { "src": "/(.*)",  "dest": "/api/index.php" }
  ]
}

Additional function properties are memory, maxDuration.

{
  "functions": {
    "api/*.php": {
      "runtime": "now-php@0.0.7",
      "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.

About

ZEIT Now PHP builder • now-php • 🐘+ λ = ❤

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • TypeScript 39.9%
  • Makefile 31.4%
  • JavaScript 27.2%
  • Shell 1.3%
  • PHP 0.2%