php-windows Digest 10 Aug 2001 04:26:49 -0000 Issue 694

Topics (messages 8731 through 8743):

Re: includes
        8731 by: Angie Tollerson

Re: Problem with session data on PHP4/Win2k
        8732 by: Scott Piccotti

Date / time things...
        8733 by: Ventsyslav Vassilev
        8735 by: Hugh Bothwell

UNC Names with PHP 4.06
        8734 by: Paul J. Smith

php COM discussion
        8736 by: Bob Kaehms
        8737 by: Angie Tollerson
        8739 by: Erik H. Mathy
        8742 by: Alain Samoun

MCAL DLL
        8738 by: Travis Wyatt
        8740 by: Erik H. Mathy
        8741 by: Travis Wyatt

Re: PHP installation with Windows 2000 Professional
        8743 by: Joseph Moore

Administrivia:

To subscribe to the digest, e-mail:
        [EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
        [EMAIL PROTECTED]

To post to the list, e-mail:
        [EMAIL PROTECTED]


----------------------------------------------------------------------


well...but that is using the full path, which obviously would work...by tacking on the 
base path on the front.  Maybe I'll just start making a practice to do that.  
Thanks!
Angie

>>> "Ignatius Teo" <[EMAIL PROTECTED]> 08/07/01 06:48PM >>>
What happens when you move stuff up or down a directory level?

I normally do this:

config.php
----------
define('BASE_DIR',getenv('DOCUMENT_ROOT').'/somedir/');

main.php
--------
include('config.php');
include(BASE_DIR.'phpfile.php');
include(BASE_DIR.'someother_dir/phpfile.php');

YMMV,

Ignatius

----- Original Message -----
From: "Angie Tollerson" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Wednesday, August 08, 2001 7:07 AM
Subject: Re: [PHP-WIN] includes


> I noticed that is necessary only on Apache...IIS you don't need it.  That
might have been why you didn't know if you are using windows and had been
developing using IIS before.  To add a new question to this thread:
> Has anyone else been able to get includes to work from the top of the web?
For some reason..if I want to move around directories (i'm using windows
2000 and 4.0.5) I have to do this:
> include("../../phpfile");
> when I want to do this:
> include("/admin/folder/phpfile");
>
> any ideas?
>
> Angie Tollerson
> Alliance Technologies
> Web Programmer
> (515)245-7628
> [EMAIL PROTECTED] 
>
> >>> "William E. T." <[EMAIL PROTECTED]> 08/07/01 01:52PM >>>
> THat works.  Thanks.  I was clueless as to why it wouldn't work.  Could
you
> explain why the ./ is necessary? I'm still a newbie, and I'm just curious
so
> that I don't repeat the same mistake in other areas.
> Thanks
> William
>
>
> Angie Tollerson wrote:
>
> > try include("./main.inc");
> >
> > >>> "William E. T." <[EMAIL PROTECTED]> 08/07/01 12:41PM >>>
> > I'm running apache on win98 as a test platform for a site, but whenever
> > I do includes it says it can't read the file.  I know the file is there,
> > as apache lists it in the director listing.
> > The exact error I get is
> > Warning: Failed opening 'main.inc' for inclusion (include_path='..') in
> > c:\program files\apache group\apache\htdocs\site\index.php on line 45
> >
> > The syntax I used to call the include is
> > include("main.inc");
> >
> > This worked on the  REAL server I'm using, so I was wondering why it
> > won't work locally.
> > Thanks
> > William
> >
> > --
> > PHP Windows Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: [EMAIL PROTECTED] 
> > For additional commands, e-mail: [EMAIL PROTECTED] 
> > To contact the list administrators, e-mail: [EMAIL PROTECTED] 
>
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED] 
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED] 
>
>
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED] 
> For additional commands, e-mail: [EMAIL PROTECTED] 
> To contact the list administrators, e-mail: [EMAIL PROTECTED] 
>







On Wednesday, August 8, 2001, at 12:05  PM, Antonio Romo wrote:
> I'm having a similar problem. I have PHP 4.0.6, IIS 4, NT 4, and Service
> Pack 6a. My sessions were working just fine until I installed SP 6a plus
> security patches for the stupid Code Red.

Aw, crap.

I didn't event think that might be a problem. Well, at least I know that 
the problem isn't limited to Win2K, since you're on NT4. This is the first 
time I've had to use sessions on this server, so I don't know if they would 
have worked before I applied the patch. Your evidence seems to suggest 
pretty strongly that that's the root of the problem, though. I'll take a 
look into exactly what that patch did and see if I can find the cause of 
this mess.

