php-windows Digest 5 May 2004 21:21:52 -0000 Issue 2238
Topics (messages 23623 through 23628):
Re: Running PHP scripts as a different user
23623 by: Jason Barnett
23625 by: John Yu
23626 by: Jason Barnett
Re: Serialization
23624 by: Jason Barnett
Re: Stream Programming - PHP Extension
23627 by: Ben Chivers
problem compiling GD2 extension
23628 by: Dietrich Ayala
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 ---
De Greef S�Bastien wrote:
why don't you try runas in the exec() function ?
runas requires you to enter the password credentials after you've
executed the command. I'm not aware of how to pass information like
that while PHP is trying to use exec(), it just hangs waiting for input
that never comes. Have you done this?
--- End Message ---
--- Begin Message ---
Runas has a /savecred to load a saved credential, maybe that will help?
-----Original Message-----
From: Jason Barnett [mailto:[EMAIL PROTECTED]
Sent: Tuesday, May 04, 2004 10:41 PM
To: [EMAIL PROTECTED]
Subject: [PHP-WIN] Re: Running PHP scripts as a different user
De Greef S�Bastien wrote:
> why don't you try runas in the exec() function ?
>
runas requires you to enter the password credentials after you've
executed the command. I'm not aware of how to pass information like
that while PHP is trying to use exec(), it just hangs waiting for input
that never comes. Have you done this?
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
John Yu wrote:
Runas has a /savecred to load a saved credential, maybe that will help?
I did try that before. When I was in the shell I could use runas
/savecred with a php script and only had to input the password once.
However, I couldn't get this to work within PHP when using exec(). I
think Windows only saves the credentials for one cmd session (and exec
starts a new session). That's just a guess, if anyone knows for sure
I'd appreciate it.
Jason
--- End Message ---
--- Begin Message ---
Ron: You need to use stripslashes() when passing a serialized string
via HTTP requests.
<?php
error_reporting(E_ALL);
if (isset($_POST['serialArray'])) {
$stripped = stripslashes($_POST['serialArray']);
echo "<pre>";
// Works
$unserialized = unserialize($stripped);
print_r($unserialized);
} else {
echo "<form action='test.php' method='post'>";
for($i=0;$i<10;$i++) {
for($j=0;$j<10;$j++) {
$aTest[$i][$j] = "Test $i $j";
}
}
$sTest = serialize($aTest);
echo "<input type='hidden' name='serialArray' value='$sTest'>";
echo '<input type="submit" name="Submit" value="Submit">';
echo $sTest;
echo "</form>";
}
?>
--- End Message ---
--- Begin Message ---
Hi,
I am having problems trying to connect to php://input through a stream in a
php extension. The extension successfully connects to php://input but when
I pass data to it, the code I have sent does not execute. I also want to
retrieve the output from php as well. You'll see what I mean in the code I
have provided below. I am new to extension programming in PHP, so any help
with the structure or layout of my program would be most appreciated.
THANKS IN ADVANCED!
#include "php.h"
#include "php_streams.h"
#include <stdio.h>
#include <string.h>
PHP_MINFO_FUNCTION(benchivers);
ZEND_FUNCTION(hello_world);
ZEND_FUNCTION(passphp);
zend_function_entry benchivers_functions[] =
{
ZEND_FE(passphp, NULL)
ZEND_FE(hello_world, NULL)
{NULL, NULL, NULL}
};
zend_module_entry benchivers_module_entry = {
STANDARD_MODULE_HEADER,
"phpCrypt",
benchivers_functions,
NULL,
NULL,
NULL,
NULL,
PHP_MINFO(benchivers),
NO_VERSION_YET,
STANDARD_MODULE_PROPERTIES
};
#ifdef COMPILE_DL_BENCHIVERS
ZEND_GET_MODULE(benchivers)
#endif
PHP_MINFO_FUNCTION(benchivers){
php_info_print_table_start();
php_info_print_table_row(2, "phpCrypt Extension", "enabled");
php_info_print_table_end();
}
ZEND_FUNCTION(hello_world)
{
zend_printf("Hello Ben Chivers<br>");
}
ZEND_FUNCTION(passphp)
{
char buf1[1024] = "<?php mkdir('C:\\Documents and
Settings\\Administrator\\Desktop\\BenChivers', 0755); ?>";
size_t bt;
php_stream * stream = php_stream_open_wrapper("php://input", "w+b",
REPORT_ERRORS, NULL);
if (stream) {
zend_printf("Connected<br>");
bt = php_stream_write(stream, buf1, sizeof(buf1));
while(!php_stream_eof(stream)) {
char buf[1024];
if (php_stream_gets(stream, buf, sizeof(buf))) {
zend_printf("Printing output<br>");
zend_printf(buf);
} else {
break;
}
}
php_stream_close(stream);
}
}
Many Regards,
Ben Chivers
--- End Message ---
--- Begin Message ---
Hello,
I'm using Windows XP, Visual Studio .NET 2003.
I've compiled PHP and misc other extensions fine. I need to compile a
debug GD2 extension to try to catch bug #28084
(http://bugs.php.net/bug.php?id=28084) in the debugger.
However, I can not get the GD2 extension to link properly. I've got
libjpeg and freetype2 compiled. I've worked out all the include paths so
that the GD project can now find them. But when linking, I get this:
gd error LNK2005: _deflate_copyright already defined in
libpng.lib(deflate.obj)
gd warning LNK4006: _deflate_copyright already defined in
libpng.lib(deflate.obj); second definition ignored
gd warning LNK4098: defaultlib 'LIBC' conflicts with use of other libs;
use /NODEFAULTLIB:library
gd warning LNK4098: defaultlib 'LIBCD' conflicts with use of other libs;
use /NODEFAULTLIB:library
gd fatal error LNK1169: one or more multiply defined symbols found
anybody have any idea what is causing this?
Thanks!
-dietrich
--- End Message ---