473,657 Members | 2,422 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Php (4.4) configured to open secure URLs (https)?

I use apache, Php and MySql on my Windows XP machine at home. I have
been doing so successfully now for a long time. However, I am now
trying to use fopen to open secure URLs (https) and having no luck. I
have installed openssl and enabled the extension (phpinfo says so,
too). But still it does not work.

I now realize that I need to have https and ftps as registered streams,
i.e.,
Registered PHP Streams php, http, ftp, https, ftps, compress.zlib
(from phpinfo at my hosting provider)

When I run phpinfo on my version of Php (which I just downloaded from
php.net) it says,
Registered PHP Streams php, http, ftp, compress.zlib

I've been reading forum posts saying to compile Php with
"--with-openssl in your ./configure
command."

Well, I do not compile Php from source (don't even have a C compiler).
I always download binaries (like php-4.4.0-Win32.zip that I downloaded
today from php.net).

How do I get a binary that was compiled with openssl in the configure
command? Or if I am misunderstandin g something here, what is is that I
need to do?

Thanks in Advance,

--
*************** **************
Chuck Anderson • Boulder, CO
http://www.CycleTourist.com
Integrity is obvious.
The lack of it is common.
*************** **************
Oct 11 '05 #1
4 2588
Chuck,
I've been reading forum posts saying to compile Php with
"--with-openssl in your ./configure
command."

Well, I do not compile Php from source (don't even have a C compiler).
I always download binaries (like php-4.4.0-Win32.zip that I downloaded
today from php.net).

How do I get a binary that was compiled with openssl in the configure
command? Or if I am misunderstandin g something here, what is is that I
need to do?


Within the extensions folder you should see a php_openssl.dll
Also you should go to the openssl folder and read the README-SSL.txt
file. That file tells you how to implement it correctly within a
windows environment (which sometimes includes setting environment variables)

--
Mike Willbanks
Zend Certified Engineer
http://www.digitalstruct.com
Oct 12 '05 #2
Mike Willbanks wrote:
Chuck,

I've been reading forum posts saying to compile Php with
"--with-openssl in your ./configure
command."

Well, I do not compile Php from source (don't even have a C compiler).
I always download binaries (like php-4.4.0-Win32.zip that I downloaded
today from php.net).

How do I get a binary that was compiled with openssl in the configure
command? Or if I am misunderstandin g something here, what is is that I
need to do?
Within the extensions folder you should see a php_openssl.dll

Yep. And I uncommented that line in php.ini. (extension=php_ openssl.dll)
Also you should go to the openssl folder and read the README-SSL.txt
file.
Thanks for the help. I don't see any such file, however ......

...... I installed a compiled binary .... Win32OpenSSL-v0.9.8.exe ....
.... that I got from the Shining Light Productions site (a link from
openssl.org).
http://www.slproweb.com/products/Win32OpenSSL.html

In the help file (.chm for Windows) it says that I can uninstall it if I
do not plan on developing any apps that incorporate the SSL library and
it will leave the needed dlls in the Windows/system folder.

I understand that from what I've done, SSL should be properly installed
(I can use openssl from the command line) , however, Php still does not
show https and ftps as registered streams and I can not use fopen on
secure URLs.
That file tells you how to implement it correctly within a
windows environment (which sometimes includes setting environment variables)

I have found nothing about setting environment variables. ?? Do I need
to do something more in php (php.ini) or in Apache httpd.conf?

--
*************** **************
Chuck Anderson • Boulder, CO
http://www.CycleTourist.com
Integrity is obvious.
The lack of it is common.
*************** **************
Oct 12 '05 #3
Chuck,
I have found nothing about setting environment variables. ?? Do I need
to do something more in php (php.ini) or in Apache httpd.conf?

This is what is contained in the readme-ssl.txt file (php4):

To use the CSR and key generation functions from PHP, you will need to
install
an openssl.cnf file. We have included a sample file that can be used
for this
purpose in this folder alongside this readme file.

The default path for the openssl.cnf file is determined as follows:

OPENSSL_CONF environmental variable, if set, is assumed to hold the
path to the file.

If it is not set, SSLEAY_CONF environmental variable is checked next.
If neither are set, PHP will look in the default certificate area that
was set
at the time that the SSL DLLs were compiled. This is typically
"C:\usr\local\s sl\openssl.cnf" .

If the default path is not suitable for your system, you can set the
OPENSSL_CONF variable; under windows 95 and 98 you can set this variable in
your autoexec.bat (or the batch file that starts your webserver/PHP).
Under NT, 2000 and XP you can set environmental variables using "My
Computer"
properties.

If setting an environmental var is not suitable, and you don't want to
install
the config file at the default location, you can override the default path
using code like this:

$configargs = array(
"config" => "path/to/openssl.cnf"
);

$pkey = openssl_pkey_ne w($config);
$csr = openssl_csr_new ($dn, $pkey, $config);

Please consult the online manual for more information about these functions.

NOTE!

Windows Explorer gives special meaning to files with a .cnf extension.
This typically means that editing the file from the explorer (by double or
right-clicking) will be difficult or impossible depending on your setup.
It is often easier to open the file from within the editor.
You can avoid this issue by naming the file something else (you might
need to
rename the file using a DOS box) and then setting up an environmental
variable
as described above.
--
Mike Willbanks
Zend Certified Engineer
http://www.digitalstruct.com
Oct 13 '05 #4
Thanks for getting back again, Mike.
Chuck,
have found nothing about setting environment variables. ?? Do I need
to do something more in php (php.ini) or in Apache httpd.conf?

This is what is contained in the readme-ssl.txt file (php4):

To use the CSR and key generation functions from PHP, you will need to
install an openssl.cnf file. We have included a sample file that can be used
for this purpose in this folder alongside this readme file.

The default path for the openssl.cnf file is determined as follows:

OPENSSL_CONF environmental variable, if set, is assumed to hold the
path to the file.

The compiled binary installer for openSSL did set this environment variable.

I'm really stumped here. I seem to have everything I need to get Php to
allow me to open https streams, but it is just not happening.

I downloaded and installed the latest Php4 for Windows from php.net and
it is working. If I call get_loaded_exte nsions, I see:

Array
(
[0] => standard
[1] => bcmath
[2] => calendar
[3] => ctype
[4] => com
[5] => ftp
[6] => mysql
[7] => odbc
[8] => overload
[9] => pcre
[10] => session
[11] => tokenizer
[12] => xml
[13] => wddx
[14] => zlib
[15] => apache
[16] => curl
[17] => gd
[18] => mhash
[19] => openssl
)

So the openssl extension is loaded.

The Windows environment variable OPENSSL_CONF is set to
C:\OpenSSL\bin\ openssl.cnf (and that is where I have installed OpenSSL.
The two necessary dll files are in my Windows/System32 folder
(libeay32.dll and ssleay32.dll).

And lastly - running php -m (show compiled in modules) from a command
prompt displays:

[PHP Modules]
bcmath
calendar
com
ctype
curl
ftp
gd
mhash
mysql
odbc
openssl
overload
pcre
session
standard
tokenizer
wddx
xml
zlib

So the openssl module is compiled in my copy of Php.

Still, when I do Phpinfo, I get:
Registered PHP Streams - php, http, ftp, compress.zlib

No https and no ftps.

I have run Php as CGI and as an Apache module and it makes no difference.

I can not find anything else to check (open_basedir is not set), so
....... I am stumped.

I can not get https and ftps to be registered streams and it appears
that I have done everything needed to do so. ??

--
*************** **************
Chuck Anderson • Boulder, CO
http://www.CycleTouris t.com
Integrity is obvious.
The lack of it is common.
*************** **************
Oct 13 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
3581
by: Generic Usenet Account | last post by:
I am trying to create a Java application that reads a list of URLs from a file and stores their contents on the local file system. I have succeeded in accessing normal websites, but I am unable to access the secured websites (using the HTTPS protocol) using this approach. I would greatly appreciate if someone could suggest a way out. I have looked at the HttpsURLConnection class, but unfortunately this class is abstract.
3
14034
by: Pooja Renukdas | last post by:
Hello, I have this web site where only two pages have to be secure pages and I need to call them using https, but since I have my development server and my production web server, I dont want to enter the absolute url like response.redirect("https://myProductionServer.com/SecurePage.aspx"), because when Im working in the development server I would have to change it back and forth everytime. Is there an easy way to do this without having...
7
1983
by: Brian Henry | last post by:
I created a project and it looks like everything is loading under HTTPS on all the pages perfectly except one page that it loads saying that the page contains both secure and non secure items... how would i check to see which items are loading that are insecure on IIS? the page is writen in ASP.NET, I know exactly which control is doing it (a custom writen one) but i cant seem to figure out what in the control is doing it... is there logs...
1
1246
by: Charles A. Lackman | last post by:
Hello, I have a web site that has a single page secured using SSL. This page also has Flash Macromedia header on it, Does this cause a conflict? When you visit the site it says, "This page contains both secure and nonsecure items. Do you wnat to display the nonsecure items?" If you click yes, there is no lock at the bottom right corner of the page, it you select no then there is a lock. Regardless of whether you click yes or no the...
2
1222
by: Ron Weldy | last post by:
In the past, I have always handled secure sections of websites using IIS. You put the files you want to transfer data securely in a folder and you indicate that in IIS. If you really need to force the url, then I have also encountered code that picks up the current domain or server and then concatenates the url accordingly. Now, I have this site that someone else set up and they have hard-coded the links with the https prefix to force...
7
2274
by: VB Programmer | last post by:
I created an ASP.NET website and recently got a secure certificate. Whenever I visit any of the pages IE says "This page contains both secure and nonsecure items. Do you want to display the nonsecure items?" What is considered secure and nonsecure? As the developer how can I create the pages so this message doesn't appear? Thanks!
0
1773
by: tmai | last post by:
How to bypass a SSL cerificate programmactially (automatically so a user does not need to know how to do it) when open a secure URL? For example when opening a secure URL, a SSL security certificate pops up. Here is my code: Dim strURL strURL = "https://..." Set oIE = CreateObject("InternetExplorer.Application") oIE.Visible = True
0
2335
by: amitvps | last post by:
Secure Socket Layer is very important and useful for any web application but it brings some problems too with itself. Handling navigation between secure and non-secure pages is one of the cumbersome jobs. When a non-secure page references a secure page with relative URL, the web server generates error until absolute URL with https prefix is used. On the other hand when a secure page references a non-secure page, the non-secure page will be...
3
1650
by: tshad | last post by:
I have a problem with a page I am trying to secure. It has a flash object as well as a couple of 3rd party objects used for tracking use of the page. I keep getting a message saying that there are unsecure items on the page. I assume this is because of some absolute URL paths. But one of them doesn't cause the problem and it also has an absolute URL in it. The first 2 cause an error:...
0
8411
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8323
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8739
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8513
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
5638
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4173
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2740
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1969
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1732
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.