[web] Ruby-PHP Integration

Started by
2 comments, last by Mathachew 16 years, 8 months ago
Simple question: Say I have some Ruby on Rails app, which handles various things for a website including user account management, and I want to integrate some piece of PHP software (anything, say MediaWiki or WordPress) into that same website: Is it possible? Is it sensible? How would one go about doing it? Edit: I'm also interested in the same question for Python (probably TurboGears) + PHP. Thoughts?
Advertisement
At my previous job, we would execute Python scripts via command line in PHP using exec(), system() or passthru(), whichever is your preference. What we normally did was create the command to execute with any parameters, placed it in a variable, and then passed it to one of the PHP functions. I'm not sure how this would work on a Windows system running PHP since we used Linux, but you're probably running a *nix based system anyways.

I'm not sure about RoR and PHP though. I'd imagine most CMS' would use session variables, and as such, I don't think that info can be passed from one language to another. You'd probably have to use something like cURL or even GET.

[Edited by - Mathachew on August 11, 2007 4:17:48 PM]
My research so far indicates that you need to setup a session database to do such a thing, and share it between Ruby and PHP.
That sounds possible. I wouldn't consider it ideal, but for wanting to communicate between two server side languages in this manner, that definitely sounds like a doable solution.

This topic is closed to new replies.

Advertisement