function exec in php run Box CLI

SOLVED
Go to solution
Highlighted
New Contributor

function exec in php run Box CLI

I have use exec in PHP run Box CLI

I have install box cli  on ubuntu: "npm install --global @Box/cli "

Result Error: could not initialize cli home directory on ubuntu

Please help me!

2 REPLIES 2
Highlighted
Box Employee

Re: function exec in php run Box CLI

Hi @huunghia , when running PHP exec the Path and user permissions are often different than when accessing the shell directly. It's hard to debug from our end to be honest, I am sorry.

 

It might be easier for you to make API call directly using the JWT token. We have some documentation in PHP available here.

 

https://developer.box.com/guides/authentication/jwt/without-sdk/


---
Developer Advocate @ Box
Highlighted
New Contributor

Re: function exec in php run Box CLI

Thank you,

Because our client asked to use the cli box, so I used PHP exec.

We will make API calls directly with the JWT token