Executing Ruby script from PHP

Status
You're currently viewing only Tiiba's posts. Click here to go back to viewing the entire thread.
Not open for further replies.
Seems I run into another weird-ass limitation on this server every day. You might remember I had trouble earlier executing anything at all. I fixed that. Then I had trouble writing to a directory for no visible reason. I ended up changing all my code to write to /tmp (the files it writes ARE temporary, so it was always supposed to write there, really.)

Now... I need to exec a Ruby script. I can't. I can do, say, exec("ruby --version"), or even exec("ruby 'puts 1'"), but I can't do exec("ruby test.rb").

"ruby test.rb" works from the terminal.
 
Yes, I use Apache. But I realized that I gave the description incorrectly. The PHP script actually runs as a cron job. As root. And has the same problem as the Web-based test I whipped up. So it's not related to the server or what user I'm running as.

And why is it such a horrible idea? I have a tool that can create data, I have a tool that needs that data. What's wrong with that?
 
Well, first of all, this is an existing program that broke.

Second, I don't see a lot of other ways to do it that aren't a lot worse.

Had it worked at all, debugging it could be done by sending output to a file (which is what I do, actually). User input can be cleaned up. And what "glue layer" is it that I "don't understand"? Yes, I don't know why there's no output, but that doesn't mean it was stupid to try to find out.
 
Status
You're currently viewing only Tiiba's posts. Click here to go back to viewing the entire thread.
Not open for further replies.