Many thanks for your post. Now I at least having a starting point for some 
meaningful investigation.

-Scott




Does anybody has an algorithm, which takes 2 different dates (in format
xxxx-xx-xx xx:xx:xx and date1<date2)
and returns the difference as:
"The requested period consists of X years, X months, X weeks, X days, X
hours, X minutes, X seconds"

For example: With date1='2001-08-09 00:00:00' date2='2001-08-10 01:02:03'
this code must return:
"The requested period consists of 0 years, 0 months, 0 weeks, 1 days, 1
hours, 2 minutes, 3 seconds"

Weeks, days, hours, minutes and seconds can be calculated easily, but months
and years?

Any suggestions are welcome.
10x in advance.

--
________________________________
Ventsyslav Vassilev
Comel Soft Multimedia
Sofia, Bulgaria
ICQ UIN: 11199819
e-mail: [EMAIL PROTECTED]
Visit http://www.comelsoft.com







"Ventsyslav Vassilev" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Does anybody has an algorithm, which takes 2 different dates (in format
> xxxx-xx-xx xx:xx:xx and date1<date2)
> and returns the difference as:
> "The requested period consists of X years, X months, X weeks, X days, X
> hours, X minutes, X seconds"
>
> For example: With date1='2001-08-09 00:00:00' date2='2001-08-10 01:02:03'
> this code must return:
> "The requested period consists of 0 years, 0 months, 0 weeks, 1 days, 1
> hours, 2 minutes, 3 seconds"
>
> Weeks, days, hours, minutes and seconds can be calculated easily, but
months
> and years?

How's this?

============== date.php ================
<?php

    function parse_date($str) {
        $t = array();

        sscanf($str, "%04d-%02d-%02d %02d:%02d:%02d",
            $t["year"], $t["month"], $t["day"], $t["hour"], $t["min"],
$t["sec"] );

        return $t;
    }


  function is_leapyear($year) {
   if ($year % 400 == 0)
    return true;

   if ($year % 100 == 0)
    return false;

   if ($year % 4 == 0)
    return true;

   return false;
  }

 // return b - a
    function sub_date($a, $b) {
        // assert: $b > $a

        $diff = array();

  // days per month
  $days[1] = 31;
  $days[2] = ( is_leapyear($b["year"]) ? 29 : 28 );
  $days[3] = 31;
  $days[4] = 30;
  $days[5] = 31;
  $days[6] = 30;
  $days[7] = 31;
  $days[8] = 31;
  $days[9] = 30;
  $days[10] = 31;
  $days[11] = 30;
  $days[12] = 31;

  // !allow for wrap!
  for ($i = 1; $i <= 12; $i++)
   $days[$i-12] = $days[$i];

  // do subtraction...
  $diff["sec"]   = $b["sec"]   - $a["sec"];
  $diff["min"]   = $b["min"]   - $a["min"];
  $diff["hour"]  = $b["hour"]  - $a["hour"];
  $diff["day"]   = $b["day"]   - $a["day"];
  $diff["month"] = $b["month"] - $a["month"];
  $diff["year"]  = $b["year"]  - $a["year"];

  // propagate carries
  if ($diff["sec"] < 0) {
   $diff["sec"] += 60;
   $diff["min"]--;
  }

  if ($diff["min"] < 0) {
   $diff["min"] += 60;
   $diff["hour"]--;
  }

  if ($diff["hour"] < 0) {
   $diff["hour"] += 24;
   $diff["day"]--;
  }

  if ($diff["day"] < 0) {
   $diff["day"] += $days[$b["month"]-1];
   $diff["month"]--;
  }

  if ($diff["month"] < 0) {
   $diff["month"] += 12;
   $diff["year"]--;
  }

  return $diff;
    }


 function print_date($t) {
  $str = sprintf("%04d-%02d-%02d %02d:%02d:%02d",
            $t["year"], $t["month"], $t["day"], $t["hour"], $t["min"],
$t["sec"] );
  return $str;
 }


 function alt_print_date($t) {
  return (
        $t["year"] . " years, "
       .$t["month"] . " months, "
       .$t["day"] . " days, "
       .$t["hour"] . " hours, "
       .$t["min"] . " minutes, "
       .$t["sec"] . " seconds."
  );
 }

?>
<html>
<head>
 <title>
 </title>
