php-windows Digest 22 Jan 2001 19:42:07 -0000 Issue 409

Topics (messages 5131 through 5143):

Re: PHP4 / WinNT 4 / Oracle 7.3 via ODBC
        5131 by: Jean-Christophe Le Brun
        5137 by: Carlos Correa Goncalves

Re: session lifetime
        5132 by: DATURA

createing a php script with reloadable modules.
        5133 by: kill-9
        5140 by: phobo

IIS Filter
        5134 by: Ernest E Vogelsinger
        5135 by: Phil Driscoll
        5136 by: Ernest E Vogelsinger
        5139 by: Phil Driscoll

[PHP-Win2000 IIS5] File Uploading
        5138 by: NX Dev
        5141 by: phobo

No More Crashes!
        5142 by: Gonzalo Vera

fwrite is adding extra text, why? and where is it coming from????
        5143 by: Joey Garcia

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]


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


Hi Carlos,

I had the same problem with a configuration near yours.
PHP4.04
WinNT4
IIS4
Oracle client 8.0

I've used OCI fonctions, because they work with Oracle client 8.0 (my data
base is in Oracle 7.3.4.00 but it works well)

Here is my PHP code :

// You can find the connection string in the file tnsnames.ora, this is the
only solution i've find to connect to my distant database
$Connection="(DESCRIPTION = (ADDRESS = (PROTOCOL = ...)(HOST = ...)(PORT =
...))(CONNECT_DATA = (SID = ...)))";
// under Windows NT this file is under [Oracle
Client]\Net80\Admin\Tnsnames.ora

// This is a permanent connection
$Oracle=OCIPLogon(user, passowrd, $Connection);

// sample of query
$Requete=OCIParse($Oracle, "select ALTI from POSTE order by COMMUNE");

// the ALTI field is store in the $Alti variable
OCIDefineByName($Requete,"ALTI",&$Alti);

// execute the query
OCIExecute($Requete);

// read all the rows
while (OCIFetch($Requete))
{
     echo $Alti
}

Don't forget the line
extention=php_oci8.dll in your PHP.ini if you work under Windows NT, with
LINUX you must make your PHP with the OCI8 librairie i think...

Maybe you can try to yse $Connection with
Oracle = Oracle_Logon($User, $Password, $Connection);

I've tried to use odbc_connect (ODBC was ok), but it doesn't work, i don't
know why...

Good luck

Jean-Christophe Le Brun
Météo-France
CMIRNE/DET
03-88-40-42-46
[EMAIL PROTECTED]






Hi Jean-Christophe,

Thanks for your help!  I´ve tried your suggestion.  When I add
"extention=php_oci8.dll" to the php.ini and restart the www service, I get
the message:
------
PHP Warning: Unable to load dynamic library 'd:/php4/php_oci8.dll' - The
specified module could not be found. in Unknown on line 0 
----

The library is in the correct folder.  May it be a problem with version of
php_oci8.dll?  But it´s been unzipped from the same file as the php.exe
which is running.

Bye

> ----- Mensagem original -----
> De:           Jean-Christophe Le Brun
> [SMTP:[EMAIL PROTECTED]]
> Enviada em:           Segunda-feira, 22 de Janeiro de 2001 05:40
> Para:         Carlos Correa Goncalves; [EMAIL PROTECTED]
> Assunto:              Re: [PHP-WIN] PHP4 / WinNT 4 / Oracle 7.3 via ODBC
> 
> Hi Carlos,
> 
> I had the same problem with a configuration near yours.
> PHP4.04
> WinNT4
> IIS4
> Oracle client 8.0
> 
> I've used OCI fonctions, because they work with Oracle client 8.0 (my data
> base is in Oracle 7.3.4.00 but it works well)
> 
> Here is my PHP code :
> 
> // You can find the connection string in the file tnsnames.ora, this is
> the
> only solution i've find to connect to my distant database
> $Connection="(DESCRIPTION = (ADDRESS = (PROTOCOL = ...)(HOST = ...)(PORT =
> ...))(CONNECT_DATA = (SID = ...)))";
> // under Windows NT this file is under [Oracle
> Client]\Net80\Admin\Tnsnames.ora
> 
> // This is a permanent connection
> $Oracle=OCIPLogon(user, passowrd, $Connection);
> 
> // sample of query
> $Requete=OCIParse($Oracle, "select ALTI from POSTE order by COMMUNE");
> 
> // the ALTI field is store in the $Alti variable
> OCIDefineByName($Requete,"ALTI",&$Alti);
> 
> // execute the query
> OCIExecute($Requete);
> 
> // read all the rows
> while (OCIFetch($Requete))
> {
>      echo $Alti
> }
> 
> Don't forget the line
> extention=php_oci8.dll in your PHP.ini if you work under Windows NT, with
> LINUX you must make your PHP with the OCI8 librairie i think...
> 
> Maybe you can try to yse $Connection with
> Oracle = Oracle_Logon($User, $Password, $Connection);
> 
> I've tried to use odbc_connect (ODBC was ok), but it doesn't work, i don't
> know why...
> 
> Good luck
> 
> Jean-Christophe Le Brun
> Météo-France
> CMIRNE/DET
> 03-88-40-42-46
> [EMAIL PROTECTED]
> 




