Sign in to follow this  
Andrew Russell

[web] Ruby-PHP Integration

Recommended Posts

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?

Share this post


Link to post
Share on other sites
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]

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this