# Build Simple Login in PHP - unable to get working

**URL:** <https://devforum.okta.com/t/build-simple-login-in-php-unable-to-get-working/7353>\
**Category:** Questions\
**Created:** [December 17, 2019, 4:30am UTC](https://devforum.okta.com/t/build-simple-login-in-php-unable-to-get-working/7353 "2019-12-17T04:30:30Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![charles2010](https://avatars.discourse-cdn.com/v4/letter/c/3bc359/32.png) [@charles2010](https://devforum.okta.com/u/charles2010)\
**Post date:** [December 17, 2019, 4:30am UTC](https://devforum.okta.com/t/build-simple-login-in-php-unable-to-get-working/7353/1 "2019-12-17T04:30:30Z")

</div>

Good day, I am trying to enable a legacy PHP program/solution that currently uses Microsoft Active Directory to authenticate from. My request is to convert/migrate this application to utilize OKTA as the authentication method. I am open to any and all formats, and have a pretty much a free hand to do what I wish to get this working.

In the developers web site, I came across this example, which I am unable to get working even without altering any of the code from GitHub

> **[Build Simple Login in PHP](https://developer.okta.com/blog/2018/12/28/simple-login-php)**
>
> In this tutorial, you'll learn how to build a React app using a Laravel API to store its data.

and downloaded from

> **[oktadeveloper/okta-php-core-login-example](https://github.com/oktadeveloper/okta-php-core-login-example)**
>
> Contribute to oktadeveloper/okta-php-core-login-example development by creating an account on GitHub.

when I attempt to run this example I get this result.

[prsuser@localhost ~]$ php -S 192.168.1.238:8080 -t public  
PHP 5.4.45 Development Server started at Mon Dec 16 11:20:41 2019  
Listening on [http://192.168.1.238:8080](http://192.168.1.238:8080)  
Document root is /home/prsuser/public  
Press Ctrl-C to quit.  
[Mon Dec 16 11:20:44 2019] PHP Fatal error: Class ‘Src\Services\OktaApiService’ not found in /home/prsuser/public/index.php on line 7  
[Mon Dec 16 11:20:44 2019] 192.168.1.180:26408 [500]: /public - Class ‘Src\Services\OktaApiService’ not found in /home/prsuser/public/index.php on line 7

As you can se the server side, abends with this class not found.

So far I am unable to understand why. Certainly this example code is fine, I must be doing something wrong but cannot see why – I wanted this to work as a starting point.

If anyone else has a better example or method I maybe able to use I would certainly love to hear it.

Thank you  
Charles

---

<div class="post-metadata">

**Author:** ![andrea](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/andrea/32/2172_2.png) [@andrea](https://devforum.okta.com/u/andrea)\
**Post date:** [January 18, 2024, 12:44am UTC](https://devforum.okta.com/t/build-simple-login-in-php-unable-to-get-working/7353/2 "2024-01-18T00:44:22Z")

</div>

Closed on January 18, 2024, 12:44am UTC