Never mind! I've found the reason for this erratic behaviour: It's inside
Windows 2000. Obviously Windows itself is deleting the content of its
TEMP-Directory from time to time... So my session files are not deleted by
the PHP garbage collection routine but from this %*&/ Windows.

Since the session.save_path is pointing to another directory outside C:\TEMP
the sessions are alive for more than 15 minutes.

Thanks anyway, Rolf.

""DATURA"" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
949cql$3oc$[EMAIL PROTECTED]">news:949cql$3oc$[EMAIL PROTECTED]...
> I have the following settings in PHP.INI:
> [Session]
> session.save_handler      = files
> session.save_path         = C:\temp
> session.use_cookies       = 1
> session.name              = PHPSESSID
> session.auto_start        = 1
> session.cookie_lifetime   = 0
> session.cookie_path       = /
> session.cookie_domain     =
> session.serialize_handler = php
> session.gc_probability    = 1
> session.gc_maxlifetime    = 86400   ; 24 hours
> session.referer_check     =
> session.entropy_length    = 0
> session.entropy_file      =
> ; session.entropy_length    = 16
> ; session.entropy_file      = /dev/urandom
> session.cache_limiter     = nocache
> session.cache_expire      = 180
> session.use_trans_sid     = 1
> url_rewriter.tags         =
> "a=href,area=href,frame=src,input=src,form=fakeentry"
>
> I'm using PHP under Windows 2000 with Apache 1.3.12.
>
> No matter what number is given in the line session.gc_maxlifetime the
> session file is deleted after 24 minutes (1440 sec.)
>
> Is 86400 a number too big or can someone tell me what there is to do, so I
> can make my own garbage collection?
>
> Thanks, Rolf.
>
>
>
>
> --
> 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]
>






Ok guys I need your help I'm banging my head against the wall on this one.

I need to do something like modules in a script. The main script runs 24/7 I want to 
be able to change the modules run time.  have some kind of flag set to have it 
update/reload the module.  I cant do something like an include with the modules 
because they wont be refreshed that and you cant re-included a function that has 
already been include once and include_once wont work either because that wont refresh 
the module.

here are my thoughts.

if I use system or pass thru to set off the modules.   but the question is I need to 
pass the module a file pointer.  and so far I have been unable to pass a file pointer 
to another script.

another option would be to use fopen to buffer the module and using exec to execute 
this new module.  I could reload the module by re reading the file.  would this work?

all comments ,opinions , ideas , and wild guesses are welcome.  I'm stuck and need 
some new ideas on how to do this.


thanks 

kill-9
www.kill-9.dk






My feeling ...

Your script wont be running for 24hours, so you can just edit the PHP file
directly, can't you? Make a copy of your main PHP file, make the changes you
need, and copy/overwrite the existing one. I assume the PHP engine doesn't
read the file a line at a time but instead caches the whole script, so you
wont have any problems of the php script failing because it was changes
'half way through'

Siggy

----- Original Message -----
From: "kill-9" <[EMAIL PROTECTED]>
To: "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
Sent: Monday, January 22, 2001 9:26 PM
Subject: [PHP-WIN] createing a php script with reloadable modules.


Ok guys I need your help I'm banging my head against the wall on this one.

I need to do something like modules in a script. The main script runs 24/7 I
want to be able to change the modules run time.  have some kind of flag set
to have it update/reload the module.  I cant do something like an include
with the modules because they wont be refreshed that and you cant
re-included a function that has already been include once and include_once
wont work either because that wont refresh the module.

