php-windows Digest 18 Apr 2001 09:04:32 -0000 Issue 550

Topics (messages 6800 through 6814):

PDF_open_memory_image()
        6800 by: Christian Wenz
        6812 by: Rasmus Lerdorf

Excel COM
        6801 by: Conover, Ryan

Class Constructors And PHP on Win2K
        6802 by: Freedom
        6803 by: Frank M. Kromann
        6804 by: Plutarck

function email_robustly($recipient, $subject, $message, $headers, $smtp)
        6805 by: Dickerson, Monty

Re: [Apache/1.3.19 (Win32) PHP/4.0.5RC1] gd
        6806 by: Ignatius Teo

Re: Xitami Config
        6807 by: PHPWIN

HTML calling PHP; PHP returns result
        6808 by: Bob Sears
        6810 by: Frank M. Kromann

Can you please help me!
        6809 by: Manesh

Re: PHP4 won't display page
        6811 by: Warren Hemming

Re: Writing to Mapped Drive : Permission Denied
        6813 by: Joćo Antunes

Re: mssql and php4
        6814 by: Kelvin Luck

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]


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


Hello there,

just before I file this as a bug: Can someone reproduce that calling
PDF_open_memory_image w/ PHP 4.0.4pl1 always results in "call to
undefined function"? I have GD and PDF library loaded, and other GD and
PDF functions work just fine.

Regards
Christian






That function was not in PHP 4.0.4pl1.  You need a recent build.

-Rasmus

On Tue, 17 Apr 2001, Christian Wenz wrote:

> Hello there,
>
> just before I file this as a bug: Can someone reproduce that calling
> PDF_open_memory_image w/ PHP 4.0.4pl1 always results in "call to
> undefined function"? I have GD and PDF library loaded, and other GD and
> PDF functions work just fine.
>
> Regards
> Christian
>
>
>
> --
> 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 trying to use the excel Com on a win2k/IIS5/php4.0.4pl1 with Office 2K
SR-1.  I keep getting the following error.

Warning: Unable to obtain IDispatch interface for CLSID
{00020820-0000-0000-C000-000000000046}: Not enough storage is available to
complete this operation. in c:\Inetpub\wwwroot/ComTest2.php on line 3

Anyone know how to rectify this.

Ryan Conover





I've a bad headache here.

I have a some class Foo with constructor Foo like this:

class Foo {

    var $classVariable;

    function Foo ( $var1 ) {
        $this->classVariable = $var1;
    }

and furthermore i have a class call like this:

$objFoo = new Foo ( $anotherVariable );

i think this is a perfectly legal piece of code, and it works just fine on
FreeBSD/Apache/PHP 4.0.4pl1

but on Win2K Server and IIS5 with PHP 4.0.4pl1 running as CGI, this code
makes php.exe crash.
windows says that that the referenced memory could not be "written".

what's this all about? in classes without any contructors i do not get any
errors. Does the windows PHP have some imcompability with class
constructors?!?

please help and thanks in advance.






Just tested your code

<?php

class Foo {

        var $classVariable;

