php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #71227 Can't compile php_curl statically
Submitted: 2015-12-27 13:57 UTC Modified: 2016-01-04 12:22 UTC
From: amir at zend dot com Assigned: ab (profile)
Status: Closed Package: *Compile Issues
PHP Version: 7.0.1 OS: Windows
Private report: No CVE-ID: None
 [2015-12-27 13:57 UTC] amir at zend dot com
Description:
------------
I'd like to compile php_curl statically into php but everything I tried only compiled it as a shared module.
I used the following configure options (tried both '--with-curl' and '--with-curl=static' and also tried to compile only with libcurl.lib and only with libcurl_a.lib):

.\configure --disable-all --enable-debug-pack --enable-cli --enable-ipv6 --disable-zts --enable-cgi --enable-com-dotnet --enable-filter --enable-pdo --with-libxml --with-iconv --with-openssl --enable-cgi --enable-zlib --enable-xmlreader --enable-xmlwriter --enable-session --with-mysqlnd --with-dom --enable-filter --enable-json --with-mysqli=shared --with-pdo-mysql=shared --enable-phar=shared --with-simplexml --with-xml --with-mcrypt=shared --enable-hash --enable-ftp --with-pdo-sqlite --with-sqlite3 --enable-zip --with-xmlrpc=shared --enable-ctype --with-mp=5 --with-gd=shared --enable-mbstring=shared --enable-bcmath=shared --enable-calendar=shared --enable-shmop=shared --enable-sockets=shared --with-wddx=shared --enable-tokenizer=shared --with-curl=static --with-oci8=shared,instantclient --with-xsl=shared --with-bz2=shared --enable-exif=shared --enable-intl=shared --with-gettext=shared --with-gmp=shared --with-imap=shared --with-ldap=shared --with-libwebp --enable-odbc=shared --with-pgsql=shared --with-pdo-pgsql=shared --with-tidy=shared --enable-soap=shared --with-pdo-odbc=shared --enable-fileinfo=shared

And got the following related to curl:
Checking for library libcurl_a.lib;libcurl.lib ... ..\deps\lib\libcurl.lib
Checking for curl/easy.h ...  E:\bld\nightly\phpdev\vc14\x86\deps\include
Checking for library ssleay32.lib ... ..\deps\lib\ssleay32.lib
Checking for library libeay32.lib ... ..\deps\lib\libeay32.lib
Checking for library winmm.lib ... <in LIB path> WinMM.Lib
Checking for library wldap32.lib ... <in LIB path> Wldap32.Lib
Enabling extension ext\curl [shared]


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2016-01-01 17:49 UTC] ab@php.net
-Status: Open +Status: Not a bug
 [2016-01-01 17:49 UTC] ab@php.net
Thanks for the report. Yes, ext/curl won't build static as well as many other extensions on Windows. The reason are several limitations based on the concrete libraries builds, or their dependencies. In this case, the fact libcurl links with openssl enforces ext/curl to be always built shared.

Thanks.
 [2016-01-04 09:10 UTC] zeev@php.net
-Status: Not a bug +Status: Re-Opened -Assigned To: +Assigned To: ab
 [2016-01-04 09:10 UTC] zeev@php.net
Anatol - what changed since 5.6, where it was possible to build ext/curl as static?  Why does the dependency on OpenSSL make it impossible?

Thanks!
 [2016-01-04 12:22 UTC] ab@php.net
Hi Zeev,

ext/curl is forced shared since http://git.php.net/?p=php-src.git;a=commit;h=deb0695069ef72d7a0936fdabaa7c9fea02f7fcd (like 5.2 times?). So nothing changed actually, 5.3 for sure behaves same already. There are many reasons for doing so, specifically with OpenSSL for link and runtime issues. But with other deps as well. 

We could indeed re-evaluate this case as this new technique used in 7.0 today http://git.php.net/?p=php-src.git;a=blob;f=UPGRADING.INTERNALS;hb=refs/heads/PHP-7.0#l311 . Amir, there's #winphp-dev on freenode where you could poke me for some direct discussions as well. If we can come up with a worky constelaltion, so could change it also at some other places (ext/ftp what comes in mind yet). Though please note that we only use libcurl_a.lib nowadays.

Thanks.
 [2016-01-07 17:58 UTC] ab@php.net
Automatic comment on behalf of ab
Revision: http://git.php.net/?p=php-src.git;a=commit;h=1fb763ccab11c2b2c06f89c607d673b262d8f3cf
Log: Fixed bug #71227 Can't compile php_curl statically
 [2016-01-07 17:58 UTC] ab@php.net
-Status: Re-Opened +Status: Closed
 [2016-01-07 17:59 UTC] ab@php.net
Automatic comment on behalf of ab
Revision: http://git.php.net/?p=php-src.git;a=commit;h=e885cd817c1e1b8b7f2f126c3ccbbb7d31f2534b
Log: Fixed bug #71227 Can't compile php_curl statically
 [2016-01-08 07:12 UTC] ab@php.net
Automatic comment on behalf of ab
Revision: http://git.php.net/?p=php-src.git;a=commit;h=1fb763ccab11c2b2c06f89c607d673b262d8f3cf
Log: Fixed bug #71227 Can't compile php_curl statically
 [2016-04-18 09:30 UTC] bwoebi@php.net
Automatic comment on behalf of ab
Revision: http://git.php.net/?p=php-src.git;a=commit;h=e885cd817c1e1b8b7f2f126c3ccbbb7d31f2534b
Log: Fixed bug #71227 Can't compile php_curl statically
 [2016-07-20 11:34 UTC] davey@php.net
Automatic comment on behalf of ab
Revision: http://git.php.net/?p=php-src.git;a=commit;h=e885cd817c1e1b8b7f2f126c3ccbbb7d31f2534b
Log: Fixed bug #71227 Can't compile php_curl statically
 [2016-07-20 11:34 UTC] davey@php.net
Automatic comment on behalf of ab
Revision: http://git.php.net/?p=php-src.git;a=commit;h=1fb763ccab11c2b2c06f89c607d673b262d8f3cf
Log: Fixed bug #71227 Can't compile php_curl statically
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Dec 01 03:01:29 2024 UTC