PHP Tricks

From Foldeomics Wiki

Jump to: navigation, search

Finding 'Short' Tags

The use of <?> instead of <?php> is problematic, as it will crash with a spectacularly un-informative error message on servers not configured to use short tags.

Such short tags can be identified by searching the php project with the regexp <\?[^p].


Avoiding Default PHP4 Libraries on OSX

You must change your path to use PHP5, otherwise you will install pear libraries (and get existing libraries) for the default OSX PHP 4 install.

Working with jpgraph

you can comment out Graph->Stroke() to see php error messages rather than a blank page...

you will need to change php.ini to remove 'notice' and 'strict' error reporting:

error_reporting = E_ALL & ~E_NOTICE & ~E_STRICT

(otherwise it screws the http stream with extra text data before the binary jpeg data starts come through).

Personal tools