php-windows Digest 6 Jan 2008 13:48:55 -0000 Issue 3391

Topics (messages 28683 through 28686):

Re: Recursive PHP method crashes Apache
        28683 by: Stanislav Malyshev
        28684 by: Stut

Issues trying to connect to DB2 via PHP
        28685 by: McCallister, Jason

[PHP 5.2 with Apache 2.2] PHP can't found the activated extensions
        28686 by: Benoit Crauet

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 ---
I call my method Assembler::PrefetchComponents with an array of valid
components and it crashes only when I include the line
"self::PrefetchComponents($dependencies);" Please help me solve the
error in this code.

Most probably you are getting infinite (or very very very deep) recursion loop in this code, which in PHP would lead to a crash.

--
Stanislav Malyshev, Zend Software Architect
[EMAIL PROTECTED]   http://www.zend.com/
(408)253-8829   MSN: [EMAIL PROTECTED]

--- End Message ---
--- Begin Message ---
Aaron Schiff wrote:
I call my method Assembler::PrefetchComponents with an array of valid
components and it crashes only when I include the line
"self::PrefetchComponents($dependencies);" Please help me solve the
error in this code.

The code below is an infinite loop. Unless there is an error (assuming Error::ThrowError halts execution), at no point does it return and at the end of the function it calls itself. This will never end. Apache crashes because it fills up the stack.

Here's Assembler::PrefetchComponents:

public static function PrefetchComponents($names)
{
        $failed = array();

        if(sizeof($m_arrComponents) > 0)
        {
                $names = array_filter($names,create_function('$var',
                        'return(Assembler::GetComponentByName
                        ($var))==NULL;'));
        }

        $dependencies = array();

        foreach($names as $name)
        {
                if(self::TryIncludingComponent($name))
                {
                        $dependencies = array_merge($dependencies,
                                call_user_func(array("Component_$name",
                                "Dependencies")));
                }
                else
                {
                        $failed[] = $name;
                }
        }

        if(sizeof($failed)!=0)
        {
                sort($failed);
                Error::ThrowError(CBD_NO_COMPONENT, $failed);
        }

        self::PrefetchComponents($dependencies);
}

I'm thinking that last line should be...

        if (count($dependencies) > 0)
        {
                self::PrefetchComponents($dependencies);
        }

-Stut

--
http://stut.net/

--- End Message ---
--- Begin Message ---
I'm using IIS on a windows server. I'm having issues trying to connect
to DB2 via PHP.



I can connect to DB2 on the command line on the server.

> db2cmd db2 "connect to emr1u1 user etldbu using xxxx"

  Database Connection Information

Database server        = DB2/AIX64 9.1.3
SQL authorization ID   = ETLDBU
Local database alias   = EMR1U1



When I connect to the same DB in PHP as cataloged or uncataloged, I get
this:

Connection to database failed.
SQLSTATE: 
Message: 




Below are my PHPINFO settings and the cataloged and uncataloged PHP
scripts.



***************
*** PHPINFO ***
***************

*** ibm_db2***

IBM DB2, Cloudscape and Apache Derby support = enabled
Module release = 1.6.3
Module revision = 1.71
Binary data mode (ibm_db2.binmode) = DB2_BINARY  


*** Environment ***

CLASSPATH = .;
C:\PROGRA~1\IBM\SQLLIB\java\db2java.zip;
C:\PROGRA~1\IBM\SQLLIB\java\db2jcc.jar;
C:\PROGRA~1\IBM\SQLLIB\java\db2jcc_license_cu.jar;
C:\PROGRA~1\IBM\SQLLIB\bin;
C:\PROGRA~1\IBM\SQLLIB\java\common.jar  

DB2INSTANCE = DB2
DB2TEMPDIR = C:\PROGRA~1\IBM\SQLLIB\  

Path = F:\PHP\;F:\cygwin\bin;C:\Program Files\EMC\PowerPath\;
C:\Program Files\Windows Resource Kits\Tools\;C:\Program Files\Support
Tools\;
C:\WINNT\system32;C:\WINNT;C:\WINNT\System32\Wbem;C:\PROGRA~1\IBM\SQLLIB
\BIN;
C:\PROGRA~1\IBM\SQLLIB\FUNCTION;C:\PROGRA~1\IBM\SQLLIB\SAMPLES\REPL;
C:\Program Files\PGP Corporation\PGP Command Line\;F:\AbInitio\bin  


*****************
*** CATALOGED ***
*****************

<?php

$database = 'emr1u1';
$user = 'etldbu';
$password = 'xxxx';

print 'Timestamp: '. date('H:i:s, F j, Y') ."<p>";

$conn = db2_connect($database, $user, $password);

if ($conn) {
   echo "Connection succeeded.";
   db2_close($conn);
}
else {
   echo "Connection failed.<p>";
   echo 'SQLSTATE: ' . db2_conn_error() . '<br />';
   echo 'Message: ' . db2_conn_errormsg(). '<br />';
}
?>


*******************
*** UNCATALOGED ***
*******************

<?php

$database = 'emr1u1';
$user = 'etldbu';
$password = 'xxxx';
$hostname = 'imdsdev01';
$port = 42016;

print 'Timestamp: '. date('H:i:s, F j, Y') ."<p>";

$conn_string = "DRIVER={IBM DB2 ODBC DRIVER};DATABASE=$database;" .
 
"HOSTNAME=$hostname;PORT=$port;PROTOCOL=TCPIP;UID=$user;PWD=$password;";
$conn = db2_connect($conn_string, '', '');

if ($conn) {
   echo "Connection succeeded.";
   db2_close($conn);
}
else {
   echo "Connection failed.<p>";
   echo 'SQLSTATE: ' . db2_conn_error() . '<br />';
   echo 'Message: ' . db2_conn_errormsg(). '<br />';
}
?>


Blue Cross Blue Shield of Florida, Inc., and its subsidiary and affiliate 
companies are not responsible for errors or omissions in this e-mail message. 
Any personal comments made in this e-mail do not reflect the views of Blue 
Cross Blue Shield of Florida, Inc.  The information contained in this document 
may be confidential and intended solely for the use of the individual or entity 
to whom it is addressed.  This document may contain material that is privileged 
or protected from disclosure under applicable law.  If you are not the intended 
recipient or the individual responsible for delivering to the intended 
recipient, please (1) be advised that any use, dissemination, forwarding, or 
copying of this document IS STRICTLY PROHIBITED; and (2) notify sender 
immediately by telephone and destroy the document. THANK YOU.

--- End Message ---
--- Begin Message ---
Hello.

For begin, I'm new on this newsgroup, and I'm French. I speak a little english, I'm sorry.

My problem is on a Windows Server 2003 O.S.
I want to run PHP as a module of Apache 2.2.6. So, I was edited the Httpd configuration for PHP 5.2:

        Action application/x-httpd-php "C:/php5/php-cgi.exe"
        LoadModule php5_module "C:/Php5/php5apache2_2.dll"
        
        AddType application/x-httpd-php .php .phtml .php3 .php5
        AddType application/x-httpd-php-source .phps


My PHP binaries are in C:\Php5\

The problem is here : PHP send me a multiple error messages:

PHP Startup: Unable to load dynamic library 'C:/php5/ext/php_mysql.dll' - The specified module could not be found.

But my activated extensions are in the C:\php5\ext\ directory!

This is my PHP configuration :

extension_dir = "C:/php5/ext/"

All DLLs are founds in this directory.

Can you help me please?
Thanks! ;)

--- End Message ---

Reply via email to