        function Foo ( $var1 ) {
        $this->classVariable = $var1;
        }
}

$anotherVariable = 5;

$objFoo = new Foo ( $anotherVariable );


?>


This works fine on my W2K box. There should be no problems uses classes and this way 
on any Windows platform. I'm using php4.0.5-dev though. Not sure if that can have 
anything to do with your errors.

- Frank

> I've a bad headache here.
> 
> I have a some class Foo with constructor Foo like this:
> 
> class Foo {
> 
>     var $classVariable;
> 
>     function Foo ( $var1 ) {
>         $this->classVariable = $var1;
>     }
> 
> and furthermore i have a class call like this:
> 
> $objFoo = new Foo ( $anotherVariable );
> 
> i think this is a perfectly legal piece of code, and it works just fine on
> FreeBSD/Apache/PHP 4.0.4pl1
> 
> but on Win2K Server and IIS5 with PHP 4.0.4pl1 running as CGI, this code
> makes php.exe crash.
> windows says that that the referenced memory could not be "written".
> 
> what's this all about? in classes without any contructors i do not get any
> errors. Does the windows PHP have some imcompability with class
> constructors?!?
> 
> please help and thanks in advance.
> 
> 
> 
> -- 
> 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]
> 
> 
> 







The code also works fine on my Win98 box with PHP 4.0.4pl1.

Not sure why your code isn't working...maybe you just got a wacky install?


--
Plutarck
Should be working on something...
...but forgot what it was.


""Frank M. Kromann"" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Just tested your code
>
> <?php
>
> class Foo {
>
> var $classVariable;
>
> function Foo ( $var1 ) {
> $this->classVariable = $var1;
> }
> }
>
> $anotherVariable = 5;
>
> $objFoo = new Foo ( $anotherVariable );
>
>
> ?>
>
>
> This works fine on my W2K box. There should be no problems uses classes
and this way on any Windows platform. I'm using php4.0.5-dev though. Not
sure if that can have anything to do with your errors.
>
> - Frank
>
> > I've a bad headache here.
> >
> > I have a some class Foo with constructor Foo like this:
> >
> > class Foo {
> >
> >     var $classVariable;
> >
> >     function Foo ( $var1 ) {
> >         $this->classVariable = $var1;
> >     }
> >
> > and furthermore i have a class call like this:
> >
> > $objFoo = new Foo ( $anotherVariable );
> >
> > i think this is a perfectly legal piece of code, and it works just fine
on
> > FreeBSD/Apache/PHP 4.0.4pl1
> >
> > but on Win2K Server and IIS5 with PHP 4.0.4pl1 running as CGI, this code
> > makes php.exe crash.
> > windows says that that the referenced memory could not be "written".
> >
> > what's this all about? in classes without any contructors i do not get
any
> > errors. Does the windows PHP have some imcompability with class
> > constructors?!?
> >
> > please help and thanks in advance.
> >
> >
> >
> > --
> > 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]
>






function email_robustly($recipient, $subject, $message, $headers, $smtp)
{
    $er = error_reporting(E_ERROR);
    $success = mail($recipient, $subject, $message, $headers);
    $current_smtp = reset($smtp);
    while (!$success && $current_smtp)
    {
        ini_set('SMTP',$current_smtp);
        $success = mail($recipient, $subject, $message, $headers);
        $current_smtp = next($smtp);
    }
    error_reporting($er);   //restore the error reporting to what it was
    ini_restore('SMTP');    //restore the original php.ini value of the SMTP
    return $success;
}

Hey, do you see anything wrong with this function I use to wrap the mail()
function to provide smtp failover?  Particularly, would it be thread-safe in
an ISAPI or Apache Module environment?  
It works for me; let me know if it works for you, too!

Copyright (C) 2001 Monty Dickerson

This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the Free
Software Foundation; either version 2 of the License, or (at your option)
any later version. This program is distributed in the hope that it will be
useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General
Public License for more details. You should have received a copy of the GNU
General Public License along with this program; if not, write to the Free
Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA.





Try specifying the full path to the font file...

Ignatius

Project Manager, Internet Accounting
Snail: Information Technology Directorate
       Southern Cross University
       PO Box 157, Lismore NSW 2480
Voice: +61 2 6620-3221 
Fax  : +61 2 6620-3033
Email:[EMAIL PROTECTED]



> -----Original Message-----
> From: Christian Ribeaud [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, 17 April 2001 18:18
> To: [EMAIL PROTECTED]
> Subject: [PHP-WIN] [Apache/1.3.19 (Win32) PHP/4.0.5RC1] gd
> 
> 
> Hi,
> 
> I downloaded and installed the php package including a lot of 
> extensions
> like pdf and gd from www.mm4.de.
> I read the following article
> (http://www.phpbuilder.com/columns/rasmus19990124.php3) and tried the
> code (s. below). It did not work. I get an empty gif image 
> and I do not
> understand what I have missed. I did the following:
> - I copy all extensions in the c:\winnt\system32 directory
> - I modified the php.ini file and only set following extensions:
> php_gd_gif.dll (without php_gd.dll because I got error 
> messages telling
> that some functions was twice loaded), php_pdf.dll (for pdf, works
> wunderfull)
> - I put ARIAL.TTF in a web subdirectory: fonts
> I would be very grateful if someone could help me.
> 
> christian
> ------------------------------ code -------------------------------
> Header("Content-type: image/gif");
> $font = "fonts/ARIAL.TTF";
> echo imageloadfont($font);
> if(!isset($s)) $s=11;
> $size = imagettfbbox($s,0,"$font",$text);
> $dx = abs($size[2]-$size[0]);
> $dy = abs($size[5]-$size[3]);
> $xpad=9;
> $ypad=9;
> $im = imagecreate($dx+$xpad,$dy+$ypad);
> $blue = ImageColorAllocate($im, 0x2c,0x6D,0xAF);
> $black = ImageColorAllocate($im, 0,0,0);
> $white = ImageColorAllocate($im, 255,255,255);
> ImageRectangle($im,0,0,$dx+$xpad-1,$dy+$ypad-1,$black);
> ImageRectangle($im,0,0,$dx+$xpad,$dy+$ypad,$white);
> ImageTTFText($im, $s, 0, (int)($xpad/2)+1, $dy+(int)($ypad/2), $black,
> "$font", $text);
> ImageTTFText($im, $s, 0, (int)($xpad/2), $dy+(int)($ypad/2)-1, $white,
> "$font", $text);
> ImageGif($im);
> ImageDestroy($im);
> ------------------------------ code -------------------------------
> 
> 
> -- 
> 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]
> 




C:\Inetpub\scripts\PHP

C:\Xitami

[Filter]
    .php=c:\Inetpub\scripts\Php\php.exe

[Filter]
    .php=c:\Inetpub\scripts\PHP\php.exe
    .ssi=perlssi                        #   Pass *.ssi to PerlSSI
    .shtm=perlssi                       #   Pass *.shtm to PerlSSI
    .shtml=perlssi                      #   Pass *.shtml to PerlSSI



----- Original Message -----
From: "Byrne, Gerald [euler:eti-lon]" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, April 18, 2001 12:36 AM
Subject: RE: [PHP-WIN] Xitami Config


> Could you answer me some questions:
>
> what folder is PHP.exe installed in?
> What folder is xitami installed in?
> How does the [filter] section in default.cfg read?
> How does the [filter] section in xitami.cfg read?
>
> I'm the problem should be discernable from these questions.
>
>   Ged.
>
>
> > -----Original Message-----
> > From: PHPWIN [SMTP:[EMAIL PROTECTED]]
> > Sent: Tuesday, April 17, 2001 9:36 AM
> > To: [EMAIL PROTECTED]
> > Subject: Fw: [PHP-WIN] Xitami Config
> >
> >
> >
> > > CHeers guys , Idone that already but it doesn't seem to work, I use
some
> > > othe directory and php4, it couldn't be the reason? I've got php
running
> > on
> > > other servers, just want to  see how easy is easy...
> > >
> > >It hasn't got anything to do with changing the way scripts are called
now
> > > issit?
> > >
> > >
> > > ----- Original Message -----
> > > From: "Byrne, Gerald [euler:eti-lon]" <[EMAIL PROTECTED]>
> > > To: <[EMAIL PROTECTED]>
> > > Sent: Tuesday, April 17, 2001 9:32 PM
> > > Subject: RE: [PHP-WIN] Xitami Config
> > >
> > >
> > > > Sean,
> > > >
> > > > This is nice and easy.  Here's the instructions copied from the
Xitami
> > > FAQ.
> > > >
> > > > 20: How do I add support for PHP3?
> > > > To install PHP3 support, add an entry to the [Filter] section of the
> > > config
> > > > files, e.g.
> > > > [Filter]
> > > >   .php=c:\php3\php3.exe
> > > >
> > > >
> > > > The config file is defaults.cfg found in your Xitami folder (eg.
> > > > C:Xitami\defaults.cfg).
> > > >
> > > > Further info can be found in the xitam.cfg folder.
> > > >
> > > > So much easier than Micorsot PWS.
> > > >
> > > >   Ged.
> > > >
> > > > > -----Original Message-----
> > > > > From: Sean [SMTP:[EMAIL PROTECTED]]
> > > > > Sent: Tuesday, April 17, 2001 6:32 AM
> > > > > To: [EMAIL PROTECTED]
> > > > > Subject: [PHP-WIN] Xitami Config
> > > > >
> > > > > Hiya
> > > > >    anyone know how to configure php with Xitami on win98?
> > > > > Cheers
> > > >
> > >
> >
> > --
> > 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]
>
>




I'm developing a reusable PHP hit counter. Is the following the correct way 
to accomplish this function?


This HTML module is in one directory ...

<html>
<body>
You are the

<? ../cgi-bin/counter.php?$App="xxx"?$Trailer="X"; ?>

visitor.

</body>
</html>

All the above does is calls counter.php with the application's name and 
whether a trailer is desired. It is supposed to
return "1st", "2nd", "3rd", "4th" ..... etc. to be displayed within the 
"You are ...." string.

This PHP module resides in cgi-bin ...

<?
//  I am counter.php

do the file I/O stuff using $App and $Trailer

return $theresult

?>

All the above does is reads the application's hit counter file (creates one 
if not found) and sends the text back to the
calling HTML module.







