rryqszq4 / ngx-php

ngx-php - Embedded php7 or php8 scripting language for nginx module. Mainline development version of the ngx-php.
BSD 2-Clause "Simplified" License
642 stars 55 forks source link

Best practices #92

Open mhf-ir opened 4 years ago

mhf-ir commented 4 years ago

I need more information how to develop php app using composer or other tools for ngx_php7.

Any documentation and guide ?

mhf-ir commented 4 years ago

This packages is awesome compare to lua/resty php is far better scripting language but need documentation website.

Thanks for developing this awesome package btw

rryqszq4 commented 4 years ago

I need more information how to develop php app using composer or other tools for ngx_php7.

Any documentation and guide ?

  • Using composer ?
  • Compine php extensions into embeded ? Which one ? Bad extensions?

A composer example:

content_by_php_block {
        $rootdir = '/sample_project';
        require_once $rootdir.'/vendor/autoload.php';

        require $rootdir.'/index.php';
}

And php extensions, also need to test.

Thank you for your attention and welcome your feedback.

mhf-ir commented 4 years ago

about using composer is how php work as embed mode in php, for example we have opcache in fpm layer but not in php cli so, composer show different performance using cli and fpm. In php 7.4 we have preload : https://stitcher.io/blog/preloading-in-php-74

Different environment need different mind set about how to use scripting language.

joanhey commented 4 years ago

Opcache it's also used in php cli and php-ngx. About the new preload in php7.4, for now I did not find any big gain, but it's new and need more testing.

mhf-ir commented 4 years ago

@joanhey right but see how about using swoole it's change php world also same as hhvm?

i thinks this project need:

Lua change nginx world, and openresty Kong born. But lua sucks. Swoole change php many powerfull framework port swoole version.

Think how this layer scripting could change the development cycle.

Even framework on this layer could be born if this awesome repo grows.

My point is documentation and best practices could change the dev world

joanhey commented 4 years ago

I still not finished to optimize the configurations, but php-ngx-pgsql is :rocket:

https://www.techempower.com/benchmarks/#section=test&runid=79d56671-150b-4653-9513-337cade8b1e1&hw=ph&test=fortune

DeepinScreenshot_20200217141700

When I finish the configuartion, I will update the link.

I think that is time to create an organization in github.

rryqszq4 commented 4 years ago

I still not finished to optimize the configurations, but php-ngx-pgsql is 🚀

https://www.techempower.com/benchmarks/#section=test&runid=79d56671-150b-4653-9513-337cade8b1e1&hw=ph&test=fortune

DeepinScreenshot_20200217141700

When I finish the configuartion, I will update the link.

I think that is time to create an organization in github.

Good work, we have new results.