--- ext/openssl/openssl.c
+++ ext/openssl/openssl.c
@@ -4959,7 +4959,12 @@
 			RETURN_FALSE;
 		}
 	} else {
+#ifndef OPENSSL_NO_RC4
 		cipher = EVP_rc4();
+#else
+		php_error_docref(NULL TSRMLS_CC, E_WARNING, "RC4 support is not compiled into the OpenSSL library PHP is linked against, cipher method must be provided explicitly.");
+		RETURN_FALSE;
+#endif
 	}
 
 	pkeys = safe_emalloc(nkeys, sizeof(*pkeys), 0);
@@ -5087,7 +5092,12 @@
 			RETURN_FALSE;
 		}
 	} else {
+#ifndef OPENSSL_NO_RC4
 		cipher = EVP_rc4();
+#else
+		php_error_docref(NULL TSRMLS_CC, E_WARNING, "RC4 support is not compiled into the OpenSSL library PHP is linked against, cipher method must be provided explicitly.");
+		RETURN_FALSE;
+#endif
 	}
 	
 	buf = emalloc(data_len + 1);
