NYCPHP Meetup

NYPHP.org

[nycphp-talk] Use php to check for ssl/https support in apache

Nestor rotsen at gmail.com
Fri Jul 14 15:26:41 EDT 2006


ROb,

YOu can always try using Net_Ping::ping()
read about here:
http://pear.php.net/manual/en/html/package.networking.net-ping.ping.html
It is supposed to return "returns message of the ping command"

Here is an example code:

---------------------
<?php

require_once 'Net/Ping.php' ;

$ping = new Net_Ping;
$ping->setArgs(array("count" => 5,
                     "size"  => 32,
                     "ttl"   => 512
                    )
              );
var_dump($ping->ping("example.com"));

?>
----------------

Néstor :-)



On 7/14/06, Rob Marscher <rmarscher at beaffinitive.com> wrote:
>
> Yeah... that's pretty good.  It does rely on allow_url_fopen php.ini
> being turned on, I believe.  Maybe fopen(https://www.domain.com) would
> be slightly less overhead... the overhead isn't really a big deal though
> in this situation because it's only going to be used when writing a
> config file.  Any other ideas that don't require allow_url_fopen?
>
> Thanks a lot, Néstor.  :)
>
> -Rob
>
>
> Nestor wrote:
> > What would happen if you file(https://www.domain.com)?
> > You should get a FALSE if you were not able to read the file.
> >
> > Néstor :-)
> >
> > On 7/14/06, *Rob Marscher* <rmarscher at beaffinitive.com
> > <mailto:rmarscher at beaffinitive.com>> wrote:
> >
> >     Hi All,
> >
> >     I've done a bit of searching and haven't been able to find if
> there's a
> >     means that php running on apache can determine if apache supports
> >     ssl/https connections.  It would be nice my app to force an https
> >     connection on certain pages if it is available.  Otherwise I'll have
> to
> >     do it with a manual config switch.
> >
> >     Running apache_get_modules() and checking for mod_ssl seems like an
> >     option... but doesn't work on PHP 4.4.2 w/ Apache 1.3 which a lot of
> >     production servers still use.  Any other ideas?
> >
> >     Thanks a lot,
> >     Rob
> >     _______________________________________________
> >     New York PHP Community Talk Mailing List
> >     http://lists.nyphp.org/mailman/listinfo/talk
> >     New York PHP Conference and Expo 2006
> >     http://www.nyphpcon.com
> >     Show Your Participation in New York PHP
> >     http://www.nyphp.org/show_participation.php
> >
> >
> >
> > ------------------------------------------------------------------------
> >
> > _______________________________________________
> > New York PHP Community Talk Mailing List
> > http://lists.nyphp.org/mailman/listinfo/talk
> > New York PHP Conference and Expo 2006
> > http://www.nyphpcon.com
> > Show Your Participation in New York PHP
> > http://www.nyphp.org/show_participation.php
> _______________________________________________
> New York PHP Community Talk Mailing List
> http://lists.nyphp.org/mailman/listinfo/talk
> New York PHP Conference and Expo 2006
> http://www.nyphpcon.com
> Show Your Participation in New York PHP
> http://www.nyphp.org/show_participation.php
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.nyphp.org/pipermail/talk/attachments/20060714/744465d4/attachment.html>


More information about the talk mailing list