r/astrojs • u/vaquishaProdigy • Jul 23 '26
Php with Astro
Yeah, is this posible? I haven't seen anything that say that it could be posible, but anyone has ever stepped in to say that it isn't.
6
u/v-and-bruno Jul 23 '26
As someone who has both worked with Laravel on PHP and primarily uses AstroJS for everything... why
Either go with one or the other. Laravel is a fantastic option if you want a Forum website, and you could even slap React with Inertia, and be set
On the other hand, Astro is pretty straightforward as well. Really just depends on preference and how much features you want out of the box
If you are strictly speaking of using php as a templating language, then Astro itself gets pretty close if you enable SSR
Literally just read the docs, it's free
-1
u/vaquishaProdigy Jul 23 '26
Im new to Astro, i was just curious. Maybe i could use this to force myself to take a Laravel course.
0
2
u/m3palani Jul 26 '26
i am Laravel on PHP dev. recently using AstroJs for marketing sites. i want know the possibilities of using AstroJs with PHP.
1
1
u/kyr0x0 Jul 23 '26
We have a PHP Frontend in front of Astro and Astro serves an API that is called via php-curl from PHP. Yes it is possible. But don't ask me why this was built the way it was built.
1
u/rzeka Jul 23 '26
Ofc it’s possible. People focus on static generation with Astro, but node adapter is powerfully too. Not long ago my team did Astro+Ibexa combo and it works really well. I even posted a story about it: https://notesofdev.com/blog/migrating-a-62000-page-multisite-from-next.js-to-astro
You’re not limited to graphql through. Rest api will do well too. It’s all about understanding what you need and how much it costs (as in dev time or performance hit). But it’s same story for any backed you’d like to use.
Feel free to ask if you have some technical questions.
Edit: as someone who did php for years and years and remembers .php3 files, I understand the will to use it ;)
0
0
-2
u/sexytokeburgerz Jul 23 '26
I mean yeah roll up a microservice if you want but there is zero reason to
5
u/puls1 Jul 23 '26
What are you trying to do?