calling php scripts
Posted: Sat May 21, 2005 8:55 am
Hello everyone.
I'm having trouble trying to call a php script. I've tried using exec() and phpopen().
Both of these work when I try to call a simple function such as "ls -l", but when it comes to calling an actual php script, I'm having very little luck. It'll work sporadically, but I can't find a pattern.
Here's a quick example:
php.caller
=======
exec("php_test_script.php");
// I've tried this also:
//$handle = popen("php test_script_make_output.php", "r");
//pclose($handle);
php_test_script.php
==============
$iHandle = fopen("output.txt", "w");
fwrite($iHandle, "testing 1");
fclose($iHandle);
I'm trying to write to a file called output.txt when php.caller is executed.
If I run php_test_script.php by itself, it works fine.
Any suggestions would be GREATLY appreciated!
Thanks!
I'm having trouble trying to call a php script. I've tried using exec() and phpopen().
Both of these work when I try to call a simple function such as "ls -l", but when it comes to calling an actual php script, I'm having very little luck. It'll work sporadically, but I can't find a pattern.
Here's a quick example:
php.caller
=======
exec("php_test_script.php");
// I've tried this also:
//$handle = popen("php test_script_make_output.php", "r");
//pclose($handle);
php_test_script.php
==============
$iHandle = fopen("output.txt", "w");
fwrite($iHandle, "testing 1");
fclose($iHandle);
I'm trying to write to a file called output.txt when php.caller is executed.
If I run php_test_script.php by itself, it works fine.
Any suggestions would be GREATLY appreciated!
Thanks!