here are my thoughts.

if I use system or pass thru to set off the modules.   but the question is I
need to pass the module a file pointer.  and so far I have been unable to
pass a file pointer to another script.

another option would be to use fopen to buffer the module and using exec to
execute this new module.  I could reload the module by re reading the file.
would this work?

all comments ,opinions , ideas , and wild guesses are welcome.  I'm stuck
and need some new ideas on how to do this.


thanks

kill-9
www.kill-9.dk








Hi,

I am wondering if anyone has a clue on how to get the php4isapi.dll filter
running. I am proceeding as instructed in install.txt

> 4. If you don't want to perform HTTP Authentication using PHP, you can (and
> should) skip this step. Under ISAPI Filters, add a new ISAPI filter.
> Use PHP as the filter name, and supply a path to the php4isapi.dll

but the filter always fails to load. The EventLog gives me an "Event ID
14", "The filter ... failed to load". The error data is 7B 00 00 00.

Any clues anyone?

Thanks,


     ...ebird

   >O     Ernest E. Vogelsinger
   (\)    http://www.1-at-web.at/
    ^     ICQ#   13394035





>but the filter always fails to load. The EventLog gives me an "Event ID
>14", "The filter ... failed to load". The error data is 7B 00 00 00.
Do you already have the php4isapi.dll mapped and working for .php scripts?
If not, it may just be that the dll can't start up because it is missing
some resource - e.g. the php4ts.dll, or any extensions you have specified in
your php.ini. You can often find the cause of the error by putting php.exe
in the same directory as your php4ts.dll and running it in a dos window -
you may see some useful error messages.

Cheers
--
Phil Driscoll
Dial Solutions
+44 (0)113 294 5112
http://www.dialsolutions.com
http://www.dtonline.org





At 11:55 22.01.2001, Phil Driscoll said:
--------------------[snip]--------------------
>>but the filter always fails to load. The EventLog gives me an "Event ID
>>14", "The filter ... failed to load". The error data is 7B 00 00 00.
>Do you already have the php4isapi.dll mapped and working for .php scripts?
>If not, it may just be that the dll can't start up because it is missing
>some resource - e.g. the php4ts.dll, or any extensions you have specified in
>your php.ini. You can often find the cause of the error by putting php.exe
>in the same directory as your php4ts.dll and running it in a dos window -
>you may see some useful error messages.
--------------------[snip]-------------------- 

I have only the CGI (php.exe) working, mapping .php to php4iis.dll results
in a "HTTP 500 / module not found" error...

After your thought with the necessary DLLs I copied the complete /Php4/dlls
directory to /Php4 and added E:\Php4 to the system path (in front), then I
restarted IIS (Admin and services). Well, something changed... :)

a) Inetinfo crashes "0xC0000001" when php4isapi.dll is specified as a filter
b) Inetinfo crashes "0xC0000001" when php4isapi.dll is mapped to the .php
extensions and these extensions are executed rapidly by a browser.

This is WinNT4 SP 6a, IIS4.0.

Thanks for any more info,

     ...ebird

   >O     Ernest E. Vogelsinger
   (\)    http://www.1-at-web.at/
    ^     ICQ#   13394035





>I have only the CGI (php.exe) working, mapping .php to php4iis.dll results
>in a "HTTP 500 / module not found" error...

If you are using IIS4, it may just not work for you - as it says in the
release notes, the ISAPI version of PHP is not up to production strength. I
can't get it to work reliably on my NT4/IIS4 machine - I can get it to load,
but not to work reliably, and get 500 server errors for most page requests.
If you are on W2K, then you might expect better results than you are
currently getting. I only use the CGI version on my NT machines.

People seem to have better experience using PHP as an Apache module on NT -
so if that is an option for you, you might like to give it a try. Better
yet, dump NT and go for Linux or BSD or similar.

Cheers
--
Phil Driscoll
Dial Solutions
+44 (0)113 294 5112
http://www.dialsolutions.com
http://www.dtonline.org





[ PHP-Win]
Server: Windows2000 IIS5
Issue: File Uploading using POST
I have it where the PHP Script knows all about using the _name/_size 
things.  My Problem is that i cannon get PHP to copy()/move() the file 
from the TMPDIR location to where i want it to be.

Bob