</head>
<body>
 <form method="post">
 <table>
  <tr>
   <td>First:</td>
   <td><input type='text' name='date1' value='<?php echo $date1; ?>'</td>
   <td><i>ex: 2001-08-09 00:00:00</i></td>
  </tr>
  <tr>
   <td>Second:</td>
   <td><input type='text' name='date2' value='<?php echo $date2; ?>'></td>
   <td><i>ex: 2001-08-10 01:02:03</i></td>
  </tr>
  <tr>
   <td><input type='reset'></td>
   <td><input type='submit'></td>
  </tr>
 </table>
 </form>

<?php
 if (isset($date1) and isset($date2)) {
  $d1 = parse_date($date1);
  $d2 = parse_date($date2);

  $diff = sub_date($d1, $d2);
  echo "<br>Difference is ".print_date($diff);
  echo "<br>Alternatively, ".alt_print_date($diff);
 }
?>
</body>
</html>
======================================






Hi,

I thought UNC names were supposed to be supported with this version of
PHP??

My web sites are hosted on a UNC share and neither the isapi filter or
the php.exe can use them.  If I type 'php.exe \\web sites\default.php'
at the prompt the script returns nothing at all.

Any idea how I can use UNC names with PHP/Windows2k ?

Many thanks,


Paul Smith




Can anyone recommend me to a good site that discusses
PHP COM integration.  I've seen a few random articles,
but most are pretty simple.  I've tried looking through
the archive of this list, but the archive at lists.php.net
isn't allowing for search at this time.

Thanks for any pointers.

-bob






Do you mean DOM ?  what the heck is COM?

>>> Bob Kaehms <[EMAIL PROTECTED]> 08/09/01 03:50PM >>>
Can anyone recommend me to a good site that discusses
PHP COM integration.  I've seen a few random articles,
but most are pretty simple.  I've tried looking through
the archive of this list, but the archive at lists.php.net
isn't allowing for search at this time.

Thanks for any pointers.

-bob



-- 
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED] 
For additional commands, e-mail: [EMAIL PROTECTED] 
To contact the list administrators, e-mail: [EMAIL PROTECTED] 






http://www.php.net/manual/en/ref.com.php

> -----Original Message-----
> From: Angie Tollerson [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, August 09, 2001 3:57 PM
> To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
> Subject: Re: [PHP-WIN] php COM discussion
> 
> 
> Do you mean DOM ?  what the heck is COM?
> 
> >>> Bob Kaehms <[EMAIL PROTECTED]> 08/09/01 03:50PM >>>
> Can anyone recommend me to a good site that discusses
> PHP COM integration.  I've seen a few random articles,
> but most are pretty simple.  I've tried looking through
> the archive of this list, but the archive at lists.php.net
> isn't allowing for search at this time.
> 
> Thanks for any pointers.
> 
> -bob
> 
> 
> 
> -- 
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED] 
> For additional commands, e-mail: [EMAIL PROTECTED] 
> To contact the list administrators, e-mail: [EMAIL PROTECTED] 
> 
> 
> 
> -- 
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
> 




Try MARC:
http://marc.theaimsgroup.com/?l=php-windows&r=1&w=2
Or ask questions here...
Alain

On Thu, Aug 09, 2001 at 01:50:15PM -0700, Bob Kaehms wrote:
> Can anyone recommend me to a good site that discusses
> PHP COM integration.  I've seen a few random articles,
> but most are pretty simple.  I've tried looking through
> the archive of this list, but the archive at lists.php.net
> isn't allowing for search at this time.
> 
> Thanks for any pointers.
> 
> -bob
> 
> 
> 
> -- 
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]




I am using PHP 4.0.6 + WinNT 4.0 + OmniHTTPd and wanted to use the MCAL
library but noticed that PHP has to be compiled --with-mcal.  If I am using
WinNT I should instead set MCAL as an extension in my PHP.INI file right?
But then where can I get the MCAL DLL file?

~ Thanks, Travis






Sorry, man...that's a *nix only library.

http://sourceforge.net/project/showfiles.php?group_id=482&release_id=3302

- Erik

> -----Original Message-----
> From: Travis Wyatt [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, August 09, 2001 3:58 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP-WIN] MCAL DLL
> 
> 
> I am using PHP 4.0.6 + WinNT 4.0 + OmniHTTPd and wanted to use the MCAL
> library but noticed that PHP has to be compiled --with-mcal.  If 
> I am using
> WinNT I should instead set MCAL as an extension in my PHP.INI file right?
> But then where can I get the MCAL DLL file?
> 
> ~ Thanks, Travis
> 
> 
> 
> -- 
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
> 




Is there any other way then to get the same functionality of MCAL in PHP on
an NT system?



