Question

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?

Thanks


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.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

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:

https://www.digitalocean.com/community/tutorials/object-storage-vs-block-storage-services

Hope that this helps! Regards, Bobby