-
Notifications
You must be signed in to change notification settings - Fork 323
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to use and assign applications to different PHP versions ? #46
Comments
You can specify version in application The same rule works if no version specified: the newest version against all existing modules is used. |
sweet.. so
thanks @VBart |
Not really. Module name doesn't matter at all. Unit gets the versions from PHP library. So, in your case they will be If you have only one PHP 7 version and it is |
Module names can be anything, any random string. These names only used to name build targets and module files. When Unit starts, it forks special "discovery" process. This process scans modules directory and loads each module one by one. It collects information about existing modules and their versions. Then it sends this information to the main process and exits. Currently, the discovery process runs only once at start. Thus, in order to add new module to Unit, you have to reload it. In future, the modules directory will be monitored and all changes in the list of available modules will be discovered in realtime without reloads. |
Thanks @VBart for the info. Do you see any future development to allow picking up and differentiating different PHP versions ? 7.0.23, 7.1.9, 7.2.0 etc. Maybe inspecting the built php module's with
|
Not sure, that I understand what do you mean. Unit already is able to differentiate them. If you have built several versions, you can load the exact version that you need. Could you elaborate? |
sorry misread your comment at #46 (comment) so i can use type = |
Sure. It's just up to you how precise do you like to specify version number. |
For example, if you have two 7.0.x versions: |
ok got it so only version number is needed and not php prefix or works with php prefix too |
Sorry, In general, you can specify the exact version number, like In fact, Unit doesn't care how many dots particular interpreter uses, it just does smart version matching and tires to find the best match. The same is true for Python. |
Cheers thanks for the clarification :) |
oh one more related question is, is there a API command to be able to list all the php types registered/configured with Nginx Unit ? |
Not yet, but it's planned. Currently only the configuration API is implemented. A few beta versions later, all configuration will be moved to the |
Sounds good.. looking forward to testing :) |
References: 1. https://mailman.nginx.org/pipermail/unit/2018-June/000055.html 2. https://www.nginx.com/blog/nginx-unit-1-2-release-available-now/ Additionally, this commit adds an explanation about the ability to define a specific version of the language interpreter that will be used to run the application
If I am understanding Nginx Unit's feature set, one is to be able to use different PHP versions for different applications ? From http://unit.nginx.org/docs-configuration.html#php-application I am not seeing any option to tie a PHP application to a specific PHP version ?
If I have multiple PHP versions installed 5.6.31, 7.0.23, 7.1.9 via conifguring PHP http://unit.nginx.org/docs-installation.html#source-code, how does an PHP application know which PHP version to use ? How is it associated ?
Right now if I configure for PHP 5.6.31, 7.0.23 and 7.1.9, which version gets used by default for a Unit created PHP application
type = php
?thanks
The text was updated successfully, but these errors were encountered: