I have a project that relies on datastax php-driver: https://github.com/datastax/php-driver
I have been using this drive successfully for PHP 5.6 and travis. I wanted to switch to container build since the owners of the php-drive has managed to do so (also getting the built faster is a bonus).
I ran into the following error:
checking whether the C compiler works... no
configure: error: in `/home/travis/build/company-project/git-repo-project/php-driver/ext':
configure: error: C compiler cannot create executables
configure: error: C compiler cannot create executables
See `config.log' for more details
The command "./install.sh" failed and exited with 77 during .
The .travis.yml file looks like the following:
language: php
sudo: false
addons:
apt:
packages:
- libssl-dev
- g++
- make
- cmake
- clang
cache:
ccache: true
directories:
- ${HOME}/dependencies
php:
- 5.6
env:
global:
# Configure the .phpt tests to be Travis friendly
- REPORT_EXIT_STATUS=1
- TEST_PHP_ARGS="-q -s output.txt -g XFAIL,FAIL,BORK,WARN,LEAK,SKIP -x --show-diff"
- PATH=$HOME/.local/bin:$PATH
# Indicate the cached dependencies directory
- CACHED_DEPENDENCIES_DIRECTORY=${HOME}/dependencies
# Add libuv source build for container based TravisCI
- LIBUV_VERSION=1.8.0
- LIBUV_ROOT_DIR=${CACHED_DEPENDENCIES_DIRECTORY}/libuv/${LIBUV_VERSION}
- APP_ENV=travis
before_install:
# Configure, build, install (or used cached libuv)
- if [ ! -d "${LIBUV_ROOT_DIR}" ]; then
pushd /tmp;
wget -q http://dist.libuv.org/dist/v${LIBUV_VERSION}/libuv-v${LIBUV_VERSION}.tar.gz;
tar xzf libuv-v${LIBUV_VERSION}.tar.gz;
pushd /tmp/libuv-v${LIBUV_VERSION};
sh autogen.sh;
./configure --prefix=${LIBUV_ROOT_DIR};
make -j$(nproc) install;
popd;
popd;
else echo "Using Cached libuv v${LIBUV_VERSION}. Dependency does not need to be re-compiled";
fi
- git clone https://github.com/datastax/php-driver.git
- cd php-driver
- git submodule update --init
- cd ext
- ./install.sh
- cd "$TRAVIS_BUILD_DIR"
- echo "extension=cassandra.so" >> `php --ini | grep "Loaded Configuration" | sed -e "s|.*:\s*||"`
# Install CCM
- pip install --user ccm
install:
- composer update -n
services:
- mysql
- cassandra
script:
- vendor/bin/codecept run
Initially as packages, only the libssl-dev was need, but since it was a C compiler missing, I decided to check the datastax build guide and toss in some extra packages: http://datastax.github.io/cpp-driver/topics/building/
The error remains unchanged. I know that the reason why datastax's driver passes the the travis build is due to the fact the make is compiled in their c language, however I was able to successfully do the entire run through when I used to be in sudo and not container. Any help is appreciated.