In the first script you are trying to call another script. I would jus include the 
counter script at that place and have the counter script output the code needed or 
have a function in the included script return the output you need.

it would look like this:

<html>
<body>
<?php
include "counter.php";
echo "You are the " . counter_func("XXX", "X") . " visitor";
?>
</body>
</html>


counter.php would look like this:

<?php
function counter_func($App, $Trailer="")
{
  // Do the counting stuff
  return $theresult;
}
?>

In this function the $Trailer is made optional with a default value of an empty string.

- Frank

> I'm developing a reusable PHP hit counter. Is the following the correct way 
> to accomplish this function?
> 
> 
> This HTML module is in one directory ...
> 
> <html>
> <body>
> You are the
> 
> <? ../cgi-bin/counter.php?$App="xxx"?$Trailer="X"; ?>
> 
> visitor.
> 
> </body>
> </html>
> 
> All the above does is calls counter.php with the application's name and 
> whether a trailer is desired. It is supposed to
> return "1st", "2nd", "3rd", "4th" ..... etc. to be displayed within the 
> "You are ...." string.
> 
> This PHP module resides in cgi-bin ...
> 
> <?
> //  I am counter.php
> 
> do the file I/O stuff using $App and $Trailer
> 
> return $theresult
> 
> ?>
> 
> All the above does is reads the application's hit counter file (creates one 
> if not found) and sends the text back to the
> calling HTML module.
> 
> 
> 
> 







