ngx-php icon indicating copy to clipboard operation
ngx-php copied to clipboard

Best practices

Open mhf-ir opened this issue 5 years ago • 7 comments

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?

mhf-ir avatar Jan 06 '20 19:01 mhf-ir

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

mhf-ir avatar Jan 06 '20 20:01 mhf-ir

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.

rryqszq4 avatar Jan 13 '20 10:01 rryqszq4

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.

mhf-ir avatar Jan 14 '20 09:01 mhf-ir

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.

joanhey avatar Jan 15 '20 13:01 joanhey

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

i thinks this project need:

  • suitable organization on github, because i work with lua and openresty and compare lua vs php as scripting language lua sucks.
  • Web site and documentation generator
  • Testing and benchmarking for most usefull and uniq php extensions that you might consider as great platform.

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

mhf-ir avatar Jan 15 '20 14:01 mhf-ir

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.

joanhey avatar Feb 17 '20 13:02 joanhey

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.

rryqszq4 avatar Feb 18 '20 10:02 rryqszq4