logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Other Software View previous topic :: View next topic
Reply to topic   Topic: Compiling PHP7 on Windows 10 - no Apache library?
Author
schmidtl4



Joined: 16 Jul 2014
Posts: 3

PostPosted: Mon 16 May '16 23:13    Post subject: Compiling PHP7 on Windows 10 - no Apache library? Reply with quote

Hello. I'm diving into compiling PHP7 because I need secure FTP built in. This is all new to me, so I may be missing something.

When I take the easy route and build PHP7 with "configure --enable-snapshot-build", it checks for httpd.h and then notes "WARNING: could not find apache 2.4 libraries/headers".

So I've searched all over to find these libraries and can't find them. Do they exist? if so, please provide a link. Compiling instructions would be a nice gift too.

If the libraries don't exist, does that basically mean I can not compile PHP7 for Apache2.4? Is the only alternative to go with PHP 5.6?

If it matters, all this is being attempted on a Win10 box with Visual Studio 2015, x64 and VC14.

Thanks!
Back to top
Jan-E



Joined: 09 Mar 2012
Posts: 1266
Location: Amsterdam, NL, EU

PostPosted: Tue 17 May '16 3:14    Post subject: Reply with quote

De libraries & headers can be found in deps-7.0-vc14-x64.7z here:
http://windows.php.net/downloads/php-sdk/

Compiling instructions:
https://wiki.php.net/internals/windows/stepbystepbuild

Curious: what kind of secure FTP do you want built-in, that is not present in the cUrl extension?

Did you check my builds:
https://www.apachelounge.com/viewtopic.php?t=6359
Back to top
schmidtl4



Joined: 16 Jul 2014
Posts: 3

PostPosted: Tue 17 May '16 4:45    Post subject: Reply with quote

Thanks Jan-E. I had the libraries and headers and indeed was using the step by step wiki. I discovered, however, that I unzipped them into the wrong directory. So that problem is solved.

I'm looking for FTPeS (explicit TLS). Is that what you have in your builds? I moved to compiling my own based on the documentation for ftp_ssl_connect (http://php.net/manual/en/function.ftp-ssl-connect.php) indicating that "on Windows this function will be undefined in the official PHP builds. To make this function available on Windows you must compile your own PHP binaries."

If you are so inclined, may I ask another question? When I run nmake in visual studio I get 100s of rows with the "warning C4018: '>=': signed/unsigned mismatch" error. Is this the compiler being "strict" or are these errors indicating something very awry with the compile?
Back to top
Jan-E



Joined: 09 Mar 2012
Posts: 1266
Location: Amsterdam, NL, EU

PostPosted: Tue 17 May '16 8:53    Post subject: Reply with quote

schmidtl4 wrote:
I'm looking for FTPeS (explicit TLS). Is that what you have in your builds? I moved to compiling my own based on the documentation for ftp_ssl_connect (http://php.net/manual/en/function.ftp-ssl-connect.php) indicating that "on Windows this function will be undefined in the official PHP builds. To make this function available on Windows you must compile your own PHP binaries."

Interesting. My builds do not have FTP and Openssl linked statically so ftp_ssl_connect() will not be available.

Did you try using curl.exe? This can be used for FTPeS:
http://www.lewisroberts.com/2010/08/06/scripting-ftpes-explicit-tlsssl-with-curl/

There is a curl.exe inside https://phpdev.toolsforresearch.com/openssl-1.0.2h-fips-2.4.20-x64-vc14.zip

If that works, there is a chance that the cUrl extension can be used: http://php.net/curl (see the notes).

schmidtl4 wrote:
If you are so inclined, may I ask another question? When I run nmake in visual studio I get 100s of rows with the "warning C4018: '>=': signed/unsigned mismatch" error. Is this the compiler being "strict" or are these errors indicating something very awry with the compile?

Ignore them. The PHP devs are ignoring a lot of warnings themselves as well. See for instance http://windows.php.net/downloads/snaps/php-7.0/r7e5ea3c/logs/make-ts-windows-vc14-x64-r7e5ea3c.html
Back to top
Jan-E



Joined: 09 Mar 2012
Posts: 1266
Location: Amsterdam, NL, EU

PostPosted: Tue 17 May '16 10:56    Post subject: Reply with quote

Jan-E wrote:
schmidtl4 wrote:
I'm looking for FTPeS (explicit TLS). Is that what you have in your builds? I moved to compiling my own based on the documentation for ftp_ssl_connect (http://php.net/manual/en/function.ftp-ssl-connect.php) indicating that "on Windows this function will be undefined in the official PHP builds. To make this function available on Windows you must compile your own PHP binaries."

Interesting. My builds do not have FTP and Openssl linked statically so ftp_ssl_connect() will not be available.

I checked that, but it is only the case in PHP5. In PHP7 ftp_ssl_connect() also exists if you enable php_ftp.dll and php_openssl.dll.

That might be related to another change. In PHP5 ftp was always a static extension. In PHP7 it is a separate shared extension php_ftp.dll.

I discovered this after compiling PHP7 x64 with static OpenSSL and static FTP:

https://phpdev.toolsforresearch.com/php-7.0.7RC1-Win32-VC14-x64-FTPeS.htm
https://phpdev.toolsforresearch.com/php-7.0.7RC1-Win32-VC14-x64-FTPeS.zip

With shared extensions:

https://phpdev.toolsforresearch.com/php-7.0.7RC1-Win32-VC14-x64.htm
https://phpdev.toolsforresearch.com/php-7.0.7RC1-Win32-VC14-x64.zip

Note the 'FTPS support enabled' in both phpinfo() outpits.
Back to top
schmidtl4



Joined: 16 Jul 2014
Posts: 3

PostPosted: Tue 17 May '16 14:06    Post subject: Reply with quote

@Jan - this is all super helpful. I've got things working with your 7.06 builds (your first suggestion) and curl. I didn't realize there were changes to ftp_ssl_connect for PHP7 so I may check that out as well.

Thank you for all the references and compilation advice and links. Super, super helpful! Very Happy
Back to top
Jan-E



Joined: 09 Mar 2012
Posts: 1266
Location: Amsterdam, NL, EU

PostPosted: Tue 17 May '16 14:21    Post subject: Reply with quote

I hadn't noticed my self that the FTP extension wasn't static anymore. And ftps in the shared extension is also a fairly old change:
https://github.com/php/php-src/commits/master/ext/ftp/config.w32
Back to top


Reply to topic   Topic: Compiling PHP7 on Windows 10 - no Apache library? View previous topic :: View next topic
Post new topic   Forum Index -> Other Software