# For hosts with no Composer. How to add the API to a php script with require?

**URL:** <https://forum.mautic.org/t/for-hosts-with-no-composer-how-to-add-the-api-to-a-php-script-with-require/17380>\
**Category:** Product Support\
**Created:** [December 11, 2020, 10:24pm UTC](https://forum.mautic.org/t/for-hosts-with-no-composer-how-to-add-the-api-to-a-php-script-with-require/17380 "2020-12-11T22:24:15Z")\
**Posts on this page:** 1\
**Showing post:** 17

<div class="post-metadata">

**Author:** ![modifiedcontent](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/modifiedcontent/32/511_2.png) [@modifiedcontent](https://forum.mautic.org/u/modifiedcontent)\
**Post date:** [September 19, 2021, 11:37am UTC](https://forum.mautic.org/t/for-hosts-with-no-composer-how-to-add-the-api-to-a-php-script-with-require/17380/17 "2021-09-19T11:37:21Z")

</div>

@mzagmajster, thank you for your response. As far as I know Mautic 4 no longer has the Basic Auth option, only OAuth 2.

I have Composer on my VPS and have no problem using it, but it is stuck on a Mautic bug. [Attempts history here.](https://forum.mautic.org/t/getting-started-with-mautic-api/20669/13)

[Previously reported Composer bug here.](https://forum.mautic.org/t/why-does-composer-require-willdurand-oauth-server-bundle-0-0-3-in-mautic-4/20835)

> Can you echo out curl\_error so we see what actually goes wrong?

I have no clue where to do that, but am pretty sure what goes wrong is 1) I can’t connect because Mautic 4 does not have Basic Auth and 2) there is no /api/ directory in my installation, which is probably part of the fabled PHP API library that can only be installed via the magical Composer that fails on an unsolved Mautic bug.

---

_[View the full topic](https://forum.mautic.org/t/for-hosts-with-no-composer-how-to-add-the-api-to-a-php-script-with-require/17380)._
