Can spaces run PHP scripts?

Hello. I intend to use spaces as CDN. But I need it also to run a PHP script which would generate minimized js and css files on fly (if they do not exist yet). How can I achieve this?


Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

PHP is generally white space insensitive, meaning that you can space out your code however you want to make your scripts more legible.

Hi there @webxtor01,

I don’t think that this is possible. Spaces and other Object Storage solutions are meant to store static files like Images, Videos, CSS/HTML files and etc.

You can use Spaces with your PHP application and store your user uploads there for example, but you would still need an actual web server where you would run your PHP logic.

For more information make sure to check out this article here:

Hope that this helps! Regards, Bobby