Project dependent PHP CLI version

When you use one system for different PHP projects then sooner or later you will need to set up different PHP version per project. One solution is to manually change PHP before switching to project. But this is boring… To have the right version of PHP without our interaction we can use php-fpm and set right php version directly in vhost. But how to automatically change PHP version on CLI ?

Continue reading

Autocomplete for deployer in phpStorm

From https://github.com/deployphp/deployer/issues/742#issuecomment-237638384

  1. rename /usr/local/bin/dep to /usr/local/bin/depployer.phar
    mv /usr/local/bin/dep /usr/local/bin/deployer.phar
  2. Make a symbolic link for convenience back to dep
    ln -s /usr/local/bin/deployer.phar /usr/local/bin/dep
  3. Add /usr/local/bin to include path under PHPStorm -> Preferences -> Language & Frameworks -> PHP

Add deploy user for deployer

  1. Run this to add user “deploy” wiht home dir /deploy/
    useradd -m deploy
  2. Run this to genereate ssh keys for “deploy” user
    su deploy -c"ssh-keygen"
  3. Run this to add group “www-data” to user “deploy”
    usermod -a -G www-data deploy
  4. Run this to check to what groups user “deploy” belongs to:
    groups deploy