Jump to content

noman

New Members
  • Posts

    3
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

noman's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. echo $last_line; doesnt show anything on the page. If I run that script separately at the shell prompt, it shud say sth like: "server reload successful" coz I reload a service in the script. If I try to run the commands like "ls -l" , the echo $last_line return the directory listing displayed on the page.
  2. thanks for replying friends. but I have tried all these options. I changed the ownership of the XYZ to the user "apache". tried with the absolute path. the file is executable. is there any option in php function to specify the shell prompt along with the command string to run? I tried with the following different methods: $last_line = system('./XYZ', $returnval); or $command = "/var/www/html/XYZ"; $last_line = system($command, $retval); same case with exec() and shell_exec().
  3. Hi all Am new to php, here's what am stuck at: I have a simple executable script file, lets say XYZ, for linux which needs two arguments (a & b) to be passed while executing. This script also calls another file which lies in the same folder. So this thing works perfect if I run script XYZ separately from the command prompt: root@server# XYZ a b All I need to do is to call this script XYZ inside php code. I've tried exec(), shell_exec(), system() but no result. these fundtions are working fine if I try to run basic commands like "ls -l" etc. Am working on Centos 5.2, tried changing the ownership of script files, permission in files but no use. ANY IDEA......???? thanks Noman
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.