Re: [PHP] exec and system do not work

[email protected] (Sorin Badea)
Newsgroups php.general
Message-ID <CADcJcD1GaVKi4KYoG3wX+_TXQSDOf9dkTwarbEcOGU2aqkC2gg@mail.gmail.com>
*/var/www* is usually under *www* user. It may be a permissions problem.


On Mon, Aug 26, 2013 at 6:41 AM, Ethan Rosenberg <
[email protected]> wrote:

> Dear List -
>
> I'm lost on this one -
>
> This works -
>
> $out = system("ls -l ",$retvals);
> printf("%s", $out);
>
> This does -
>
> echo exec("ls -l");
>
> This does not -
>
> if( !file_exists("/var/www/orders.**txt"));
> {
>    $out = system("touch /var/www/orders.txt", $ret);
>    $out2 = system("chmod 766 /var/www/orders.txt", $ret);
>    echo 'file2<br />';
>    echo file_exists("/var/www/orders.**txt");
> }
>
> and this does not -
>
> if( !file_exists("/var/www/orders.**txt"));
> {
>    exec("touch /var/www/orders.txt");
>    exec("chmod 766 /var/www/orders.txt");
>    echo 'file2<br />';
>    echo file_exists("/var/www/orders.**txt");
> }
>
> Ethan
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


-- 
Sorin Badea - Software Engineer
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.