PHP try-catch not recognized on command-line? (Trying to install Composer) -
i trying install composer (http://getcomposer.org/download/) on godaddy-hosted linux server it's not working. no matter method try, run against version of following error:
parse error: syntax error, unexpected '{' on line 290.
line 290 refers line 290 in file: https://getcomposer.org/installer start of try-catch block. and, indeed, simple script like:
echo '<?php echo "hello world "; try {echo "goodbye";} catch (exception $e) {} ?>' | php
produces same type of syntax error (forgive awkward piping. godaddy doesn't seem -r option).
similarly, if put code in file "argh.php" , run php -f argh.php
syntax error, work fine if visit page in browser.
does know why php keeps choking on try-catch block or other way can install composer? (p.s., using php 5.3)
echo '<?php echo "hello world "; try {echo "goodbye";} catch (exception $e) {} ?>' | /web/cgi-bin/php5
works fine. dumb. try installing composer using /web/cgi-bin/php5 , see happens.
Comments
Post a Comment