# Composer package bootstrap.php failed

**URL:** https://discourse.roots.io/t/composer-package-bootstrap-php-failed/16623
**Category:** sage
**Created:** 2019-09-18T10:05:22Z
**Posts:** 7

## Post 1 by @JordanC26 — 2019-09-18T10:05:22Z

I’m likely asking a basic question here but something I’ve not quite found an answer to based on my searching.

Trying to install this oauth php library via composer and use it - [GitHub - daviddesberg/PHPoAuthLib: PHP 5.3+ oAuth 1/2 Client Library](https://github.com/Lusitanian/PHPoAuthLib)

I followed these instructions as per the docs [here](https://github.com/Lusitanian/PHPoAuthLib)

1. `themename` → `composer require lusitanian/oauth`
2. curl -sS [https://getcomposer.org/installer](https://getcomposer.org/installer) | php
3. php composer.phar install

No errors.

Now I copied the example code for Etsy [here](https://github.com/Lusitanian/PHPoAuthLib/blob/master/examples/etsy.php) into a page template: `template-example.blade.php`

The result is:

> **Fatal error** : require\_once(): Failed opening required ‘/tmp/sage-cache/bootstrap.php’ (include\_path=‘.:/usr/share/php’) in **/tmp/sage-cache/a1e0684fa8db59f858c42a94673b906cd3d3c541.php** on line **32**

The failed line is `require_once __DIR__. '/bootstrap.php';`

I ran the following afterwards:

1. composer clearcache
2. composer dump-autoload --optimize

No change of error.

Im still fairly new to using composer etc properly, wondering if I am missing a change needed considering this is on roots etc at all?

Thanks for any help.

---

## Post 2 by @Log1x — 2019-09-18T10:15:16Z

1. Don’t put this stuff in a View, use a Controller (or Composer if Sage 10).
2. You probably don’t have `bootstrap.php` as it is located in the examples folder [here](https://github.com/Lusitanian/PHPoAuthLib/blob/master/examples/bootstrap.php) as well as expects your credentials (e.g. [init.php](https://github.com/Lusitanian/PHPoAuthLib/blob/master/examples/init.example.php)). I’d combine them all– they merely have them as separate files to make it easier to manage the rest of their examples.

Otherwise, all of this comes down to basic PHP and isn’t Composer related.

---

## Post 3 by @JordanC26 — 2019-09-18T10:19:16Z

Thanks @Log1x. I’m really just taking this down to basics right now to learn it properly.

Before I start considering things like Controllers, I just want to be able to install and use this package for starters. Baby steps here ha.

Ok I get what you mean about maybe not having the bootstrap.php file considering where it is in that repo, however, where exactly would I put it? I know not to touch the `/vendor/packagename` therefore, where should it usually be located?

---

## Post 4 by @Log1x — 2019-09-18T10:26:52Z

Just add the contents of `bootstrap.php` and `init.php` to your Etsy stuff.

> <https://gist.github.com/Log1x/f46c9e9186f6039fcac886397d312b12>

Still might error though if something goes wrong during the View caching which is why you’re better off with a Controller– but the above should roughly be what you’re looking for…

---

## Post 5 by @system — 2019-10-30T10:05:28Z

This topic was automatically closed after 42 days. New replies are no longer allowed.

---

## Post 6 by @ben — 2022-02-26T03:08:34Z



---

## Post 7 by @ben — 2022-02-26T04:14:10Z


