gibi func("rm -rf /usr/local/)
Hangi 'işlev' Bunu yapmak için kullanacaksınız?
Bu elde etmek istediğinize bağlıdır.
Eğer idam edildi komutu çıktıya görüntülemek istiyorsanız, passthru
a> hile yapar:
This function should be used in place of exec() or system() when the output from the Unix command is binary data which needs to be passed directly back to the browser. A common use for this is to execute something like the pbmplus utilities that can output an image stream directly.
Eğer bir bütün dize olarak bir değişken komutun çıktısını almak istiyorsanız, kullanabileceğiniz shell_exec
(which is the same as using the backtick operator) yapabilirsiniz:
Execute command via shell and return the complete output as a string
Eğer satır satır almak istiyorsanız Ve, kullanacağınız exec
a>:
If the output argument is present, then the specified array will be filled with every line of output from the command. Trailing whitespace, such as \n, is not included in this array.
Yani biri hakkında, belgelere bakın - Eğer biraz daha fazla kontrol gerekiyorsa Ve nihayet, sen proc_open
a> kullanacağız biraz daha zor, sanırım.
Still, when using those :
safe_mode_exec_dir
a>, bu konuda bakınO really gerekli olduğu zaman, ben o sadece kullanmak istiyorum.
PHP'nin exec
fonksiyonunu . Other options include system
, passthru
, and the backtick operator kullanmak istiyorsunuz.