php-windows Digest 2 Dec 2003 02:30:29 -0000 Issue 2024
Topics (messages 22247 through 22259):
Re: Add user to Active Directory
22247 by: Bowden, Zeb
streams not available
22248 by: Michael
PHP 4.3.4 and Sessions
22249 by: Sascha Kaufmann
22253 by: Eric COLINET
22254 by: Donatas
Re: How to find out if PC is online
22250 by: Jan Hrebenar
22251 by: Svensson, B.A.T. (HKG)
22252 by: Eric COLINET
22255 by: SolidDigital
22256 by: Eric COLINET
Search and Replace with WinWord and COM Objects?
22257 by: jon
Webpath vs Absolute Path
22258 by: Tony Devlin
HTTP/1.1 500 Server Error
22259 by: Peter Richards
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 ---
There probably is a way to do it with ldap but unless you're trying to
build a platform independent solution I think you'll be better off using
ADSI/COM
This code is very basic but it will create a new AD user account:
//open our new com object
$objcont = new COM("LDAP://server.domain.com/dc=domain,dc=com") or
die("could not connect");
//create the user
$usr = $objcont->Create("user", "CN=newuser");
//this should print Object
echo "user = $usr";
//samaccountname is required
$usr->Put("samAccountName", "newuser");
//set it
$usr->SetInfo();
-----Original Message-----
From: John [mailto:[EMAIL PROTECTED]
Sent: Wednesday, November 26, 2003 5:59 PM
To: [EMAIL PROTECTED]
Subject: [PHP-WIN] Add user to Active Directory
Hey all,
I'm trying to add a user to Active Directory with PHP. I'm running
apache
1.3.29 and PHP (latest) on Windows 2000. I also have LDAPS working. I
can query AD, search it, even modify attributes for existing users, but
the two pieces of code I've tried don't seem to work. One is from the
LDAP_ADD portion of the PHP manual (site is down at the moment), and
another is from some guy's website which says to use LDAP_MOD_ADD.
Does someone know how to do this? If so, could you please share your
code?
Also, how do you change a user's password in AD with PHP?
Thanks,
John
--
PHP Windows Mailing List (http://www.php.net/) To unsubscribe, visit:
http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
Hi,
I am running PHP 4.3.4 both from the command line and apache. While
phpinfo reports that I have the following streams avaiable:
Registered PHP Streams php, http, ftp, compress.zlib
stream functions are not:
$ ./php.exe -r "var_dump(stream_get_wrappers());"
PHP Fatal error: Call to undefined function: stream_get_wrappers() in
Command line code on line 1
The main problem I have is enabling https and ftps streams. I have
openssl installed--no problem there. But the streams are not registered.
I can't find any info on enabling stream support on Windows, and the
docs suggest that it is tunred on by default.
What am I missing here?
Thanks,
Michael
--- End Message ---
--- Begin Message ---
Hello everyone
I have some major problems with the 4.3.4 version under Windows XP SP 1
with both, Apache 1.3.29 and IIS.
PHP creates wrong(?) session files, it adds lots of spaces and a session
file looks like:
status|s:2:"ok ";user|s:5:"admin ";userid|i:14;language|s:2:"de ";
^ ^^^^^ ^
I register the session variables with $_SESSION['status'] = "ok";
or it adds a space after a string which is very annoying at the Password
verification, I just can't login to my application which *works* with
versions < 4.3.4 :(
Had someone a similar problem and has a fix for it?
--- End Message ---
--- Begin Message ---
Hi,
It looks like a serious bug. If you are able to write few lines of code
that bring to the same result, i suggest you post the bug to the PHP bug
system (http://bugs.php.net).
Eric
At 16:01 01/12/2003, Sascha Kaufmann wrote:
Hello everyone
I have some major problems with the 4.3.4 version under Windows XP SP 1
with both, Apache 1.3.29 and IIS.
PHP creates wrong(?) session files, it adds lots of spaces and a session
file looks like:
status|s:2:"ok ";user|s:5:"admin ";userid|i:14;language|s:2:"de ";
^ ^^^^^ ^
I register the session variables with $_SESSION['status'] = "ok";
or it adds a space after a string which is very annoying at the Password
verification, I just can't login to my application which *works* with
versions < 4.3.4 :(
Had someone a similar problem and has a fix for it?
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
Is is possible that you were in some webpage that has set those other
session variables? they don't seem to be very random ones.
Donny
Eric COLINET wrote:
Hi,
It looks like a serious bug. If you are able to write few lines of
code that bring to the same result, i suggest you post the bug to the
PHP bug system (http://bugs.php.net).
Eric
At 16:01 01/12/2003, Sascha Kaufmann wrote:
Hello everyone
I have some major problems with the 4.3.4 version under Windows XP SP
1 with both, Apache 1.3.29 and IIS.
PHP creates wrong(?) session files, it adds lots of spaces and a
session file looks like:
status|s:2:"ok ";user|s:5:"admin ";userid|i:14;language|s:2:"de ";
^ ^^^^^ ^
I register the session variables with $_SESSION['status'] = "ok";
or it adds a space after a string which is very annoying at the
Password verification, I just can't login to my application which
*works* with versions < 4.3.4 :(
Had someone a similar problem and has a fix for it?
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
thanks, good idea
J.Veenhuijsen wrote:
Try :
gethostbyaddr (PHP 3, PHP 4 )
Get the Internet host name corresponding to a given IP address
string gethostbyaddr (string ip_address)
Returns the host name of the Internet host specified by ip_address. If
an error occurs, eturns
ip_address.
See also gethostbyname().
Jochem
Jan Hrebenar wrote:
Hello All,
I`d like to make script which will detect
if my computer at IP xxx.xxx.xxx.xxx is online.
I try to use system("ping") but this function
is not allowed on server.
Can somebody tell me if exist any other way
to do this?
Pls excuse my english
--- End Message ---
--- Begin Message ---
And precisly how does the mechnaism with gethostbyaddr(),
e.g. an DNS request, work to be able to resolve the issue
about weather a particular host i online or not?
As far as I know this is not possible. The only thing one might
be able to say after a successfull DNS look up is this-or-that
host has a registered entry in the DNS server. Nothing more can
be deduced.
If I messed something here, please fill me in.
-----Original Message-----
From: J.Veenhuijsen
To: [EMAIL PROTECTED]
Sent: 2003-12-01 12:53
Subject: [PHP-WIN] Re: How to find out if PC is online
Try :
gethostbyaddr (PHP 3, PHP 4 )
Get the Internet host name corresponding to a given IP address
string gethostbyaddr (string ip_address)
Returns the host name of the Internet host specified by ip_address. If
an error occurs, eturns
ip_address.
See also gethostbyname().
Jochem
Jan Hrebenar wrote:
> Hello All,
>
> I`d like to make script which will detect
> if my computer at IP xxx.xxx.xxx.xxx is online.
> I try to use system("ping") but this function
> is not allowed on server.
>
> Can somebody tell me if exist any other way
> to do this?
>
> Pls excuse my english
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
Hi,
Good idea except that gethostbyaddr just query a dns server for a
translation of server name to an ip adress, no matter if the host is "up"
or not.
You've not access to the ping command, you can try to access another
service on your machine ie: http, echo, date ...
For example, using http, you just have to create a file on your http server
root called isup.txt which contain just one char: 1 (or anything else)
and the above code will warn you if host is down:
$ok= empty(file_get_contents("http://XXX.XXX.XXX.XXX/isup.txt"));
if( $ok )
echo "The host is up\n";
else
echo "The host is DOWN !!\n";
Eric
At 17:03 01/12/2003, Jan Hrebenar wrote:
thanks, good idea
J.Veenhuijsen wrote:
Try :
gethostbyaddr (PHP 3, PHP 4 )
Get the Internet host name corresponding to a given IP address
string gethostbyaddr (string ip_address)
Returns the host name of the Internet host specified by ip_address. If an
error occurs, eturns
ip_address.
See also gethostbyname().
Jochem
Jan Hrebenar wrote:
Hello All,
I`d like to make script which will detect
if my computer at IP xxx.xxx.xxx.xxx is online.
I try to use system("ping") but this function
is not allowed on server.
Can somebody tell me if exist any other way
to do this?
Pls excuse my english
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
What i meant to say was if gethostbyaddr(ipadress) responds with
something else than the ipadress then this PC must be online.
Or am I wrong??
Jocjem
B.A.T. Svensson wrote:
And precisly how does the mechnaism with gethostbyaddr(),
e.g. an DNS request, work to be able to resolve the issue
about weather a particular host i online or not?
As far as I know this is not possible. The only thing one might
be able to say after a successfull DNS look up is this-or-that
host has a registered entry in the DNS server. Nothing more can
be deduced.
If I messed something here, please fill me in.
-----Original Message-----
From: J.Veenhuijsen
To: [EMAIL PROTECTED]
Sent: 2003-12-01 12:53
Subject: [PHP-WIN] Re: How to find out if PC is online
Try :
gethostbyaddr (PHP 3, PHP 4 )
Get the Internet host name corresponding to a given IP address
string gethostbyaddr (string ip_address)
Returns the host name of the Internet host specified by ip_address. If
an error occurs, eturns
ip_address.
See also gethostbyname().
Jochem
Jan Hrebenar wrote:
Hello All,
I`d like to make script which will detect
if my computer at IP xxx.xxx.xxx.xxx is online.
I try to use system("ping") but this function
is not allowed on server.
Can somebody tell me if exist any other way
to do this?
Pls excuse my english
--- End Message ---
--- Begin Message ---
Hi,
In fact you're wrong. gethostbyaddr is a DNS query tool. The host does not
need to be up to be referenced in the DNS database.
The dedicated tool to do that is the ICMP socket type ping
>> if the function responds with anything else than the IP adress then the
PC must be online!
Just try:
php -r "echo gethostbyname('XXX.XXX.XXX.XXX');"
with an non existing ip adress.
Regards,
Eric
At 20:10 01/12/2003, SolidDigital wrote:
What i meant to say was if gethostbyaddr(ipadress) responds with something
else than the ipadress then this PC must be online.
Or am I wrong??
Jocjem
B.A.T. Svensson wrote:
And precisly how does the mechnaism with gethostbyaddr(),
e.g. an DNS request, work to be able to resolve the issue
about weather a particular host i online or not?
As far as I know this is not possible. The only thing one might
be able to say after a successfull DNS look up is this-or-that
host has a registered entry in the DNS server. Nothing more can
be deduced.
If I messed something here, please fill me in.
-----Original Message-----
From: J.Veenhuijsen
To: [EMAIL PROTECTED]
Sent: 2003-12-01 12:53
Subject: [PHP-WIN] Re: How to find out if PC is online
Try :
gethostbyaddr (PHP 3, PHP 4 )
Get the Internet host name corresponding to a given IP address
string gethostbyaddr (string ip_address)
Returns the host name of the Internet host specified by ip_address. If an
error occurs, eturns
ip_address.
See also gethostbyname().
Jochem
Jan Hrebenar wrote:
Hello All,
I`d like to make script which will detect
if my computer at IP xxx.xxx.xxx.xxx is online.
I try to use system("ping") but this function
is not allowed on server.
Can somebody tell me if exist any other way
to do this?
Pls excuse my english
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
Hey folks...
Hopefully, I'm not the only person out there trying this stuff... but
I haven't been able to find much documentation. I'm trying to do basic
search and replace with Word XP, but am not having any success...
The basics work -- I can connect via com, write some stuff, save a
file, etc... but when it comes to the actual search and replace, it
gets ugly.
Here's my sample code:
<?php
$word = new COM("word.application") or die("Unable to instantiate
Word");
print "Loaded word version ($word->Version)\n";
$word->visible = true;
$word->Documents->Add();
$word->Selection->Typetext("This is a test");
$word->Selection->Typetext(" 123");
$word->Selection->Find->ClearFormatting();
$word->Selection->Find->Execute("test","pain",True,'wdFindContinue',Fals
e,False,False,False,False,False);
$word->Documents[1]->SaveAs("c:\wordTest\Useless test5.doc");
?>
Here's the output I get:
Loaded word version (10.0)
Warning: (null)(): Invoke() failed: Exception occurred. Source:
Unavailable Description: Unavailable in C:\Program Files\Apache
Group\Apache2\htdocs\wordFix.php on line 11
Any help would be greatly appreciated...
-- jon
-------------------
jon roig
web developer
email: [EMAIL PROTECTED]
phone: 888.230.7557
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.544 / Virus Database: 338 - Release Date: 11/25/2003
--- End Message ---
--- Begin Message ---
Hello List,
I'm running an IIS 5.0 server on Windows 2000 box and have PHP Version
4.3.2 with 512 Megs Ram. I am using the CGI mode.
It's a webserver running about 26 Virtual Domains. All Domains are running
PHP and have php scripts.
Something recently has happened and I'm not sure why. I am hoping someone
on this list can help me. All of these sites have been running for over 6
months or longer. Just today a new problem pop'd up, I noticed some of my
sites were timing out and php failing to execute; I could not think of
anything similiar about the sites that were timing out. Out of the 26
virtual domains, about 7 were timing out. After much much much debugging I
could only find one thing similiar;
Instead of using an absolute o/s path:
IE: <?INCLUDE("d:\dir1\dir2\test.php");?>
These were using a webpath:
IE: <?INCLUDE("http://www.test.com/test.php");?>
I changed his webpath calls to use an absolute path and boom, the sites are
working again Perfectly.
Now I prefer and usually always us an absolute o/s path, but we have another
php developer who doesn't. Again these sites had been running correctly for
over 6 months and now all of a sudden stopped.
What could have caused these websites to stop allowing a webpath? Why would
it all of a sudden stop working?
Tony Devlin
V. President / CTO Airewaves Broadband
69 Robert Smalls Prkwy.
Suite 4B
Beaufort, SC 29902
[EMAIL PROTECTED]
http://www.airewaves.com <http://www.airewaves.com/>
tel:
fax:
mobile: (843) 379-2473
(800) 861-6301
(678) 480-4959
--- End Message ---
--- Begin Message ---
Hi,
I have been using a PWS (M$ personal web server) for some ASP work, on
a Win95b box. I found I was able to also use the PWS for some PHP
work. Recently installed PHP 4.3.4, and now all I get with any .PHP
file is a "HTTP/1.1 500 Server Error" msg.
Any clues ?
I _think_ the previous version of PHP I was using was 4.2.3, but I
would prefer to use the latest version.
Peter
--- End Message ---