Skip to content

barnebys/now-php

 
 

Repository files navigation

ZEIT Now PHP

Enjoyable & powerful 🐘 PHP Runtime (php.now.sh) for ZEIT Now.

🕹 f3l1x.io | 💻 f3l1x | 🐦 @xf3l1x

npm npm (latest)

🏋️‍♀️ It works with these frameworks and tools. Discover more at examples.


🐣 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.4.4
  • Extensions: apcu, bcmath, brotli, bz2, calendar, Core, ctype, curl, date, dom, ds, exif, fileinfo, filter, ftp, gettext, hash, iconv, imap, intl, json, libxml, lua, mbstring, mysqli, mysqlnd, openssl, pcntl, pcre, PDO, pdo_mysql, pdo_pgsql, pdo_sqlite, pgsql, phalcon, Phar, protobuf, psr, readline, Reflection, runkit7, session, SimpleXML, soap, sockets, sodium, SPL, sqlite3, standard, swoole, timecop, tokenizer, uuid, 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.10"
    }
  }
}

If you need to show index page define routes properly.

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

Additional function properties are memory, maxDuration.

{
  "functions": {
    "api/*.php": {
      "runtime": "now-php@0.0.10",
      "memory": 3008,
      "maxDuration": 500
    }
  }
}

Click & Go

Deploy with ZEIT Now

👨‍💻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 🚧
  • PHP versions
    • 7.4 ✅ (used)
    • 7.3 ✅
    • 7.2 ✅

Help wanted

  • create many examples (majority frameworks and other use-cases)

👨🏻‍💻CHANGELOG

Show me CHANGELOG

📝 License

Copyright © 2019 f3l1x. This project is MIT licensed.

About

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

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 38.2%
  • Makefile 30.1%
  • JavaScript 26.2%
  • PHP 4.3%
  • Shell 1.2%