💾 Archived View for bbs.geminispace.org › s › AskGemini › 22181 captured on 2024-12-17 at 15:09:18. Gemini links have been rewritten to link to archived content
-=-=-=-=-=-=-
Is there any Gemini server software that allows for serving pages, but also allows for server-side scripting? I'm looking for whatever the equivalent to PHP might be in Gemini. I'd rather like to avoid having to modify the web server code itself.
Nov 25 · 3 weeks ago
I use gmid as a server which can work with CGI sockets (using fastgi or slowcgi). You could use PHP on the backend as long as you use it as a CGI script, ie. something that prints to stdout, I don’t think that you could do similar things to html/php “mixins” like with Apache. I personally use Python and Shell scripts to deliver dynamic content. But you could use anything, really, that has fastcgi support. Even compiled C code or whatever.
Agree. there was a rather long thread here about the best gemini language not long ago. it's probably still on the front page.
Wrote some PHP 8 / Composer server-side before. I even had started GTK client implementation in PHP, lol. Checkout these links to get code examples:
— yggverse.cities.yesterweb.org
Also, take a look at Ratchet library that provides well featured async socket API - it would cover 99% of your server-side needs:
— https://github.com/ratchetphp/Ratchet
gmcapsule or anything else with CGI support. All you need to do is make your PHP scripts executable and start the file with a shebang pointing to the PHP binary.
The guestbook and text image generators at gemini://brainsocks.xyz all run on PHP.