Follow these steps to install Composer, configure the Leaf CLI globally, create your Leaf web application named directorypro, and install the required DirectoryPro app dependencies.
If Composer is not already installed, run the following commands:
curl -sS https://getcomposer.org/installer | php
sudo mv composer.phar /usr/local/bin/composer
composer -V
Install the Leaf CLI globally:
composer global require leafs/cli
Add the Composer global vendor binaries to your PATH (run this once):
echo 'export PATH="$HOME/.config/composer/vendor/bin:$PATH"' >> ~/.bashrc
source ~/.bashrc
Verify the Leaf CLI installation:
leaf -V
Navigate to your web root directory (for example, /var/www/html
):
cd /var/www/html
Create a new Leaf app named directorypro
:
leaf create directorypro
Now, navigate into the newly created app directory:
cd /var/www/html/directorypro
Within the directorypro
app directory, install the required dependencies:
composer require leafs/leaf
composer require lcobucci/jwt firebase/php-jwt
composer require phpmailer/phpmailer
composer require google/apiclient
Restart your PHP-FPM and web server (adjust the commands as needed):
sudo systemctl restart php-fpm
sudo systemctl restart nginx
Start the PHP built-in server to test your application locally:
php -S localhost:5500 -t .
Open your browser and visit http://localhost:5500
to see your application in action.