5

Mezzio php framework – setting up with php-fpm and nginx reverse proxy (with do...

 1 year ago
source link: https://bytepursuits.com/mezzio-using-phpfpm-with-nginx-reverse-proxy-with-docker-containers-and-docker-compose
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Mezzio php framework – setting up with php-fpm and nginx reverse proxy (with docker containers and docker compose) – Byte Pursuits

Alternatively: create mezzio skeleton application yourself

If you prefer to create mezzio application yourself – instead of using what is in the repo – just follow official instructions in git repo.

Remove shipped mezzio directory and install the mezzio skeleton application project (all on the same level as ./stack directory):

rm -rf ./mezzio
composer create-project --ignore-platform-reqs mezzio/mezzio-skeleton mezzio

Note that we use --ignore-platform-reqs option – as you may not necessarily have all of the php extensions on your computer (they are present in docker container however).

You will be presented with some choices you need to pick, I would recommend these:

See this terminal output (yours may vary slightly):

linuxdev@hs-dev1:/mnt/480g_drive/projects/mezzio-nginx-fpm-demo$
composer create-project --ignore-platform-reqs mezzio/mezzio-skeleton mezzio
Creating a "mezzio/mezzio-skeleton" project at "./mezzio"
Info from https://repo.packagist.org:
Installing mezzio/mezzio-skeleton (3.11.0)
- Installing mezzio/mezzio-skeleton (3.11.0): Extracting archive
Created project in /mnt/480g_drive/projects/mezzio-nginx-fpm-demo/mezzio
> MezzioInstaller\OptionalPackages::install
Setting up optional packages
Setup data and cache dir
Removing installer development dependencies
What type of installation would you like?
[1] Minimal (no default middleware, templates, or assets; configuration only)
[2] Flat (flat source code structure; default selection)
[3] Modular (modular source code structure; recommended)
Make your selection (2): 3
- Copying src/App/src/ConfigProvider.php
Which container do you want to use for dependency injection?
[1] Pimple (supported by laminas)
[2] laminas-servicemanager (supported by laminas)
[3] Symfony DI Container
[4] PHP-DI
[5] chubbyphp-container
Make your selection or type a composer package name and version (laminas-servicemanager (supported by laminas)): 1
- Adding package laminas/laminas-pimple-config (^1.1.1)
- Copying config/container.php
Which router do you want to use?
[1] FastRoute (supported by laminas)
[2] laminas-router (supported by laminas)
Make your selection or type a composer package name and version (FastRoute (supported by laminas)): 1
- Adding package mezzio/mezzio-fastroute (^3.0.3)
- Whitelist package mezzio/mezzio-fastroute
- Copying config/routes.php
Which template engine do you want to use?
[1] Plates (supported by laminas)
[2] Twig (supported by laminas)
[3] laminas-view installs laminas-servicemanager (supported by laminas)
[n] None of the above
Make your selection or type a composer package name and version (n): 1
- Adding package mezzio/mezzio-platesrenderer (^2.2)
- Whitelist package mezzio/mezzio-platesrenderer
- Copying src/App/templates/error/404.phtml
- Copying src/App/templates/error/error.phtml
- Copying src/App/templates/layout/default.phtml
- Copying src/App/templates/app/home-page.phtml
Which error handler do you want to use during development?
[1] Whoops (supported by laminas)
[n] None of the above
Make your selection or type a composer package name and version (Whoops (supported by laminas)): 1
- Adding package filp/whoops (^2.7.1)
- Copying config/autoload/development.local.php.dist
Remove installer
Removing composer.lock from .gitignore
Removing Mezzio installer classes, configuration, tests and docs
Installing dependencies from lock file (including require-dev)
Verifying lock file contents can be installed on current platform.
Package operations: 135 installs, 0 updates, 0 removals
- Installing laminas/laminas-component-installer (2.6.0): Extracting archive
- Installing composer/package-versions-deprecated (1.11.99.4): Extracting archive
- Installing squizlabs/php_codesniffer (3.6.2): Extracting archive
- Installing dealerdirect/phpcodesniffer-composer-installer (v0.7.1): Extracting archive
- Installing psr/container (1.1.2): Extracting archive
- Installing chubbyphp/chubbyphp-container (2.0.2): Extracting archive
- Installing chubbyphp/chubbyphp-laminas-config (1.2.2): Extracting archive
- Installing symfony/polyfill-php80 (v1.23.1): Extracting archive
- Installing symfony/process (v5.4.2): Extracting archive
- Installing symfony/deprecation-contracts (v2.5.0): Extracting archive
- Installing symfony/finder (v5.4.2): Extracting archive
- Installing symfony/polyfill-mbstring (v1.23.1): Extracting archive
- Installing symfony/polyfill-ctype (v1.23.0): Extracting archive
- Installing symfony/filesystem (v5.4.0): Extracting archive
- Installing symfony/polyfill-intl-normalizer (v1.23.0): Extracting archive
- Installing symfony/polyfill-intl-grapheme (v1.23.1): Extracting archive
- Installing symfony/string (v5.4.2): Extracting archive
- Installing symfony/service-contracts (v2.5.0): Extracting archive
- Installing symfony/polyfill-php73 (v1.23.0): Extracting archive
- Installing symfony/console (v5.4.2): Extracting archive
- Installing seld/phar-utils (1.2.0): Extracting archive
- Installing seld/jsonlint (1.8.3): Extracting archive
- Installing react/promise (v2.8.0): Extracting archive
- Installing psr/log (1.1.4): Extracting archive
- Installing justinrainbow/json-schema (5.2.11): Extracting archive
- Installing composer/pcre (1.0.0): Extracting archive
- Installing composer/xdebug-handler (2.0.3): Extracting archive
- Installing composer/spdx-licenses (1.5.6): Extracting archive
- Installing composer/semver (3.2.6): Extracting archive
- Installing composer/metadata-minifier (1.0.0): Extracting archive
- Installing composer/ca-bundle (1.3.1): Extracting archive
- Installing composer/composer (2.2.3): Extracting archive
- Installing php-di/phpdoc-reader (2.2.1): Extracting archive
- Installing php-di/invoker (2.3.3): Extracting archive
- Installing opis/closure (3.6.2): Extracting archive
- Installing php-di/php-di (6.3.5): Extracting archive
- Installing laminas/laminas-stdlib (3.6.4): Extracting archive
- Installing elie29/zend-phpdi-config (v6.0.0): Extracting archive
- Installing filp/whoops (2.14.4): Extracting archive
- Installing symfony/polyfill-php81 (v1.23.0): Extracting archive
- Installing symfony/dependency-injection (v5.4.2): Extracting archive
- Installing jsoumelidis/zend-sf-di-config (0.5.1): Extracting archive
- Installing webimpress/coding-standard (1.2.3): Extracting archive
- Installing phpstan/phpdoc-parser (1.2.0): Extracting archive
- Installing slevomat/coding-standard (7.0.18): Extracting archive
- Installing laminas/laminas-coding-standard (2.3.0): Extracting archive
- Installing webimpress/safe-writer (2.2.0): Extracting archive
- Installing nikic/php-parser (v4.13.2): Extracting archive
- Installing brick/varexporter (0.3.5): Extracting archive
- Installing laminas/laminas-config-aggregator (1.7.0): Extracting archive
- Installing laminas/laminas-development-mode (3.6.0): Extracting archive
- Installing laminas/laminas-eventmanager (3.4.0): Extracting archive
- Installing container-interop/container-interop (1.2.0): Extracting archive
- Installing laminas/laminas-validator (2.15.1): Extracting archive
- Installing laminas/laminas-escaper (2.9.0): Extracting archive
- Installing laminas/laminas-uri (2.9.1): Extracting archive
- Installing laminas/laminas-loader (2.8.0): Extracting archive
- Installing laminas/laminas-http (2.15.1): Extracting archive
- Installing psr/http-message (1.0.1): Extracting archive
- Installing psr/http-server-handler (1.0.1): Extracting archive
- Installing psr/http-factory (1.0.1): Extracting archive
- Installing laminas/laminas-diactoros (2.8.0): Extracting archive
- Installing laminas/laminas-httphandlerrunner (2.1.0): Extracting archive
- Installing laminas/laminas-json (3.3.0): Extracting archive
- Installing pimple/pimple (v3.5.0): Extracting archive
- Installing laminas/laminas-pimple-config (1.4.0): Extracting archive
- Installing nikic/fast-route (v1.3.0): Extracting archive
- Installing webmozart/assert (1.10.0): Extracting archive
- Installing psr/http-server-middleware (1.0.1): Extracting archive
- Installing fig/http-message-util (1.1.5): Extracting archive
- Installing mezzio/mezzio-router (3.7.0): Extracting archive
- Installing mezzio/mezzio-fastroute (3.4.0): Extracting archive
- Installing laminas/laminas-servicemanager (3.10.0): Extracting archive
- Installing laminas/laminas-router (3.5.0): Extracting archive
- Installing laminas/laminas-psr7bridge (1.6.0): Extracting archive
- Installing mezzio/mezzio-laminasrouter (3.3.0): Extracting archive
- Installing mezzio/mezzio-template (2.4.0): Extracting archive
- Installing mezzio/mezzio-helpers (5.7.0): Extracting archive
- Installing laminas/laminas-view (2.16.0): Extracting archive
- Installing mezzio/mezzio-laminasviewrenderer (2.4.0): Extracting archive
- Installing league/plates (v3.4.0): Extracting archive
- Installing mezzio/mezzio-platesrenderer (2.4.0): Extracting archive
- Installing laminas/laminas-stratigility (3.5.0): Extracting archive
- Installing mezzio/mezzio (3.8.0): Extracting archive
- Installing laminas/laminas-code (4.5.1): Extracting archive
- Installing psr/event-dispatcher (1.0.0): Extracting archive
- Installing symfony/event-dispatcher-contracts (v2.5.0): Extracting archive
- Installing symfony/event-dispatcher (v5.4.0): Extracting archive
- Installing laminas/laminas-cli (1.4.0): Extracting archive
- Installing mezzio/mezzio-tooling (2.4.0): Extracting archive
- Installing twig/twig (v3.3.6): Extracting archive
- Installing mezzio/mezzio-twigrenderer (2.9.0): Extracting archive
- Installing mikey179/vfsstream (v1.6.10): Extracting archive
- Installing phpdocumentor/reflection-common (2.2.0): Extracting archive
- Installing phpdocumentor/type-resolver (1.5.1): Extracting archive
- Installing phpdocumentor/reflection-docblock (5.3.0): Extracting archive
- Installing sebastian/version (3.0.2): Extracting archive
- Installing sebastian/type (2.3.4): Extracting archive
- Installing sebastian/resource-operations (3.0.3): Extracting archive
- Installing sebastian/recursion-context (4.0.4): Extracting archive
- Installing sebastian/object-reflector (2.0.4): Extracting archive
- Installing sebastian/object-enumerator (4.0.4): Extracting archive
- Installing sebastian/global-state (5.0.3): Extracting archive
- Installing sebastian/exporter (4.0.4): Extracting archive
- Installing sebastian/environment (5.1.3): Extracting archive
- Installing sebastian/diff (4.0.4): Extracting archive
- Installing sebastian/comparator (4.0.6): Extracting archive
- Installing sebastian/code-unit (1.0.8): Extracting archive
- Installing sebastian/cli-parser (1.0.1): Extracting archive
- Installing phpunit/php-timer (5.0.3): Extracting archive
- Installing phpunit/php-text-template (2.0.4): Extracting archive
- Installing phpunit/php-invoker (3.1.1): Extracting archive
- Installing phpunit/php-file-iterator (3.0.6): Extracting archive
- Installing theseer/tokenizer (1.2.1): Extracting archive
- Installing sebastian/lines-of-code (1.0.3): Extracting archive
- Installing sebastian/complexity (2.0.2): Extracting archive
- Installing sebastian/code-unit-reverse-lookup (2.0.3): Extracting archive
- Installing phpunit/php-code-coverage (9.2.10): Extracting archive
- Installing doctrine/instantiator (1.4.0): Extracting archive
- Installing phpspec/prophecy (v1.15.0): Extracting archive
- Installing phar-io/version (3.1.0): Extracting archive
- Installing phar-io/manifest (2.0.3): Extracting archive
- Installing myclabs/deep-copy (1.10.2): Extracting archive
- Installing phpunit/phpunit (9.5.11): Extracting archive
- Installing webmozart/path-util (2.3.0): Extracting archive
- Installing openlss/lib-array2xml (1.0.0): Extracting archive
- Installing netresearch/jsonmapper (v4.0.0): Extracting archive
- Installing felixfbecker/language-server-protocol (1.5.1): Extracting archive
- Installing felixfbecker/advanced-json-rpc (v3.2.1): Extracting archive
- Installing dnoegel/php-xdg-base-dir (v0.1.1): Extracting archive
- Installing amphp/amp (v2.6.1): Extracting archive
- Installing amphp/byte-stream (v1.8.1): Extracting archive
- Installing vimeo/psalm (4.17.0): Extracting archive
- Installing psalm/plugin-phpunit (0.16.1): Extracting archive
- Installing roave/security-advisories (dev-master 31d9d9e)
Deprecation Notice: Not passing a repository manager when calling defaultRepos is deprecated since Composer 2.3.6, use defaultReposWithDefaultManager() instead if you cannot get a manager. in phar:///usr/local/bin/composer/src/Composer/Repository/RepositoryFactory.php:83
Please select which config file you wish to inject 'Laminas\Validator\ConfigProvider' into:
[0] Do not inject
[1] config/config.php
Make your selection (default is 1):1
Remember this option for other packages of the same type? (Y/n)y
Installing Laminas\Validator\ConfigProvider from package laminas/laminas-validator
Deprecation Notice: Not passing a repository manager when calling defaultRepos is deprecated since Composer 2.3.6, use defaultReposWithDefaultManager() instead if you cannot get a manager. in phar:///usr/local/bin/composer/src/Composer/Repository/RepositoryFactory.php:83
Deprecation Notice: Not passing a repository manager when calling defaultRepos is deprecated since Composer 2.3.6, use defaultReposWithDefaultManager() instead if you cannot get a manager. in phar:///usr/local/bin/composer/src/Composer/Repository/RepositoryFactory.php:83
Installing Laminas\HttpHandlerRunner\ConfigProvider from package laminas/laminas-httphandlerrunner
Deprecation Notice: Not passing a repository manager when calling defaultRepos is deprecated since Composer 2.3.6, use defaultReposWithDefaultManager() instead if you cannot get a manager. in phar:///usr/local/bin/composer/src/Composer/Repository/RepositoryFactory.php:83
Deprecation Notice: Not passing a repository manager when calling defaultRepos is deprecated since Composer 2.3.6, use defaultReposWithDefaultManager() instead if you cannot get a manager. in phar:///usr/local/bin/composer/src/Composer/Repository/RepositoryFactory.php:83
Installing Mezzio\Router\FastRouteRouter\ConfigProvider from package mezzio/mezzio-fastroute
Deprecation Notice: Not passing a repository manager when calling defaultRepos is deprecated since Composer 2.3.6, use defaultReposWithDefaultManager() instead if you cannot get a manager. in phar:///usr/local/bin/composer/src/Composer/Repository/RepositoryFactory.php:83
Installing Laminas\Router\ConfigProvider from package laminas/laminas-router
Deprecation Notice: Not passing a repository manager when calling defaultRepos is deprecated since Composer 2.3.6, use defaultReposWithDefaultManager() instead if you cannot get a manager. in phar:///usr/local/bin/composer/src/Composer/Repository/RepositoryFactory.php:83
Installing Mezzio\Router\LaminasRouter\ConfigProvider from package mezzio/mezzio-laminasrouter
Deprecation Notice: Not passing a repository manager when calling defaultRepos is deprecated since Composer 2.3.6, use defaultReposWithDefaultManager() instead if you cannot get a manager. in phar:///usr/local/bin/composer/src/Composer/Repository/RepositoryFactory.php:83
Installing Mezzio\Helper\ConfigProvider from package mezzio/mezzio-helpers
Deprecation Notice: Not passing a repository manager when calling defaultRepos is deprecated since Composer 2.3.6, use defaultReposWithDefaultManager() instead if you cannot get a manager. in phar:///usr/local/bin/composer/src/Composer/Repository/RepositoryFactory.php:83
Installing Mezzio\LaminasView\ConfigProvider from package mezzio/mezzio-laminasviewrenderer
Deprecation Notice: Not passing a repository manager when calling defaultRepos is deprecated since Composer 2.3.6, use defaultReposWithDefaultManager() instead if you cannot get a manager. in phar:///usr/local/bin/composer/src/Composer/Repository/RepositoryFactory.php:83
Installing Mezzio\Plates\ConfigProvider from package mezzio/mezzio-platesrenderer
Deprecation Notice: Not passing a repository manager when calling defaultRepos is deprecated since Composer 2.3.6, use defaultReposWithDefaultManager() instead if you cannot get a manager. in phar:///usr/local/bin/composer/src/Composer/Repository/RepositoryFactory.php:83
Deprecation Notice: Not passing a repository manager when calling defaultRepos is deprecated since Composer 2.3.6, use defaultReposWithDefaultManager() instead if you cannot get a manager. in phar:///usr/local/bin/composer/src/Composer/Repository/RepositoryFactory.php:83
Installing Mezzio\Tooling\ConfigProvider from package mezzio/mezzio-tooling
Deprecation Notice: Not passing a repository manager when calling defaultRepos is deprecated since Composer 2.3.6, use defaultReposWithDefaultManager() instead if you cannot get a manager. in phar:///usr/local/bin/composer/src/Composer/Repository/RepositoryFactory.php:83
Installing Mezzio\Twig\ConfigProvider from package mezzio/mezzio-twigrenderer
Package container-interop/container-interop is abandoned, you should avoid using it. Use psr/container instead.
Package webmozart/path-util is abandoned, you should avoid using it. Use symfony/filesystem instead.
Generating autoload files
composer/package-versions-deprecated: Generating version class...
composer/package-versions-deprecated: ...done generating version class
93 packages you are using are looking for funding.
Use the `composer fund` command to find out more!
PHP CodeSniffer Config installed_paths set to ../../laminas/laminas-coding-standard/src,../../slevomat/coding-standard,../../webimpress,../../webimpress/coding-standard/src
Found 3 security vulnerability advisories affecting 3 packages.
Run composer audit for a full list of advisories.
> laminas-development-mode enable
You are now in development mode.

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK