All the development servers on Dropsolid Platform use PHP-FPM to process the php scripts of your project.
There are some implications as a developer you have to be aware of as there can be multiple PHP versions available on the development server of your project.
The cli php version has to be specified in some cases
As there are multiple php versions on the server, drush/drupal console/composer/... has to be executed with the correct php version to have the expected outcome.
Dropsolid infrastructure already provided a fix for the following situations:
- the execution of the deploy script while building
We did this by prefixing the $PATH variable with the specific php path for that environment:
This way, all calls for the PHP binary will use the specified one.
- a call executed through a drush alias on the development server (e.g. cron or uli's from platform)
we used the php option in the alias to specify the PHP path
$aliases[$project . '.staging'] = array(
'root' => '/var/www/customprojects_D8/PROJECT/staging/docroot',
'php' => '/opt/php/7.1/php', //ansible generated for staging, do not remove
'path-aliases' => array(
So for all the automatic or platform integrated parts, no manual actions are required.
When do you have to be aware of this?
Since there is only a project user, and no environment specific user, we can't add that prefixed $PATH variable to the user context, as it could break an environment.
The best approach is to use an updated aliases file and a drush alias to execute drush commands, as it will use the correct PHP version.
We only altered the aliases on the server, not those in the repo. The aliases in the repo aren’t copied or symlinked anymore for security reasons, so you need to get the updated alias file from the server.
The possibility to get the alias files from the platform is on the roadmap, but for now the following command will sync the alias from server to local.
scp PROJECT@SERVER:.drush/PROJECT.aliases.drushrc.php etc/drush/PROJECT.aliases.drushrc.php
Afterwards, every(*) drush command you execute from your local machine with the updated aliases will use the correct php version.
If you use an ssh connection to execute (drush) commands, you still have to set the updated $PATH variable, as there is no way to predict the env you want to target with your commands.
(*) the drush @PROJECT.ENV ssh command which opens a shell in the project root on the remote server won’t be aware of the defined php version. You still have to set the updated $PATH variable, as it is unfortunately not possible to pass env variables over ssh with drush.
The logs section per environment contains the fpm access / error logs
PHP errors will now be visible in the fpm log instead of the apache log.
Nice extra in the fpm log is that you can see how long the php script ran and how much ram and cpu processing it used.