Lefora Free Forum
37 views

IMPORTANT answers for first-time users

Page 1
posts 1–1 of 1
novice - founder
12 posts


I have just helped a friend get started with phocoa on a shared host and there are a few issues he ran into that are worth sharing. Some of the issues are shared-host specific, and others are general enough that they may happen to you even if you aren't in a shared hosting environment.

1. Shared hosts don't let you munge include_path for php, but they will look in "." for a php.ini file, so you can put a php.ini file at wwwroot/php.ini with a custom include_path that points to your pear repo.

2. This happens for the php cli too, which causes problems for the phocoa, phing, and propel-gen scripts. Fortunately all of these cli tools look for a PHP_COMMAND environment variable, so you can just do:


export PHP_COMMAND='php -c /path/to/project/project/wwwroot/php.ini'

3. Unfortunately, phing overrides this. Until they fix this bug, you can just "fix" it in your pear repo by commenting out these 2 lines:


# Change this to reflect your environment if the default value doesn't work
#PHP_COMMAND="/opt/local/bin/php"
#export PHP_COMMAND

4. If you aren't using pecl/syck as your YAML parse, you'll have to make one more fix. The Horde/YAML package also has a bug in that it doesn't properly escape yaml values with # characters.

This fix is also easy, just add the patch from this bug report. Near line 156:

          $spaces = str_repeat(' ', $indent);

+        // quote strings if necessary
+        if (strchr($value, '#')) {
+            $value = "'{$value}'";
+        }
+
          if (is_int($key)) {


5. If phing complains about STDIN not being defined, you can fix this by editing phing/system/io/ConsoleReader.php and adding this around line 36:

define('STDIN', fopen("php://stdin","r"));




That should address any issues you have with getting started with phocoa.

Page 1
posts 1–1 of 1

This Topic Is Locked To Guest Posts

It's been a while since this topic was active, if you'd like to get it going again, please post as a registered member

join now