OK.. i have win2k and i have some tutorials can you tell me exactly what to
do? i have frontpages 2k  PLEASE PLEASE PLEASE





I have tried everything listed below.  Any more Ideas.....
  -----Original Message-----
  From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
  Sent: Sunday, April 15, 2001 8:57 PM
  To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
  Subject: Re: [PHP-WIN] PHP4 won't display page


  Ok, first as mentioned on another email, change your
  AddType application/x-httpd-php .phtml .phps
  to:
  AddType application/x-httpd-php .phtml .php
  also, try putting your php scripts in your script alias, in your case
  c:\php4 and call them by using yourdomain/php4/scriptname
  hope this helps

  ~Jeff


  I have installed apache and PhP4 on a win 2000 machine.  The apache server
  will start up saying that PHP is running.  I have created a test page in
the
  htdocs folder with the extention .php and saved as an ANSI endcoding. When
I
  view the apache server everything looks good, but when I put the test page
  onto the URL all I see is the PHP code I wrote.  Anyone have any
suggestions
  on how to fix this?

  The httpd.conf file is correct.  I have loaded this module  LoadModule
  php4_module c:/php4/sapi/php4apache.dll, and have the correct addtypes in
  place.  The php.ini file is in the WINNT folder, and the php4ts.dll  is in
  the system32 folder.  I have tried all the help docs and have tried all
