Dreamhost facebook app dev note

Dreamhost has deprecated php4 and doesn’t serve it using apache anymore. Nonetheless, the php command is still hardlinked to the php4 binary. This means that when you try to execute your php code to see what’s going wrong, facebook’s code (which only works with php5) throws a lovely error:

Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /home//facebook.php on line 38

To fix this, add alias php='/usr/local/php5/bin/php' to your ~/.bash_profile and re-login. Now when you run php from the command line, it will use version 5, which you can verify by running php -v.

Post a Comment

Your email is never published nor shared. Required fields are marked *