LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 11-16-2005, 08:42 AM   #1
Aziz
LQ Newbie
 
Registered: Sep 2004
Location: USA
Distribution: Fedora Core 3
Posts: 29

Rep: Reputation: 15
Arrow Running scripts on apache


hello guys,

I am using PHP to run a script, called server.php

If I run the script server.php, from ANY user it should work, which does when I do it on the command prompt.

But when I access server.php from apache, www.site.com/server.php, it will not excute the command.

Apache is also allowed to access the script (i tried it on command prompt).

the server.php simply excutes another script (qtpasswd, quicktime streaming server).

server contains:

PHP Code:
echo "qtpasswd -f /home/ashow/qtusers aziz2 -p aziz2<br/>";
if(!
shell_exec("qtpasswd -f /home/ashow/qtusers aziz2 -p aziz2")){
    
$body .= "Failed shell_exec, trying exec:<br/>";
    if(!
exec("qtpasswd -f /home/ashow/qtusers aziz2 -p aziz2")){
        
$body .= "Failed exec, trying passthrough:<br/>";
        if(!
passthru("qtpasswd -f /home/ashow/qtusers aziz2 -p aziz2")){
            
$body .= "all failed<br/>";
        } else {
            
$body .= "passthru passed";
        }
    } else {
        
$body .= "Passed exec";
    }
} else {
    
$body .= "Passed shell_exec";

whic also tries various methods of excution but it does not work..
keep in mind that when I do excute other scripts, they do work (ls,whoami)..

appreciate any help

Peace,
 
Old 11-16-2005, 09:29 AM   #2
fvgestel
LQ Newbie
 
Registered: Oct 2005
Location: Netherlands
Posts: 21

Rep: Reputation: 15
Is qtpasswd using the X-window system? You can check this by undefining the DISPLAY variable and run the command as any user.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Need help running scripts from scripts sdouble Linux - Newbie 3 05-31-2004 12:56 PM
Apache not running php scripts Seventh Linux - Newbie 3 01-08-2004 08:35 PM
running perl scripts une mdk9.l and apache clefler Linux - Software 4 11-15-2003 12:35 PM
[apache] running user scripts. yapp Linux - Software 0 10-03-2003 05:00 AM
Help Running Scripts josefalero Linux - Newbie 2 11-14-2002 04:36 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 04:40 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration