Executing Shell Scripts in PHP

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

  I am wondering if anyone on this list has made attempts of executing shell scripts using PHP.
  Here is the code:

<?php

$command = "gcc -o hello.c";
exec($command);

?>

  So far, the actual program is something simple that prints out Hello, World. I have tried using

// create a new cURL resource

$ch = curl_init();

// set URL and other appropriate options

curl_setopt($ch, CURLOPT_URL, "http://localhost/hello.c";);

curl_setopt($ch, CURLOPT_HEADER, false);

All I got is the actual code content that is in one single long string. As for using the PHP snippet I have at the beginning of the email, all I get is a blank page, although it does not give me errors of the actual PHP program. Could anyone please tell me what problem I might be having here?

Anything is appreciated.

Alice
======================================================
Alice Wei
MIS 2009
School of Library and Information Science
Indiana University Bloomington
ajwei@xxxxxxxxxxx

-- 
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Database Programming]     [PHP Install]     [Kernel Newbies]     [Yosemite Forum]     [PHP Books]

  Powered by Linux