We are moving our forum in GitHub Discussions. For questions about Phalcon v3/v4 you can visit here and for Phalcon v5 here.

Solved thread

This post is marked as solved. If you think the information contained on this thread must be part of the official documentation, please contribute submitting a pull request to its repository.

Loading external library

How to load external library inside phalcon php code ? For example, I want to use HTTPFUL library from http://phphttpclient.com/ inside phalcon php application

The easiest way is to include it in your bootstrap file in your DI container. You can include an external library and instantiate it just like you do with the DB connection or Volt.


According to the library documentation, you can use:

1) A Phar file:

// Point to where you downloaded the phar
include './httpful.phar';

// And you're ready to go!
$response = \Httpful\Request::get('http://example.com')->send();


2) Composer:

    "require": {
        "nategood/httpful": "*"

Check how dependencies are loaded using Composer in Vokuro:


Thanks for the help. Anyway I am trying the code.