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

Subscribe
Share

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

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:

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

Hope that this helps! Regards, Bobby