Sections

Phalcon Developer в Linux

These steps will guide you through the process of installing Phalcon Developer Tools for Linux.

Требования

The Phalcon PHP extension is required to run Phalcon Tools. If you haven’t installed it yet, please see the Installation section for instructions.

Установка

Вы можете скачать кроссплатформенный пакет инструментов разработчиков используя публичный репозиторий на Github.

Linux

Откройте терминал и введите следующую команду:

git clone git://github.com/phalcon/phalcon-devtools.git

Then enter the folder where the tools were cloned and execute . ./phalcon.sh, (don’t forget the dot at beginning of the command):

cd phalcon-devtools/
. ./phalcon.sh

Создайте ссылку на файл phalcon.php:

ln -s ~/phalcon-devtools/phalcon.php /usr/bin/phalcon
chmod ugo+x /usr/bin/phalcon

macOS

Откройте терминал и введите следующую команду:

git clone git://github.com/phalcon/phalcon-devtools.git

Then enter the folder where the tools were cloned and execute . ./phalcon.sh, (don’t forget the dot at beginning of the command):

cd phalcon-devtools/
. ./phalcon.sh

Next, we’ll create a symbolic link to the phalcon.php script. On El Capitan and newer versions of macOS:

ln -s ~/phalcon-devtools/phalcon.php /usr/local/bin/phalcon
chmod ugo+x /usr/local/bin/phalcon

if you are running an older version:

ln -s ~/phalcon-devtools/phalcon.php /usr/bin/phalcon
chmod ugo+x /usr/bin/phalcon

Windows

На платформе Windows вам необходимо настроить системную переменную PATH для запуска инструментов разработчика и выполнения PHP. Если вы скачали инструменты разработчика в виде ZIP-архива, то его необходимо распаковать, например в c:\phalcon-tools. Запомните этот каталог, путь к нему понадобится ниже. Отредактируйте файл phalcon.bat, для этого кликните правой кнопкой мыши и выберите Изменить:

Измените путь на тот, по которому были установлены инструменты разработчика Phalcon (set PTOOLSPATH=C:\phalcon-tools):

Сохраните изменения.

Добавление PHP и Devtools в системную переменную PATH

Поскольку инструменты разработчика написаны на PHP, его необходимо установить на ваш компьютер. В зависимости от того, как был установлен PHP, его исполняемый файл может быть в разных местах. Найдите файл php.exe и запомните (скопируйте) путь к нему. Например, при использовании WAMPP, путь к PHP может быть похож на: C:\wamp\bin\php\<php version>\php.exe (где <php version> — версия PHP используемая в WAMPP).

From the Windows start menu, right mouse click on the Computer icon and select Properties:

Click the Advanced tab and then the button Environment Variables:

At the bottom, look for the section System variables and edit the variable Path:

Be very careful on this step! You need to append at the end of the long string the path where your php.exe was located and the path where Phalcon tools are installed. Use the ; character to separate the different paths in the variable:

Accept the changes made by clicking OK and close the dialogs opened. From the start menu click on the option Run. If you can’t find this option, press Windows Key + R.

Type cmd and press enter to open the windows command line utility:

Type the commands php -v and phalcon and you will see something like this:

Congratulations you now have Phalcon tools installed!