Example on .travis.yml with CURL extension enabled

Notice: This thread is very old.
JuniorJR
Member | 181
+
0
-

Hi, I have a problem related to php CURL extension needed in travis-ci tests. Could anybody give me an working example how to correctly install & enable the PHP CURL extension via .travis.yml? My tests rely on existence of some CURL error constants.

I need to support CURL extension in both PHP 5.6 and PHP 7.

I've been trying to do sudo apt-get install php5-curl and then in my custom php.ini doing
extension = curl.so

But extensions directory is obviously unknown and using relative path does not work.

Thank you very much.

JR

amik
Member | 118
+
0
-

If you need to find out default extension directory, you may try this trick:

PHP_EXT=`php -r "echo ini_get('extension_dir');"`
echo "extension_dir=$PHP_EXT" >> ./tests/php.ini

but AFAIK, CURL and most other extensions are enabled on travis-ci.org by default, do you really need custom php.ini for travis tests?