web - Difference between in PHP shell-scripts and PHP on MAMP? -
this weird me. wonder why. wrote php script validate syntax of php script named test.php
<?php print("hello world"); ?> the validating script index.php is:
#!/usr/bin/env php <?php exec("php -l test.php", $error, $retcode); echo($retcode . "<br />"); var_dump($error); ?> when run on command line php index.php, generates output:
0<br />array(1) { [0]=> string(37) "no syntax errors detected in test.php" } this looks me. however, when run on localhost generates output:
#!/usr/bin/env php 5 array(0) { } why $retcode set 5? also, i'm on php5.3
okay, figured out.
check http://linux.die.net/man/1/rsync exit code info.
the problem have use php interpreter on mamp, is:
exec("/applications/mamp/bin/php/php5.3.6/bin/php -l $file",$error,$retcode); the 1 used before php interpreter on os x.
Comments
Post a Comment