Change cli PHP php.ini file on shared hosting?

Avatar
  • Answered
Is there any way to set the cli PHP to use a different php.ini on a shared hosting account? My situation is this:

I'm trying to run a composer command but I'm getting the error "Cannot allocate memory". I've looked around the Inmotion Hosting support questions and this seems to be an issue for some people but they never post back to say if they resolved it.

I think that if I could just change the memory_limit settings for the cli PHP then I could get this command to run, but it seems to be using a php.ini that I do not have permissions to modify. I can modify the web PHP php.ini located in public_html/ and see my changes reflected in phpinfo.php, but I cannot modify the cli php.ini.
Avatar
Arn
Hello, Thanks for the question about changing the PHP.INI file. If you are running an application running on your server then you can change the PHP.IN within the directory where the app is running. You can have different PHP.INI files per directory. Here's a tutorial that shows you how to make the changes. If you have any further questions or comments, please let us know. Regards, Arnel C.