Is it possible to install PHP Extensions on glitch?

I am trying to host a PHP based app on a glitch server and I’ve run into a bit of a problem. The app I’m trying to host requires a couple of PHP extensions I don’t have. Is there anything I can do to install these PHP extensions?

Hi mmccall0813!

PHP-on-Glitch is not the smooth experience that Node.js-on-Glitch is. It is feasible, but you are venturing into new territory - which is awesome!

You may find instructions on the internet that say to install PHP extensions globally with root access. Glitch doesn’t allow your project to install things globally; this is because we are trying to encourage people to write Glitch projects in a way that people can download Glitch projects and then use them on their own machine, without needing to give the Glitch project root access.

I looked around and found this StackOverflow answer which might be helpful - essentially, I think it is saying that you would copy a .so binary to your Glitch project (or possibly you could compile it from source on Glitch) and then point PHP to it using a php.ini file containing a line like extension=/some/path/somelib.so.

Hope this helps,

Johnicholas

1 Like

Take a look at this answer by @Gareth

1 Like