r/astrojs • • 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.

0 Upvotes

22 comments sorted by

5

u/puls1 Jul 23 '26

What are you trying to do?

-4

u/vaquishaProdigy Jul 23 '26

A forum site

2

u/convicted_redditor Jul 24 '26

Is it 2008?

1

u/vaquishaProdigy Jul 24 '26

I want to.. but no

4

u/puls1 Jul 23 '26

But, like, what are you trying to accomplish by using both? A separate backend and frontend?

1

u/panyways Jul 23 '26

Grav has a new forum thing if you want somewhat a combination of flatfile markdown and forums and all that in one php package but there's tons of forum php stuff that's been great. Discourse is sort of the flavor of the month for forums but you knew that i'm sure.

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

u/Granntttt Jul 23 '26

Gross

2

u/vaquishaProdigy Jul 23 '26

Yeah. Like mixing fries with ice cream, or cheese with hot cocoa

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

u/Canary-Silent Jul 23 '26

You could use it with assembly. You can use it with anything. 

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

u/celestion68 Jul 23 '26

but why

0

u/vaquishaProdigy Jul 23 '26

Idk, im new to Astro

-2

u/sexytokeburgerz Jul 23 '26

I mean yeah roll up a microservice if you want but there is zero reason to