CiviCRM installation error notes
Note: if you don't care about Drupal, PHP, or CiviCRM, you should stop reading now.
Earlier this week I installed CiviCRM on a client's Drupal site. To my chagrin, the only thing civicrm would do consistently is spew errors like this:
"Warning: Smarty error: problem creating directory ..."
After a lot of hair-pulling and swearing and crying, I found the problem. The host for the site runs PHP in safe mode. When safe mode is on, the value returned from file_exists() is unreliable.
Example:
Let's say the file path to your web site is /a/b/c/d, where folders c and d are the ones you actually have access to. Since your host runs php in safe mode, file_exists("/a") will return false, even though it's a valid directory. Same with file_exists("/a/b"), but file_exists("/a/b/c") returns true.
In the Smarty package within CiviCRM, in core.create_dir_structure.php, around line 69, file_exists() is used in this fashion, so if php is in safe mode, the function that creates all the neat template directories for civicrm will return false, spew an error, and exit, which, and I mean this very seriously, causes a little kitten to die. Every time.
I worked around this just by commenting out the line that triggers the error and the line that returns false after the error, but there must be a better way.
I couldn't find any solution to this problem by googling, so I'm hoping this will be helpful to some other sorry bastard who needs to install civicrm and has a half hour to do it.



