ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I'm interested in making a very basic PHP script for a Linux server. It should only do this:
1. execute some command-line program (which normally prints some text to the screen)
2. Write this text to the web page instead.
This is for monitoring a cluster, and I'd like to be able to view the cluster status using a web browser instead of logging in by SSH or something.
Ahh thank you, this is exactly what I was looking for. This works with commands like 'ls' and 'ps', but it does not print any output from the program I'd like to use. In this case the return value from system() is 1. Is this a permissions issue? I've tried chmod 777 on the program but this does not seem to make a difference.
It's called condor_status from the Condor project (http://www.cs.wisc.edu/condor/). I'm not sure if this is relevant though? I can run the program as a normal unpriveledged user and it works, and I can also redirect the text output to a file (using the > operator) but this does not seem to work either when I try with PHP.
I have a workaround....If I write a script which does nothing except run condor_status, and use PHP to execute the script, it works. I can't explain why. But I'll be happy with that.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.