Re: exec and system do not work
| From: | Sorin Badea | Date: | Mon, 26 Aug 2013 03:50:05 +0000 |
| Subject: | Re: exec and system do not work | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-321966@lists.php.net to get a copy of this message | ||
*/var/www* is usually under *www* user. It may be a permissions problem.
On Mon, Aug 26, 2013 at 6:41 AM, Ethan Rosenberg <
erosenberg@hygeiabiomedical.com> 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