Skip to content
This repository has been archived by the owner. It is now read-only.

[now@php] Next generation PHP builder #743

Closed
f3l1x opened this issue Jul 10, 2019 · 10 comments
Closed

[now@php] Next generation PHP builder #743

f3l1x opened this issue Jul 10, 2019 · 10 comments
Labels

Comments

@f3l1x
Copy link

@f3l1x f3l1x commented Jul 10, 2019

Hi guys! 馃枑

I am working on the new PHP builder and it's time to show you. 馃憖 I and @styfle would appreciate your feedback and battle-testing.

At this time the builder is in progress but it's working. There is a pretty fast response from lambda, about 4-5ms per request with mode server. The speed is different according to used mode.

PHP builder

Source: https://github.com/juicyfx/now-builders
Examples: https://github.com/juicyfx/now-builders/tree/master/examples

Feature list of the new PHP builder:

  • multiple PHP versions (7.2,7.3,7.4)
  • multiple running modes (server, cgi, cli, fpm)
  • install dependencies via Composer
  • support many extensions
    • Preinstalled: 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 (< 7.4), Phar, readline, Reflection, session, SimpleXML, soap, sockets, sodium, SPL, sqlite3, ssh2, standard, swoole, tokenizer, xml, xmlreader, xmlrpc, xmlwriter, xsl, Zend OPcache, zlib

Features to-do:

  • support now dev
    • 1st with native PHP on your OS (maybe by configuration config.dev.local: true)
    • 2nd with precompiled PHP binaries and libs for OSX, Windows, Linux
  • FPM issues

How could you test it?

Simple

Create index.php and now.json with following codes:

<?php
phpinfo();
{
    "version": 2,
    "builds": [
      { "src": "index.php", "use": "@juicyfx/php@canary" }
    ]
}

Advanced

{
  "version": 2,
  "builds": [
    {
      "src": "*.php",
      "use": "@juicyfx/php@canary",
      "config": {
        "v": "7.3",
        "mode": "server",
        "composer": false
      }
    }
  ]
}
  • try different versions: 7.2, 7.3, 7.4
  • try different modes: server, cgi, fpm, cli
  • try install PHP deps via configuration composer: true

Experimental

There are 2 experimental modes.

Take a look at the examples - https://github.com/juicyfx/now-builders/tree/master/examples.


Thank you for testing. It will help with development. 馃懆鈥嶐煉

@sebas5384

This comment has been minimized.

Copy link

@sebas5384 sebas5384 commented Jul 11, 2019

glad to see movement on supporting real php apps and I hope the #159 helped some how 馃

@TheCrott

This comment has been minimized.

Copy link

@TheCrott TheCrott commented Jul 12, 2019

After few days test with @styfle and @f3l1x, so far I can tell you guys that this new php builder tested with major php frameworks. Will test with symfony today

@f3l1x

This comment has been minimized.

Copy link
Author

@f3l1x f3l1x commented Jul 14, 2019

If you guys have preinstalled PHP on your machine, you could play with now dev. Be careful, it works with mode: server|cgi only.

@LordDamionDevil

This comment has been minimized.

Copy link

@LordDamionDevil LordDamionDevil commented Jul 14, 2019

This is actually pretty neat and I do hope this will become the official PHP builder as the current one seems kinda pointless and can only do basic stuff.

@ties-v

This comment has been minimized.

Copy link
Contributor

@ties-v ties-v commented Jul 20, 2019

I have had a chance to test the php builder from #743 with Symfony.

As a test case I used the symfony demo application and deployed it on Now: https://symfony-demo.ties.now.sh.

The changes that are required are presented in this commit.

Note: this demo app is unable to add or edit posts. This is because it uses sqlite and when deployed to Now the database file is in a non writable directory. I don't think it is necessary to fix this, because in a real world case you probably would use a "real" database server.

@rauchg

This comment has been minimized.

Copy link

@rauchg rauchg commented Jul 24, 2019

This is really amazing @f3l1x 鈥 would you be interested in discussing maintaining this builder semi-officially in a community repository?

@f3l1x

This comment has been minimized.

Copy link
Author

@f3l1x f3l1x commented Jul 24, 2019

@rauchg I would love to. 馃檪What should I do? Can we discuss it on the Slack?

@TheCrott

This comment has been minimized.

Copy link

@TheCrott TheCrott commented Jul 24, 2019

@ties-v congrats on running symfony! I took 2 days and failed because symfony expecting .env to exist

@f3l1x

This comment has been minimized.

Copy link
Author

@f3l1x f3l1x commented Jul 31, 2019

The PHP builder was transferred into separated repo: https://github.com/juicyfx/now-php

Please take a look guys. I would be happy for you feedback.

@styfle

This comment has been minimized.

Copy link
Member

@styfle styfle commented Aug 2, 2019

I've closed all the php issues in this repo since we deprecated @now/php in favor of now-php.

Please create any issues in the new repo here: https://github.com/juicyfx/now-php

@styfle styfle closed this Aug 2, 2019
@zeit zeit locked as resolved and limited conversation to collaborators Aug 2, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
7 participants
You can鈥檛 perform that action at this time.