Re: why is this shell_exec() failing to execute my shell to create a symlink?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Make sure that:

- The user executing the script (apache I presume) has execute
permissions on ls and ln binaries.
- The user executing the script has write persmissions on the
directory you are trying to write, and read permissions where you do
ls.
- This will probably help: put the full binary path for ls and ln, it
depends on your OS, but probably they are: /bin/ls and /bin/ln

If that doesn't help, can you show us the output?

Jonathan

On Sat, Jun 27, 2009 at 5:46 PM, Govinda<govinda.webdnatalk@xxxxxxxxx> wrote:
> this code:
>
> <?php
>
>        $testOutput = shell_exec("ls");
>
>        $where2cd2='testDir/';
>        $firstCMD="cd $where2cd2";
>         $firstOutput = shell_exec("$firstCMD");
>        // $firstOutput = shell_exec('cd testDir/');
>        $testOutput2 = shell_exec("ls");
>
>        $secondCMD='ln -s amex_cid.gif myccGOV.gif';
>        $secondOutput = shell_exec("$secondCMD");
>
>        echo "testOutput:<br><pre>$testOutput</pre>";
>        echo
> "testOutput2:<br><pre>$testOutput2</pre><br>firstCMD=$firstCMD<hr>";
>        echo
> "firstOutput:<br><pre>$firstOutput</pre><br>secondCMD=$secondCMD<hr>";
>        echo
> "secondOutput:<br><pre>$secondOutput</pre><br>thirdCMD=$thirdCMD<hr>";
>
> ?>
>
> is not producing the symlink that I think it should.  (?!?)  (neither in the
> dir/ where this script lives, nor in the testDir/ where I am actually trying
> to create it, on the fly.
> Server is not in safe mode.
>
>
> ------------
> Govinda
> govinda.webdnatalk@xxxxxxxxx
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux