Skip to main content
Question

function exec in php run Box CLI

  • May 22, 2025
  • 2 replies
  • 63 views

Forum|alt.badge.img

I have use exec in PHP run Box CLI

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

Result Error: could not initialize cli home directory on ubuntu

Please help me!

2 replies

Forum|alt.badge.img

Hi  , 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/


Forum|alt.badge.img

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