okta / okta-sdk-php

PHP SDK for the Okta API
Apache License 2.0
38 stars 71 forks source link

Call to undefined function Okta\posix_getpwuid() #42

Closed ghost closed 6 years ago

ghost commented 6 years ago

While initializing the Okta Client, it is giving an error

Type: Error
Message: Call to undefined function Okta\posix_getpwuid()
Filename: C:\Bitnami\wampstack-5.6.28-1\apache2\htdocs\project\website\vendor\okta\sdk\src\ClientBuilder.php
Line Number: 61
bretterer commented 6 years ago

Thanks for reporting this. I will take a look at this, but at first glance, it seems that posix_getpwuid is not available on windows based machines.

c3c commented 6 years ago

When deploying to Azure, I get the same error.

bretterer commented 6 years ago

Good to know. thank you @c3c ... I am guessing it is the same issue since i believe Azure uses windows based machines. (not sure on that though, have not looked into it on the Azure side)

c3c commented 6 years ago

Yes, the app I'm running is on a Windows OS. As a quick workaround I added the following:

function posix_getpwuid($id) {} function posix_getuid() {}

bretterer commented 6 years ago

If you want to make a PR against develop, I am happy to take a look and get it merged in today if all looks good. @c3c

bretterer commented 6 years ago

@c3c and @deepakkakran I am still working on this, but I may have a fix in place and would love some input form you in your system. I am just checking to see if the function exists before using it. This is only for auto-discovery of the okta.yaml file. On windows, you will just have to manually define it using the Client Builders method setConfigFileLocation

The fix can be found in the branch https://github.com/okta/okta-sdk-php/tree/fix_posix_functions