I've spent hours trying to get this to work, but I can't seem to figure it out. This site has been good to me with my java problems and I saw this php section so I figured I'd come back and give it a try.

What I have and assume I need:
Virtual C++ 2008 Express Edition
Microsoft Windows SDK for Vista Update
Microsoft .NET Framework SDK 2.0
PHP 5.2.9 Source Code

In the Virtual C++ 2008 Express Edition's Command Prompt, I simply browsed to the PHP 5.2.9 source code folder and typed these commands:

buildconf.bat

... readies the script ...

cscript /nologo configure.js --enable-cli --with-openssl

... bunch of stuff happens ....

and before I could use "nmake" to create everything, this comes up: (see attachment)

I have no idea what to do.... I really need to compile with openssl which XAMPP does not have.

Any help would be appreciated! I'm using Vista 64-bit for my OS. Thnx.

Recommended Answers

All 7 Replies

do you really need to rebuild PHP for openssl?

You should be able to just use enable the openssl extension in PHP.ini.

restart apache, and the php_openssl.dll will be loaded dynamically.

You can find the extensions path with phpinfo(), as the value for "extension_dir". php.ini path is also there.

Read this: http://www.php.net/manual/en/function.ftp-ssl-connect.php

I might actually have to as I have tried to uncomment that extension with no results... It looks like it has to be built in statically.

Note: Why this function may not exist
ftp_ssl_connect() is only available if both the ftp module and the OpenSSL support is built statically into php, this means 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.

Honestly, it makes no sense to me why a function wouldn't be included like that, but hey, what can I do? I have to compile my own to get it working.

Read this: http://www.php.net/manual/en/function.ftp-ssl-connect.php

I might actually have to as I have tried to uncomment that extension with no results... It looks like it has to be built in statically.

Honestly, it makes no sense to me why a function wouldn't be included like that, but hey, what can I do? I have to compile my own to get it working.

Sorry, I didn't read the docs - you're right.

You'll probably have to try a different version of the source. See if you get the same problem.

What I would do is bypass the ftp extension all together.

Try something like:

$host = 'example.com';
$port = 21;
$timeout = 3;

$fp = fsockopen('tls://'.$host, $port, $errno, $errstr, $timeout);
if ($fp) {
	echo "reading...\n";
	echo fread($fp, 2082);

        // do your ftp stuff

	fclose($fp);
}

See if that works for you.

I think I still have to compile with OpenSSL for that.

If you have compiled in OpenSSL support, you may prefix the hostname with either ssl:// or tls:// to use an SSL or TLS client connection over TCP/IP to connect to the remote host.

Says "did you forget to enable it when you configured PHP?"

Also, I dont think I can list files in a directory that way. Most I can do I think is open a specific file that I already know exists.

Thanks anyway. I just really need to figure out how to compile this thing.. I followed the directions on several sites, spot on and I still get that error. I even opened up a virtual machine with XP and tried it there.

I think I still have to compile with OpenSSL for that.


Says "did you forget to enable it when you configured PHP?"

Also, I dont think I can list files in a directory that way. Most I can do I think is open a specific file that I already know exists.

Thanks anyway. I just really need to figure out how to compile this thing.. I followed the directions on several sites, spot on and I still get that error. I even opened up a virtual machine with XP and tried it there.

You can just enabled the openssl extension dynamically and this will work. It does not need openssl built into php.

I just confirmed this by enabling and disabling openssl dynamically and restarting apache. It will give me the same error message you have when disabled, but work enabled.

You should be able to do everything you can with the FTP extension.

;extension=php_mysqli.dll
;extension=php_oci8.dll
extension=php_openssl.dll
;extension=php_pdo.dll
;extension=php_pdo_firebird.dll

There was a php.ini-recommended file, I renamed it into php.ini and uncommented the openssl extension... same error... Is there something else I have to do? I also added the enviornmental variable OPENSSL_CONF to the path of the openssl.cnf file in the php folder. No help.

PHP fatal error: Call to undefined function ftp_ssl_connect()

On another note, I was able to compile php5.3 using --with-openssl, but I get:

Warning: ftp_login(): SSL/TLS handshake failed.
Warning: ftp_login(): AUTH command OK. Initializing SSL connection.

It looks like ftp_ssl_connect worked, but then ftp_login did not....... Whats with this?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.