Closed nate-r closed 8 years ago
@nate-r can you give us a link to your build?
@abhijitkini Sure, https://app.shippable.com/runs/5786eb3379afc10c005cac09/1/console
@abhijitkini was there anything else you need from me?
@nate-r sorry for the delay. Will have the engineering team dig into this.
@nate-r unfortunately we have spent some time on this before without finding a resolution. Please look at issue https://github.com/Shippable/support/issues/2658
At this time we dont know of a way to achieve this, especially for php7 for which extensions have been notoriously difficult to install.
@manishas Sorry to hear that! If you don't mind elaborating, is the difficulty in compiling/enabling extensions related to how php7 is being included in the docker images? I took at look at php -i output during one of my test builds and IIRC only sqlite and mysql extensions were compiled in. It didn't look like anything of significance was available as a shared object from a brief glance at the folder storing the php .so files.
Let me know if there's anything I can do to help. I'd love to be able to have more options available in terms of php extensions.
@nate-r We use php-build
to install different php
versions side by side and pickle to install php
extensions.The limitation here is that compiling extensions for php7
requires php7-dev
which is not available via apt-get
. Hence extensions that require php7-dev
fail to compile.
@chetantarale Thanks for the info!
I was able to successfully install a pdo_pgsql.so extension by doing the following:
1) Fired up a fresh digital ocean ubuntu14 droplet...
2) Install php build dependencies... this is what i came up with from trial and error and the build-php docs (don't ask me why the suggest installing php5-cli):
apt-get update && apt-get install -y git build-essential postgresql-server-dev-all libmcrypt-dev libreadline-dev libxml2-dev libssl-dev libcurl4-openssl-dev libjpeg-dev libpng-dev libtidy-dev libxslt-dev openssl bison autoconf automake libtool re2c flex php5-cli
3) Following the build-php installation command
curl -L http://git.io/phpenv-installer \
| bash
4) Doing what the output says to do:
cat <<EOT >> ~/.bash_profile
export PHPENV_ROOT="/root/.phpenv"
if [ -d "\${PHPENV_ROOT}" ]; then
export PATH="\${PHPENV_ROOT}/bin:\${PATH}"
eval "\$(phpenv init -)"
fi
EOT
5) Load the profile changes
source ~/.bash_profile
6) TELL BUILD-PHP TO COMPILE THE DARN pdo_pgsql.so FILE
export PHP_BUILD_CONFIGURE_OPTS="--with-pdo_pgsql=shared"
7) Install the same php version that the Shippable container seems to use
phpenv install 7.0.1
8) Get some coffee or something while it compiles...
9) Grab the pdo_pgsql.so file it created and toss it into my repository as shippable_pdo_pgsql.so
pwd && ls -hal
/root/.phpenv/versions/7.0.1/lib/php/extensions/no-debug-non-zts-20151012
total 4.5M
drwxr-xr-x 2 root root 4.0K Jul 21 00:15 .
drwxr-xr-x 3 root root 4.0K Jul 21 00:14 ..
-rwxr-xr-x 1 root root 1.9M Jul 21 00:14 opcache.a
-rwxr-xr-x 1 root root 915K Jul 21 00:14 opcache.so
-rwxr-xr-x 1 root root 323K Jul 21 00:14 pdo_pgsql.a
-rwxr-xr-x 1 root root 184K Jul 21 00:14 pdo_pgsql.so
-rwxr-xr-x 1 root root 1.2M Jul 21 00:15 xdebug.so
10) Adjust shippable.yml to enable the postgres service and do the following for php:
before_script:
- cp shippable_pdo_pgsql.so /root/.phpenv/versions/7.0/lib/php/extensions/no-debug-non-zts-20151012/pdo_pgsql.so
- echo "extension = pdo_pgsql.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
11) Watch build laravel build and run tests using postgres for the db! Successful build: https://app.shippable.com/runs/57904fdf58cae40c001bff14/1/console
Anyway, I hope that helps out other users who might be in the same position needing a specific PHP extension. It's not ideal. IMHO it would be far better for Shippable to enable as many shared extensions as they can using that PHP_BUILD_CONFIGURE_OPTS environment variable before the version of php is built using php-build. I hope this leads to a better solution!
@nate-r Thanks for this workaround. It'll help other users with this issue until we get to a better solution.
Is postgres supported for php?
I'm playing with a laravel app and thought I'd try using postgres for a change instead of mysql.
I've set up the shippable.yml, and enabled the postgres service, but I'm stuck at what I need to do to actually install the driver (pdo_pgsql extension) for PHP.
I tried "/tmp/pickle/bin/pickle pdo_pgsql" but I'm honestly unclear if that's the appropriate way to add a PHP extension, and it returns an error about being unable to parse the PHP_PDO_PGSQL_VERSION macro (or something like that).
Google hasn't really given me anything to try next and I'm over a dozen commits into trying different shippable.yml commands instead of working on the actual app. ;)
Any suggestions are appreciated!