Please be more specific as to the reason why you cannot copy/move the file.
Is it because you don't know the functions to do so, is it because you have
access/permission violations? do you have a syntax error? is it a windows
specific problem ? or what?

Include your code and we can be of more assistance...

You might want to check these for more info:
http://www.php.net/manual/en/function.move-uploaded-file.php
http://www.php.net/manual/en/features.file-upload.php

Siggy


----- Original Message -----
From: "NX Dev" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, January 23, 2001 1:28 AM
Subject: [PHP-WIN] [PHP-Win2000 IIS5] File Uploading


> [ PHP-Win]
> Server: Windows2000 IIS5
> Issue: File Uploading using POST
> I have it where the PHP Script knows all about using the _name/_size
> things.  My Problem is that i cannon get PHP to copy()/move() the file
> from the TMPDIR location to where i want it to be.
>
> 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]
>
>





First, I want to thank all for helping me with lots of suggestions for
questions I posted ("Disabling ODBC", "Tracing crashes", "ODBC vs.
Straight MySQL", ...)in the last couple of months. Even if my problem was not
fully solved it was more due to my having an old platform nobody else
used, than lack of insight or experience on those who helped me: their
insight finally pointed on the right direction.

I would like to post, if it were of any use to somebody else, the
partial solution (still not 100%, but now it is a reproduceable bug)
to the problem I experienced (PHP crashing erratically, after serving
a perfect, complete script):

1. PHP (3 and 4) crashes erratically when using ODBC connections with
Access 95. The ODBC32.DLL from 1995 that comes with it is buggy, so it
sometimes crashes without "declaring itself" as the offender. Not even
the ODBC log reports any error.

2. Upon installing and de-installing Access 97, the dll's were updated
to new ones dated 1996, which solved the crashing problem 100%. Access
95 still works perfect (well, as far as it goes ;) ) with these new
dll's.

3. Better yet, I didn't know of the existence of "Microsoft's Data
Access pak". I got it form an Abriasoft Lite (pretty good Win
installer that sets apache, php and mysql), as a standalone
application that updates ODBC management, with dll's dated 1998. These
work better yet and no need to mess up the registry by installing and
de-installing Access 97.

Result: zero crashes!!! Passing from an average 10 crashes a day, this
truly fills me with joy.

Still three bugs, one of them already reported here, I have to check if
they have been posted on the site:

1. With PHP running as an apache module, launching applications from
context menus freezes explorer, messing up the display by having to
kill the application and having Win run it again (thus, losing all
tray icons).

2. With PHP as module, several second delay (freezing windows) when
launching applications using Windows' hot-keys. (Related to n. 1 ?)

3. Again, when running as module, there's a conflict with some
applications (my best example is Eudora lite 3.0.6): it freezes upon
launching, unfreezes when I stop apache, and works ok from then on
when I re-start apache.

None of this happens with php as CGI.

Thanks again to everybody for the help. This is a great list!

 Gonzalo.

INFO: Win95b, Apache 1.3.14, PHP 4.0.4pl1, Access 95 updated with Data
Access Pak.






I an using the fwrite command to show how it works but it is writing extra
data.  For example, I have a Form text box that prompts for a new string of
data then on submit it writes this to the text file and for just a test I
wrote "this is a test" and I got the text below.  I don't understand why??

this is a testy>
</html>
  / / DTD HTML

I put a space between the two slashes otherwise Outlook puts a "file:" in
front of it like this //


Here is a snippet of my code for performing the write, there is enough here
show you my approach.


print "<form name=myform action=fileio.php>";

$filename="c:\\Program Files\\Apache Group\\Apache\\htdocs\\testfile.txt";
$fp=fopen($filename, "r+");

if (!empty($newText)){
    fwrite($fp, $newText);
    fclose($fp);
    $fp=fopen($filename, "r+");
    $contents=fread($fp, filesize($filename));
}else {
   $contents=fread($fp, filesize($filename));
}
fclose($fp);

print "The content of the file is: <p><b>".nl2br($contents)."</b>";
print "<br><p>Enter some text to write to the file.<br>";
print "<input type=text name=newText size=30><br>";
print "<input type=submit value='write text'>";


Note: I know I probably shouldn't write to a file and then reopen it, but I
am trying to demonstrate that I am actually reading and writing so I didn't
want to cheat and say I was actually reading it when I wasn't.

The resulting text always has the "testy>
</html>
  // DTD HTML " text appended after it. (???????)




Reply via email to