php funzione exec()

qui

Nuovo Utente
22 Nov 2006
11
0
0
Ciao mi sono appena iscritto al forum, ho un piccolo problema, devo lanciare un'applicazione da una pagina web, per fare questo cliccando sul collegamento faccio partire una funzione php, che viene sicuramente richiamata, che esegue il comando

exec(/percorso/eseguibile)

ma nulla l'applicazione non parte, sapete darmi una mano?????? il sistema che uso è linux debian con Apache 2, php 4.

Caio a tutti e grazie
 

dead

Utente Attivo
22 Lug 2005
684
0
0
57
Brescia
www.dead.it
Non ho mai usato quel comando, ma è possibile che l'esecuzione dipenda dalle impostazioni di sicurezza del server.

Questo è l'help ufficiale di exec() Vedi se ti può servire.

PHP:
exec
(PHP 3, PHP 4, PHP 5)

exec -- Execute an external program
Description
string exec ( string command [, array &output [, int &return_var]] )


exec() executes the given command. 

Parameters


command
The command that will be executed. 

output
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. Note that if the array already contains some elements, exec() will append to the end of the array. If you do not want the function to append elements, call unset() on the array before passing it to exec(). 

return_var
If the return_var argument is present along with the output argument, then the return status of the executed command will be written to this variable. 


Return Values
The last line from the result of the command. If you need to execute a command and have all the data from the command passed directly back without any interference, use the passthru() function. 

To get the output of the executed command, be sure to set and use the output parameter. 

Examples
Example 1. An exec() example

<?php
// outputs the username that owns the running php/httpd process
// (on a system with the "whoami" executable in the path)
echo exec('whoami');
?>  
 


Notes

Warning 
If you are going to allow data coming from user input to be passed to this function, then you should be using escapeshellarg() or escapeshellcmd() to make sure that users cannot trick the system into executing arbitrary commands.
 

Note: If you start a program using this function and want to leave it running in the background, you have to make sure that the output of that program is redirected to a file or some other output stream or else PHP will hang until the execution of the program ends.

Note: When safe mode is enabled, you can only execute executables within the safe_mode_exec_dir. For practical reasons it is currently not allowed to have .. components in the path to the executable. 


Warning 
With safe mode enabled, the command string is escaped with escapeshellcmd(). Thus, echo y | echo x becomes echo y \| echo x.
 

See Also


system() 
passthru() 
escapeshellcmd() 
pcntl_exec() 
system() 
backtick operator
 
Discussioni simili
Autore Titolo Forum Risposte Data
A Funzione exec di php, errore 127 PHP 0
Lino80 [Retribuito] Cerco programmatore php per modifica/inserimento funzione/valori da un plugin importer wordpress Offerte e Richieste di Lavoro e/o Collaborazione 0
P Funzione jQuery Ajax invio file a php jQuery 1
M Utilizzare la funzione mysql_num_rows() in PHP 5 PHP 3
D Come usare funzione php PHP 6
Shyson Modificare funzione php PHP 15
pjtertdj Visualizzazione dati in php da mysql con funzione matematica in javascript PHP 1
L Problema funzione mail() PHP PHP 3
maxnegri [PHP]Funzione di calcolo prezzo di una camera in un range di date PHP 62
L [PHP] problema count messo in una funzione. PHP 1
Monital funzione php si ripete due volte PHP 6
GiErre [PHP] [HTML] Disabilitare un link in funzione della piattaforma PHP 7
Monital Funzione php e campo database come variabile PHP 6
M PHP - Funzione non e scrive il risultato PHP 3
F [PHP] La funzione setcookie PHP 0
C [RISOLTO][PHP] Funzione ONclick PHP 14
A [PHP] Problema invio mail con funzione mail() PHP 3
C richiamare una funzione in un altro script php PHP 1
S [PHP] errore funzione sleep PHP 5
MarcoGrazia [PHP] Verifica dell'input utente tramite funzione generica. PHP 0
B [PHP]la pagina php non si carica se aggiungo funzione while PHP 10
A Chiamata funzione PHP con onclick PHP 8
alexbrasile PHP convertire la funzione fsockopen in curl PHP 0
Gaetano1991h [PHP] Chi mi sa spiegare la funzione di questo codice? PHP 1
M [PHP] Errore nell' assegnazione della variabile $this->id su una funzione PHP 1
trattorino [PHP] funzione per visualizzare solo carattere PHP 2
S PHP: inviare via email contenuto di una funzione PHP 4
A Chiamare una specifica funzione in una pagina php PHP 1
G Problema php relativo a funzione di un pulsante PHP 8
D PHP:funzione che opera una query su argomento PHP 8
JackIlPazzo Chiamare una funzione specifica di php da una richiesta ajax? PHP 2
M Far partire una funzione/codice php con javascript Javascript 1
JackIlPazzo Eseguire funzione php senza ricaricare pagina? PHP 3
neo996sps [PHP e funzioni con PDO] Funzione per generare corpo tabella PHP 1
V Chiamata funzione php da javascript Ajax 3
X Conversione funzione php PHP 0
M Disabilitare alcune funzione php da scipt PHP 3
gandalf1959 funzione mail() e variabili su un link nel body in formato xxx.php?$a=$codicecontrollo PHP 2
C Limiti funzione mail() di php PHP 1
P Passare un valore, o arriare una funzione da pagina2.php in pagina1.php Javascript 2
M Applicare funzione php ad ogni elemto html Ajax 3
B AIUTO: come passare una variabile php ad una funzione javascript Javascript 2
F funzione javascript all'interno di un codice php PHP 38
G funzione include di php e paramentri variabili PHP 4
X NOW() funzione mysql eseguita da php PHP 6
I Richiamare funzione jquery all'invio del form php Javascript 6
S php problemi di funzione header usando la fuzione di jquery post PHP 4
S problema con funzione php PHP 3
M PhP Problema funzione mssql PHP 5
H Funzione php non viene richiamata! PHP 41

Discussioni simili