php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #30700 Empty output using system(<wrong string>) function
Submitted: 2004-11-06 14:05 UTC Modified: 2004-11-06 15:47 UTC
From: igor dot makarov at mail dot ru Assigned:
Status: Not a bug Package: Output Control
PHP Version: 4.3.8 OS: Linux 2.4.27
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: igor dot makarov at mail dot ru
New email:
PHP Version: OS:

 

 [2004-11-06 14:05 UTC] igor dot makarov at mail dot ru
Description:
------------
I make a code:
system('ls -gfjgsfl');

and I nothing see then as I read in manual: "Execute an external program and ->display output<-"

In this situation then I use wrong unix command the system() function not worked propertly.

I think what it's will be solved in next version...
I do not know how it's work under PHP5.

P.S.
With passthru() and exec() functions same problem :o(

Reproduce code:
---------------
<?php

system('ls -gfjgsfl');
//nothing see

$_out = system('ls -gfjgsfl');
//still nothing see

?>

Expected result:
----------------
/bin/ls: invalid option -- j
Try `/bin/ls --help' for more information.



Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-11-06 15:47 UTC] tony2001@php.net
Errors are written to error_log by default, so check out your Apache's error log for them. If you really want to see error messages when using system() - redirect stderr to stdout:
<?php system ("ls -j 2>&1"); ?>
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Mon Jul 07 12:01:35 2025 UTC