Very Simple circle.yml fails to start Apache

So it seems that a simply misconfiguration on CircleCI’s part sent me down a rabbit hole for hours. :frowning:

I eventually found the answer here.

Seems that /usr/lib/apache2/modules/libphp5.so was symlinked to the wrong directory /home/ubuntu/.phpenv instead of the correct directory /opt/circleci/.phpenv.

The full path to symlink to should be "${PHPENV_ROOT}/versions/$(phpenv global)/usr/lib/apache2/modules/libphp5.so" where ${PHPENV_ROOT} provides "/opt/circleci/.phpenv" and $(phpenv global) provides the PHP version number, such as "5.6.22".

This is what I had to add to my circle.yml file to finally get it to work:

dependencies:
  pre:
    - sudo unlink "/usr/lib/apache2/modules/libphp5.so"
    - sudo ln -s "${PHPENV_ROOT}/versions/$(phpenv global)/usr/lib/apache2/modules/libphp5.so" "/usr/lib/apache2/modules/libphp5.so"

This is a serious landmine for wasting time, and it makes my first user experience of CircleCI less than positive. I hope the rest of CircleCI is not filled with other gotchas or I will wish I had chosen a different platform.