2.8.4.5.2. Install Phalcon Devtools

Procedure for installing Phalcon Devtools:

  1. Connect to the hosting via SSH.
  2. Make sure that Phalcon is enabled in the PHP settings of the desired site.
    You can check the Phalcon version from the console with the command:
    /usr/local/php72/bin/php -c /home/example/.system/php/www.example.com.ini -r "echo Phalcon\Version::get();"

    In the command, use your own data:

    • php72 — PHP version set in the site settings.
    • examplename of the hosting account (not an alias).
    • www.example.com — site name (if the site is on a subdomain, the name of the subdomain is specified instead of www).
  3. Go to site root directory:
    cd example.com/www
  4. Create the composer.json file with the following contents:
    {
        "require-dev": {
            "phalcon/devtools": "^3.4"
        }
    }
  5. Install Phalcon Devtools using Composer:
    composer install --ignore-platform-reqs
  6. Create the aliases needed to run Phalcon Devtools via the console from any directory:
    echo "alias phalcon='/usr/local/php72/bin/php -c /home/example/.system/php/www.example.com.ini /home/example/example.com/www/vendor/phalcon/devtools/phalcon'" >> ~/.bashrc && source ~/.bash_profile

    In the command, use your own data:

    • php72 — PHP version set in the site settings.
    • examplename of the hosting account (not an alias).
    • www.example.com — site name (if the site is on a subdomain, the name of the subdomain is specified instead of www).
  7. Make sure the Phalcon Devtools are working by running the command:
    phalcon info

    The command should output information about the environment, as well as versions of Devtools and Phalcon itself.

Content