# Mautic API - Non-Composer Install

**URL:** <https://forum.mautic.org/t/mautic-api-non-composer-install/8671>\
**Category:** Product Support\
**Created:** [June 7, 2017, 5:16am UTC](https://forum.mautic.org/t/mautic-api-non-composer-install/8671 "2017-06-07T05:16:50Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![AB-derek](https://avatars.discourse-cdn.com/v4/letter/a/6bbea6/32.png) [@AB-derek](https://forum.mautic.org/u/AB-derek)\
**Post date:** [June 7, 2017, 5:16am UTC](https://forum.mautic.org/t/mautic-api-non-composer-install/8671/1 "2017-06-07T05:16:50Z")

</div>

[h]SEEKING[/h]  
  
I am seeking a **clear set of step-by-step instructions** on how to setup MAUTIC API on a shared server that does not support, or allow to be installed, the

Code:

composer

tool.  
  
\* Should my Mautic install directory adhere to a specific name? -- **I am using:**

Code:

domain/m/

\* Should the Mautic API be installed in a specific location? -- **I am using:**

Code:

domain/m/api/

\* What files (configuration or otherwise) do I need alter, create, comment or delete?  
\* And if there are file edits/creations required, what must be added, changed, deleted, commented or created?  
  
[h]BACKGROUND[/h]  
I have been working on getting MAUTIC API to work on a Shared Server, where the hosting provider does not allow

Code:

composer

to be installed. I have followed all the documentation I can find on the GIT site for MAUTIC API, and read through a series of posts since 2015. There are nuggets of information I have applied, and each gets me a bit closer, but since I do not understand the Mautic architecture well enough, I am a bit lost on where to look, and how to complete this installation to the point that it will function, as I am sure it does for

Code:

composer

installs.  
  
[h]CURRENT STATUS (as of June 6, 2017)[/h]  
I will spare you the series of edits, tests and trials that brought me to my **Current Status** , which is:  
\* I installed the **PHP API Library** from: [https://github.com/mautic/api-library](https://github.com/mautic/api-library)  
\* I created the

Code:

Autoload.php

file as directed and placed it in the

Code:

/api/

directory.  
\* I can load the

Code:

/apitester/

form.  
\* I can **Authenticate using OAuth1a** via the

Code:

/apitester/

form.  
\* I **CANNOT** get a GET statement to process.

Code:

FORM FIELDS /api/ contacts / OAuth1a GET KEY = id VALUE = 1

  
[h]ENVIRONMENT[/h]  
\* PHP Version 7.0.18  
\* Mautic 2.8.2 (Stable)  
\* Mautic API 2.6.0  
  
[h]...app/config/security.php API Settings[/h]

Code:

'api' =\> ['pattern' =\> '^/api', 'fos\_oauth' =\> true, 'bazinga\_oauth' =\> true, 'mautic\_plugin\_auth' =\> true, 'stateless' =\> true, 'http\_basic' =\> '%mautic.api\_enable\_basic\_auth%',],

  
[h]THE ERROR[/h]

Code:

Fatal error: Uncaught Error: Class 'MauticAuthApiAuth' not found in /api/apitester/index.php:142 Stack trace: #0 {main} thrown in /api/apitester/index.php on line 142

  
[h]...apitester/index.php LINE 142[/h]

Code:

142: $oauthObject = MauticAuthApiAuth::initiate( 143: array( 144: 'baseUrl' =\> $oauthBaseUrl, 145: 'version' =\> $auth, 146: 'clientKey' =\> ($auth == 'OAuth1a') ? $consumerKey : $clientKey, 147: 'clientSecret' =\> ($auth == 'OAuth1a') ? $consumerSecret : $clientSecret, 148: 'callback' =\> $callback, 149: 'scope' =\> $scope 150: ) 151: );

  
  
[h]CLOSING COMMENT[/h]  
While I was able to resolve the other

Code:

class

and

Code:

/filepath/

statements, this error has me baffled. Or I am at my wits end and decided to finally reach out for help -- either way, a concise instruction set for Shared Server Non-Composer environments would be great to have for two reasons.  

Quote:

1. So I can complete the installation and move on to the business of why I installed the Mautic API.  
2. To help others have an easier time with their installs for a similar hosting environment (aka: non-composer).

  
Thank you in advance.  

Quote:

I was not sure if this should be in DOCS or SUPPORT.  
It makes sense to start in SUPPORT and move it later (once resolved) to DOCS.

---

<div class="post-metadata">

**Author:** ![AB-derek](https://avatars.discourse-cdn.com/v4/letter/a/6bbea6/32.png) [@AB-derek](https://forum.mautic.org/u/AB-derek)\
**Post date:** [June 7, 2017, 5:16am UTC](https://forum.mautic.org/t/mautic-api-non-composer-install/8671/2 "2017-06-07T05:16:50Z")

</div>

[h]SEEKING[/h]  
I am seeking a clear set of step-by-step instructions on how to setup MAUTIC API on a shared server that does not support, or allow to be installed, the `composer` tool.

- Should my Mautic install directory adhere to a specific name? – I am using: `domain/m/`
- Should the Mautic API be installed in a specific location? – I am using: `domain/m/api/`
- What files (configuration or otherwise) do I need alter, create, comment or delete?
- And if there are file edits/creations required, what must be added, changed, deleted, commented or created?

[h]BACKGROUND[/h]  
I have been working on getting MAUTIC API to work on a Shared Server, where the hosting provider does not allow `composer` to be installed. I have followed all the documentation I can find on the GIT site for MAUTIC API, and read through a series of posts since 2015. There are nuggets of information I have applied, and each gets me a bit closer, but since I do not understand the Mautic architecture well enough, I am a bit lost on where to look, and how to complete this installation to the point that it will function, as I am sure it does for `composer` installs.

[h]CURRENT STATUS (as of June 6, 2017)[/h]  
I will spare you the series of edits, tests and trials that brought me to my Current Status, which is:

- I installed the PHP API Library from: [https://github.com/mautic/api-library](https://github.com/mautic/api-library)
- I created the `Autoload.php` file as directed and placed it in the `/api/` directory.
- I can load the `/apitester/` form.
- I can Authenticate using OAuth1a via the `/apitester/` form.
- I CANNOT get a GET statement to process.

```auto
FORM FIELDS
  <domain/path-to-mautic> /api/ contacts / OAuth1a GET 
  KEY = id
  VALUE = 1
```

[h]ENVIRONMENT[/h]

- PHP Version 7.0.18
- Mautic 2.8.2 (Stable)
- Mautic API 2.6.0

[h]…app/config/security.php API Settings[/h]

```auto
'api' => [
        'pattern' => '^/api',
        'fos_oauth' => true,
        'bazinga_oauth' => true,
        'mautic_plugin_auth' => true,
        'stateless' => true,
        'http_basic' => '%mautic.api_enable_basic_auth%',
    ],
```

[h]THE ERROR[/h]

```auto
Fatal error: Uncaught Error: Class 'MauticAuthApiAuth' not found in <path-to-mautic>/api/apitester/index.php:142 Stack trace: #0 {main} thrown in <path-to-mautic>/api/apitester/index.php on line 142
```

[h]…apitester/index.php LINE 142[/h]

```auto
142: $oauthObject = MauticAuthApiAuth::initiate(
143: array(
144: 'baseUrl' => $oauthBaseUrl,
145: 'version' => $auth,
146: 'clientKey' => ($auth == 'OAuth1a') ? $consumerKey : $clientKey,
147: 'clientSecret' => ($auth == 'OAuth1a') ? $consumerSecret : $clientSecret,
148: 'callback' => $callback,
149: 'scope' => $scope
150: )
151: );
```

[h]CLOSING COMMENT[/h]  
While I was able to resolve the other `class` and `/filepath/` statements, this error has me baffled. Or I am at my wits end and decided to finally reach out for help – either way, a concise instruction set for Shared Server Non-Composer environments would be great to have for two reasons.

[quote]1. So I can complete the installation and move on to the business of why I installed the Mautic API.  
2. To help others have an easier time with their installs for a similar hosting environment (aka: non-composer).[/quote]

Thank you in advance.

[quote]I was not sure if this should be in DOCS or SUPPORT.  
It makes sense to start in SUPPORT and move it later (once resolved) to DOCS.[/quote]

---

<div class="post-metadata">

**Author:** ![AB-derek](https://avatars.discourse-cdn.com/v4/letter/a/6bbea6/32.png) [@AB-derek](https://forum.mautic.org/u/AB-derek)\
**Post date:** [June 7, 2017, 12:47pm UTC](https://forum.mautic.org/t/mautic-api-non-composer-install/8671/3 "2017-06-07T12:47:21Z")

</div>

> [@23547:@MxyzptlkFishStix](#):
>
> Just download the already prepared Mautic from the Download link at the top of this page. Extract and upload.

What link?

[b]Q: Are talking about the PHP API Library?  
A: I did that as I outlined above.

---

<div class="post-metadata">

**Author:** ![AB-derek](https://avatars.discourse-cdn.com/v4/letter/a/6bbea6/32.png) [@AB-derek](https://forum.mautic.org/u/AB-derek)\
**Post date:** [June 7, 2017, 1:03pm UTC](https://forum.mautic.org/t/mautic-api-non-composer-install/8671/4 "2017-06-07T13:03:54Z")

</div>

That is what I did originally, and then upgraded to 2.8.2.  
Are you suggesting that I delete my current installation and re-install?

---

<div class="post-metadata">

**Author:** ![AB-derek](https://avatars.discourse-cdn.com/v4/letter/a/6bbea6/32.png) [@AB-derek](https://forum.mautic.org/u/AB-derek)\
**Post date:** [June 7, 2017, 5:40pm UTC](https://forum.mautic.org/t/mautic-api-non-composer-install/8671/5 "2017-06-07T17:40:38Z")

</div>

@kuzmany Thank you for that thought, that’s actually helpful. I was trying to avoid adding a development environment, but I get what you are saying, if I use the PREP procedure, it should resolve my issues.

```auto
1. Set up a PREP server environment on my local machine (WAMP for example).
2. Install COMPOSER. 
3. Install MAUTIC.
4. Install MAUTIC API LIBRARY.
5. Install MAUTIC PHP API LIBRARY.
6. Configure Mautic.
7. Test the Mautic instance.
8. Test the Mautic API functionality.
9. ZIP up the working MAUTIC instance (directory).
10. Upload the ZIP file to my hosting environment.
11. Unpack the ZIP file.
12. Edit the Mautic server settings for it's new server environment.
13. Test the Mautic instance.
14. Test the Mautic API functionality.
```

Is there anything I missed?

---

<div class="post-metadata">

**Author:** ![AB-derek](https://avatars.discourse-cdn.com/v4/letter/a/6bbea6/32.png) [@AB-derek](https://forum.mautic.org/u/AB-derek)\
**Post date:** [June 7, 2017, 5:44pm UTC](https://forum.mautic.org/t/mautic-api-non-composer-install/8671/6 "2017-06-07T17:44:51Z")

</div>

@MxyzptlkFishStix  
I signed up, profile is: ab-derek  
I have notifications turned on.  
I plan to follow @kuzmany 's suggestion, but if you have a quicker solution, let me know.