Erik H. Mathy <[EMAIL PROTECTED]> wrote in message
003301c12114$f73a7330$1300020a@erik_laptop">news:003301c12114$f73a7330$1300020a@erik_laptop...
> Sorry, man...that's a *nix only library.
>
> http://sourceforge.net/project/showfiles.php?group_id=482&release_id=3302
>
> - Erik
>
> > -----Original Message-----
> > From: Travis Wyatt [mailto:[EMAIL PROTECTED]]
> > Sent: Thursday, August 09, 2001 3:58 PM
> > To: [EMAIL PROTECTED]
> > Subject: [PHP-WIN] MCAL DLL
> >
> >
> > I am using PHP 4.0.6 + WinNT 4.0 + OmniHTTPd and wanted to use the MCAL
> > library but noticed that PHP has to be compiled --with-mcal.  If
> > I am using
> > WinNT I should instead set MCAL as an extension in my PHP.INI file
right?
> > But then where can I get the MCAL DLL file?
> >
> > ~ Thanks, Travis
> >
> >
> >
> > --
> > PHP Windows Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > To contact the list administrators, e-mail: [EMAIL PROTECTED]
> >






On a standard 2000Pro install, when you add PWS, you can use the personal web manager 
to manage the web site. 
Unfortunately, PWM is a piece of garbage.
What you want to try is this:
Click start-->run
Start a blank MMC by typing in MMC. Click OK.
When open, click Console --> Add/Remove Snap-In
Make sure the drop-down says Local Console.
Click the Add button.
A list of all installed snap-ins comes up. Scroll through for Internet Information 
Services.
Click it once, then click Add. 
click Close.
Click Close to close the add snap-in window.
Now you can go to the properties of your web site, the home directory tab, 
configuration button to set up PHP. I did this on my own laptop. I have 2000Pro 
installed, with PWS installed. I set up PHP on it about 8 hours ago, so I know what 
you are having to do.

IF it works for you, when you are done, click Console-->Save As to save the MMC 
console as your own IIS management tool.

Hope this helps too.



That should do it
"Benjamin Sims" <[EMAIL PROTECTED]> wrote in message 
01c601c12018$90c10f80$205d020a@B442">news:01c601c12018$90c10f80$205d020a@B442...
> Thank you for your advice.
> I have successfully installed IIS from the Windows 2000 disk and can run it
> successfully so that other PCs on our network can see my home page. However,
> because I have Professional rather than normal I do not get the Internet
> Services Manager even with IIS installed in my Administrative Tools folder.
> I only have these icons:
> 
> Component Services, Computer Management, Data Sources, Event Viewer, Local
> Security Policy, Performance, Personal Web Manager, Server Extensions,
> Services, Telnet Server Administration.
> 
> I have looked at some Microsoft stuff which says that ISM is a snap-in for
> the MMC but I do not know where to get the snap-in itself.
> 
> Is there another way to access the properties?
> 
> 
> 
> ----- Original Message -----
> From: "Robert Trembath" <[EMAIL PROTECTED]>
> To: "Benjamin Sims" <[EMAIL PROTECTED]>
> Sent: Wednesday, August 08, 2001 3:20 PM
> Subject: Re: [PHP-WIN] PHP installation with Windows 2000 Professional
> 
> 
> > If your running Windows 2000, your running IIS 5.0 and it is not installed
> > by default. You have to add it on as a windows componet. If you did this,
> > you will find the IIS admin tool under the Administrative Tools folder in
> > the control panel. Right click on the machine and set up the .php
> extension
> > to map to the php.exe file in the "WWW Master Properties". If you want to
> > use mail() functions or extensions, make sure that you edit the php.ini
> and
> > give your web server account permissions to read and write to the sessions
> > folders.
> >
> > Hope this helps,
> > Robert
> >
> > ----- Original Message -----
> > From: "Benjamin Sims" <[EMAIL PROTECTED]>
> > To: <[EMAIL PROTECTED]>
> > Sent: Wednesday, August 08, 2001 7:43 AM
> > Subject: [PHP-WIN] PHP installation with Windows 2000 Professional
> >
> >
> > Could anyone please help me with this problem? I am trying to install PHP
> > and MySQL on my machine so that I can teach myself the language. I
> followed
> > the installation instructions for Windows 2000 using the automatic
> installer
> > and everything seemed to go fine. Until I got to the setting up of PHP
> > itself. The instructions say that I need to open the Internet Services
> > Manager in order to configure IIS4 to run PHP scripts. However, this
> manager
> > is not installed in Windows 2000 Pro. How can I convince my local server
> to
> > load the CGI binary as default so that when I test PHP it runs as normal?
> >
> > Thanks in advance...
> >
> >
> >
> >
> >
> 


Reply via email to