php-windows Digest 4 Jan 2002 19:02:58 -0000 Issue 936
Topics (messages 11292 through 11301):
Re: Performance tuning #2
11292 by: Peter Illes
11293 by: Peter Illes
setLocale() function
11294 by: RoelS
11298 by: Olivier Mascia
COM adn PHP4
11295 by: stéphane BOUCHONNET
Re: Can NOT get PHP 4.1.0 to run a Windows 2000/Apache 1.3.22<--HELP!!!
11296 by: ~fanta~
11297 by: Mark
11300 by: ~fanta~
NEWBIE IN DISTRESS: Install Instructions are not work for PHP 4.1.1!!!
11299 by: Mark
Newbie Question: Creating database
11301 by: Jack Cazes
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]
----------------------------------------------------------------------
--- Begin Message ---
Alain, thanks for the link.
Peter
-----Original Message-----
From: alain samoun [mailto:[EMAIL PROTECTED]]
Sent: Monday, December 31, 2001 6:56 PM
To: Peter Illes; [EMAIL PROTECTED]
Subject: RE: [PHP-WIN] Re: Performance tuning #2
No faq, but an archive at:
http://marc.theaimsgroup.com/?l=php-windows&r=1&w=2
A+
Alain
-----Original Message-----
From: Peter Illes [mailto:[EMAIL PROTECTED]]
Sent: Monday, December 31, 2001 8:42 AM
To: [EMAIL PROTECTED]
Subject: [PHP-WIN] Re: Performance tuning #2
Thanks, Manuel, those are both very good ideas that we will make use of.
My original problem is simpler than that, though: I'd like to pre-allocate a
buffer for the string. Is this possible in PHP?
This is possible in both C/C++ and Delphi (with SetLength() in Delphi). The
reason for this to have let's say 4-5 re-allocations instead of ~10,000+
re-allocations.
Of course we could get into the source of PHP to add the functionality (or
alternatively, roll our own cache object), but this is a very basic feature,
and I'm sure it does have it, I'm just too unlucky not finding out how...
Happy New Year,
Peter
--
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]
--- End Message ---
--- Begin Message ---
Dear Alek,
Thanks for the tips. The implode one seems to work pretty well, on a
synthetic test it is ~4-5 times faster than .= The substr_replace() seems to
be much worse than the original .=, I suppose because of returninng the
whole string in each call; the result should be much better with a
var-parameter version...
Thanks again, Peter
-----Original Message-----
From: Alek Andreev [mailto:[EMAIL PROTECTED]]
Sent: Monday, December 31, 2001 2:35 PM
To: Peter Illes
Subject: Re: [PHP-WIN] Re: Performance tuning #2
There are two ways to do that:
Method 1: Add each new part of the result to an array and when it's done,
implode() the array to get the resulting string.
Example: (get_data is your custom function)
while($data = get_data()) {
$resultA[] = $data;
}
$result = implode($resultA,'');
Method 2: Create an empty string ( $buffer = str_pad('',1024); ) and replace
parts of it with {$data = get_data(); $buffer =
substr_replace($buffer,$data,$i,$i+strlen($data)); $i += strlen($data);}.
This is not going to be pretty quickly unless PHP optimizes it, but it's
worth a try because in the best case, it can be reduced down to a single
memcpy(); If you had a function like substr_replace() that updated the
parameter, instead of returning the new string, it would surely work.
--
Regards,
Alek Andreev
[EMAIL PROTECTED]
----- Original Message -----
From: "Peter Illes" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, December 30, 2001 5:01 PM
Subject: [PHP-WIN] Re: Performance tuning #2
> Some more details:
>
> We are implementing a Web Services server (essentially SOAP server) in PHP
> and one of the calls has to return a data packet as XML so we want to
> accumulate the response in a string variable and then return it
(optionally
> logginig it for security reasons).
>
> We would like to avoid using external files for the accumulation, since we
> need some good performance and typically disk v.s. memory cannot compete
> (the server has enough RAM;-).
>
> "Peter Illes" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > Hi,
> >
> > This is the second post of this problem since I did not get any answer
for
> > the first. Please, could someone out there help? Thanks in advance...
> >
> > I wonder if there is any performance tuning newsgroup/faq/whatever
related
> > to PHP. I searchead to no avail...
> >
> > Anyway, my current mind boggler is: we are accumulating a large (~400k)
> XML
> > response in a string before sending it out by adding little pieces a
time
> > (like 10-20 chars). Now this results in very bad performance -- most
> > probably due to the fact that the string is enlarged/re-allocated
> thousands
> > of times. I would love to pre-allocate a big buffer for the string so
that
> > performance gets better (something like SetLength() in Delphi). How can
I
> do
> > this?
> >
> > Xuse me if the answer is much too trivial, I'm a newbie in PHPland :-)
> >
> > Thanks for any suggestion,
> >
> > Peter
> >
> >
> >
> >
>
>
>
> --
> 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]
>
>
>
--- End Message ---
--- Begin Message ---
Hello,
could someone tell me if it's possible to change the locale on the system.
I'm working with :
* WinNT 4.0 Server
* Apache 1.3.19
* PHP 4.1.1
I tried the following code (which is from the manual):
setlocale ("LC_TIME", "C");
print (strftime ("%A in Finnish is "));
setlocale ("LC_TIME", "fi_FI");
print (strftime ("%A, in French "));
setlocale ("LC_TIME", "fr_FR");
print (strftime ("%A and in German "));
setlocale ("LC_TIME", "de_DE");
print (strftime ("%A.\n"));
all %A are in the same language.
do i have to configure something ?
Greetz,
RoelS
--- End Message ---
--- Begin Message ---
Hello,
RoelS wrote:
R> could someone tell me if it's possible to change the locale on the system.
R> I tried the following code (which is from the manual):
R>
R> setlocale ("LC_TIME", "C");
R> print (strftime ("%A in Finnish is "));
R> setlocale ("LC_TIME", "fi_FI");
R> print (strftime ("%A, in French "));
R> setlocale ("LC_TIME", "fr_FR");
R> print (strftime ("%A and in German "));
R> setlocale ("LC_TIME", "de_DE");
R> print (strftime ("%A.\n"));
R>
R> all %A are in the same language.
<? setlocale(LC_TIME, "fr"); echo strftime("%H heures %M, le %d %B %Y") ?>
Works ok for me.
Note : setlocale(LC_TIME, ...) and not setlocale("LC_TIME", ...)
--
Olivier Mascia <[EMAIL PROTECTED]>
--- End Message ---
--- Begin Message ---
Hello,
I'm a frenchman, and i try to use COM functions in
WORD with no sucess.
here is a part of my code where i try to simply put a
bold font at true in
order to make a beautiful document, but i can't.
Perhaps do you know a good site or document on this
,or
giving me teh good syntax.
best regards.
My configuration : windows 98
PHP4.0.6.
Apache 1.3.22
Mysql
script :
$word = new COM("word.application") or die
("Impossibilité d'instancier Word");
# Rendre visible la fenêtre Word
$word->Visible = 1;
# Ouvrir un nouveau document
$word->Documents->Add();
$word->Selection->TypeText("Document en cours de
développement....");
$word->Selection->TypeParagraph();
$word->Selection->TypeParagraph();
$ret=com_propset($word,Selection.Font.bold,True);
$word->Selection->Font->bold("$ret");
$word->Selection->TypeText("$coll[1] $coll[0]");
$word->Selection->TypeParagraph();
$word->Selection->TypeParagraph();
$word->Selection->TypeText("né le : $naissance");
$word->Selection->TypeParagraph();
$word->Selection->TypeText("Fonction :
$fonc[0]");
$word->Selection->TypeParagraph();
$word->Selection->TypeText("Nationalité :
$nat[0]");
$word->Selection->TypeParagraph();
$word->Selection->TypeText("CLIENTS");
$word->Selection->TypeParagraph();
$word->Selection->TypeText("$coll[12]");
# Sauvegarder le document
$word->Documents[1]->SaveAs("CV $coll[1]
$coll[0]");
//Libération des ressources
$word = null;
unset($word);
=====
@+Stéphane
___________________________________________________________
Do You Yahoo!? -- Une adresse @yahoo.fr gratuite et en français !
Yahoo! Courrier : http://courrier.yahoo.fr
--- End Message ---
--- Begin Message ---
Have you enable the php function in the apache configuration(httpd.conf)?
--
"Mark" <[EMAIL PROTECTED]> ¼¶¼g©ó¶l¥ó
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> I am fairly new to PHP and just finished setting up Apache 1.3.22 and PHP
> 4.1.0 and can not get it to run correclty. I first tried loading by
module,
> but after trying that, apache would not load. I then tried the CGI
binary
> mode and was able to get apache loaded correctly, but when I try and load
a
> *.php file all I get is a blank browser window or it just opens and
displays
> the contents of the file. I also tried running the the file at the DOS
> prompt using c:\PHP php.exe filename.php and all I get is PHP.exe showing
> the contents of the file. Is that correct?? Am I missing something in
the
> PHP.ini file?? Do I need to make additional changes to my Apache config
> file?? Any input would be greatly appreciated. Thanks in advance.
>
> Mark
>
>
--- End Message ---
--- Begin Message ---
I added the following lines to my httpd.conf file:
ScriptAlias /php/ "c:/php/"
AddType application/x-httpd-php .php
Action application/x-httpd-php "/php/php.exe"
This is correct correct? <--LOL!!
Mark
"~Fanta~" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Have you enable the php function in the apache configuration(httpd.conf)?
>
> --
>
> "Mark" <[EMAIL PROTECTED]> ¼¶¼g©ó¶l¥ó
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > I am fairly new to PHP and just finished setting up Apache 1.3.22 and
PHP
> > 4.1.0 and can not get it to run correclty. I first tried loading by
> module,
> > but after trying that, apache would not load. I then tried the CGI
> binary
> > mode and was able to get apache loaded correctly, but when I try and
load
> a
> > *.php file all I get is a blank browser window or it just opens and
> displays
> > the contents of the file. I also tried running the the file at the DOS
> > prompt using c:\PHP php.exe filename.php and all I get is PHP.exe
showing
> > the contents of the file. Is that correct?? Am I missing something in
> the
> > PHP.ini file?? Do I need to make additional changes to my Apache config
> > file?? Any input would be greatly appreciated. Thanks in advance.
> >
> > Mark
> >
> >
>
>
--- End Message ---
--- Begin Message ---
It's correct. Did you try a page only with:
--start of file--
<?
phpinfo();
?>
--end of file--
maybe you php page have error because of the default setting of Debug mode
is off in PHP 4.1.0.
--- End Message ---
--- Begin Message ---
I apologize if the title of this post sounds overly aggresive, but I have
followed the instructions to a 'T' and got nowhere!! I have tried the
"auto" install version of PHP and manual instructions for installing PHP
4.1.1. Neither of them work. I added the lines to my httpd.conf file for
both types of installs (not at the same time) as discribed in the
Install.txt file, along with the instructions on the website, and can get no
"test" scripts to run or PHP for that matter. All I get is a blank screen
when running the CGI version or can not even get apache to load when I try
the Module version (Get a "Requested Operation Failed" message). can
someone please help????? My system is as follows:
Windows 2000 SP2
Apache 2.0.28 (I have also tried version 1.3.22 with same results as
mentioned above)
PHP 4.1.1
MDAC 2.7
MySQL 3.23.46a
Thanks in advance!!
Mark
--- End Message ---
--- Begin Message ---
I have windows 2000 server with PHP 4.1.0 and Mysql. I'm not quite sure how
PHP interelates with Mysql. Does PHP access Mysql directly? Or does it via
the Windows ODBC.
The reason why I am asking is because I have a user who wants a database
created and wants to know the credentials to access the database...so I then
used MyCC to create the database but there is no mention of username and
password.
Only if I create a FSN in the ODBC manager (by the way I loaded myodbc) does
it ask for username and password...is this correct?
Any help appreciated.
--- End Message ---