the
  books I could find.

  This all the editing I did to the httpd.conf file:

     LoadModule php4_module c:/php4/sapi/php4apache.dll

     ScriptAlias /cgi-bin/ "C:/Program Files/Apache Group/Apache/cgi-bin/"
     ScriptAlias /php4/ "C:/php4/"

     AddType application/x-httpd-php .phtml .phps
     AddType application/x-httpd-php-source .phps
     Action application/x-httpd-php /php4/php.exe

  Can anyone tell my why the page is not loading correctly?







Paul,

Your problem is related to the permissions of the IIS service, which is
supposed to run with user IUSR_*** (don't remember the exact name) on
NT/2000.
When PHP tries to access a resource it must be accessible to this account.
You have to check permissions on the network drive for this user. Also, I
suppose that it is a local user to the system on which IIS runs.

Hope it helps.

Joao Santos Antunes

----- Original Message -----
From: "Paul Wieland" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, April 16, 2001 3:03 PM
Subject: [PHP-WIN] Writing to Mapped Drive : Permission Denied


> Warning: fopen("U:\filename.txt","w+") - Permission denied in D:
> \wwwroot\somepath\more\thescript.php
>
> I'm having this terrible problem writing a file to a drive that is mapped
> by the server. I'm not even sure its a PHP problem, but my perl scripts
> don't seem to have any trouble with it.
> IIS 5, PHP 4, Win2k
> The script runs under a virtual directory that has NT Authentication
> checked, Anonymous Access unchecked [so the REMOTE_USER server variable is
> available to the php scripts]. The drive is mapped to a folder on another
> server that gives Guest and Everyone "Full Control". If you run the script
> from the server [from the servers web browser], it works perfectly. The
> server is logged in as Domain Admin, but no matter how I try to access the
> script from a workstation - even as Domain Admin, I still get an error.  I
> am able to write files to the mapped directory from a workstation using
> explorer.  When Anonymous Access is on, it works fine but I am unable to
> use the REMOTE_USER variable.
>
> Is there a way to write files to a mapped directory with "Anonymous
Access"
> turned off?
>
> Thanks in advance,
> -Paul Wieland
>
>
> --
> 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]
>
>





Thanks for the responses. I am already connecting to my database through
TCP/IP (it was set as default in the client network utility). I was just
providing the IP address of the database server to the mssql_pconnect
function. I just experimented with adding an alias in the client network
utility and providing this to mssql_pconnect but that didn't make it any
faster...
I guess if I am just using IP addresses then DNS couldn't be an issue
either?
PHP is running on my 550Mhz PIII with 256MB RAM. This should be fast enough
I guess - for testing at least. But it is taking around 6 seconds for a
database driven page to appear - this is definitely slower than it should be
isn't it? I've just started using PHP because I thought it was better and
faster than cold fusion but the same page written in cold fusion is
considerably faster which makes me think that I must just have PHP somehow
set up wrong...
Any other ideas?
Thanks,
Kelvin.


-----Original Message-----
From: Frank M. Kromann [mailto:[EMAIL PROTECTED]]
Sent: 18 April 2001 06:41
To: Tomasz Abramowicz
Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: Re: [PHP-WIN] mssql and php4


MSSQL is actually as fast (or faster) as mysql on the same hardware, but I
guess you can compare the two and get the results you want. On the other
hand that is not the issue !

When you are configuring MSSQL systems with server and client on two
different computers you should consider using TCP/IP as the communication
protocol. You do this by selecting TCP/IP as the default protocol in the
"Client Network Utility" or by adding a new client configuration using
TCP/IP in the same tool.

Another performence problem could also be DNS. You could configure the sytem
to use a fixed IP address (you do that in "Client Network Utility" too)

- Frank

> hihi, mssql = sux
> check out www.mysql.com
> (or you maybe a really big bubu in your DB structure)
>
>



Reply via email to