Re: [PHP-WIN] 5.3.9RC2 and 5.4RC2

Tommy Pham <[email protected]>
Newsgroups gmane.comp.php.general,gmane.comp.php.windows
Message-ID <CANPW+MsbLFqHvwRdLjz_bgY4-foNX+5-CeOgE02sYS4339iDLQ@mail.gmail.com>
On Mon, Nov 28, 2011 at 1:34 AM, Pierre Joye <[email protected]> wrote:
> On Mon, Nov 28, 2011 at 5:51 AM, Tommy Pham <[email protected]> wrote:
>
>> Can someone please confirm if you're able to create/drop MySQL
>> database on using phpMyAdmin with PHP 5.3.9RC2 or PHP5.4RC2?
>
> Please use the sqlsrv or mysql functions directly with CREATE/DROP
> queries in a little script, it will be easier to debug.
>
> Cheers,
> --
> Pierre
>
> @pierrejoye | http://blog.thepimp.net | http://www.libgd.org
>

I don't know what happened last night. After about 2 hours trying to make
some progress but failed, I called it a night.  I just tried again to see
if I had the same problems as last night.  Apparently, I don't, even after
several attempts to duplicate last night problems.  Anyway, I got a few
things setup to facilitate troubleshooting the compatibilities, including
bug report Doc #60404.  Here comes a wall of text from about 5-6 hours of
testing, mostly for sqlsrv ... LOL.


5.3.5 5.3.9RC2 5.4.0RC2  error_reporting
E_ALL & ~E_DEPRECATED & ~E_STRICT 22527 22527 22527  file_uploads On On On
log_errors On On On  log_errors_max_len 0 0 0  max_execution_time 300 300
300  max_input_time 60 60 60  memory_limit 128M 128M 128M  post_max_size 20M
20M 20M  upload_max_filesize 20M 20M 20M           Drupal 7.9 + MySQL
5.5-rc >> install OK OK OK  Drupal 7.9 + MySQL 5.5-rc >> using1 OK OK
OK  Drupal
7.9 + SQL Server 10.50.2500 >> install OK Error[3] Error[4]  Drupal 7.9 +
SQL Server 10.50.2500 >> using1 OK partial[2] partial[2]           SQL
Server install - Working Set (memory) 186,636K      SQL Server install -
Private Working Set (memory) 145,760K      SQL Server install - Commit Size
(memory) 147,736K               MySQL install - Working Set (memory)
123,552K      MySQL install - Private Working Set (memory) 86,332K      MySQL
install - Commit Size (memory) 87,648K

   1. Create and Edit the short article in the home page in each PHP
   version.
   2. Sometimes generates HTTP Error 500.0 when reading/creating/editing a
   new article.
   3. Always receive HTTP Error 500.0 after creating about 25 tables out of
   73 max.
   4. SQLSTATE[IMSSP]: An error occurred substituting the named parameters.

For 5.3.5 and 5.3.9RC2, sqlsrv driver is the same (ExtensionVer) version
2.0.1802.200 and I have xdebug trace logs of every execution. I didn't
bother with the memory comparison for 5.3.9RC2 and 5.4.0RC2 since Drupal
7.9 failed to install for sqlsvr.  There error_log file doesn't have any
errors prior to and when PHP crashed suddenly, generating the HTTP 500.

5.3.5 has 62 extensions: Core, PDO, PDO_ODBC, Phar, Reflection, SPL,
SimpleXML, bcmath, bz2, calendar, cgi-fcgi, com_dotnet, ctype, curl, date,
dom, enchant, ereg, exif, filter, ftp, gd, gettext, gmp, hash, iconv, imap,
intl, json, ldap, libxml, mbstring, mcrypt, mhash, mysql, mysqli, mysqlnd,
odbc, openssl, pcre, pdo_mysql, pdo_pgsql, pdo_sqlsrv, pgsql, session,
shmop, soap, sockets, sqlsrv, standard, tidy, tokenizer, wddx, wincache,
xdebug, xml, xmlreader, xmlrpc, xmlwriter, xsl, zip, zlib

5.3.9RC2 has 63 extensions: Core, PDO, PDO_ODBC, Phar, Reflection, SPL,
SimpleXML, bcmath, bz2, calendar, cgi-fcgi, com_dotnet, ctype, curl, date,
dom, enchant, ereg, exif, fileinfo, filter, ftp, gd, gettext, gmp, hash,
iconv, imap, intl, json, ldap, libxml, mbstring, mcrypt, mhash, mysql,
mysqli, mysqlnd, odbc, openssl, pcre, pdo_mysql, pdo_pgsql, pdo_sqlsrv,
pgsql, session, shmop, soap, sockets, sqlsrv, standard, tidy, tokenizer,
wddx, wincache, xdebug, xml, xmlreader, xmlrpc, xmlwriter, xsl, zip, zlib

5.4.0RC2 has 60 extensions: Core, PDO, PDO_ODBC, Phar, Reflection, SPL,
SimpleXML, bcmath, bz2, calendar, cgi-fcgi, com_dotnet, ctype, curl, date,
dom, ereg, exif, fileinfo, filter, ftp, gd, gettext, gmp, hash, iconv,
imap, intl, json, ldap, libxml, mbstring, mcrypt, mhash, mysql, mysqli,
mysqlnd, odbc, openssl, pcre, pdo_mysql, pdo_pgsql, pdo_sqlsrv, pgsql,
session, shmop, soap, sockets, sqlsrv, standard, tidy, tokenizer, wddx,
xml, xmlreader, xmlrpc, xmlwriter, xsl, zip, zlib
If anyone is interested, here's my code for cleaning the db automatically
and reporting PHP version, the database (server & client) version -
specifically for Drupal 7.9:

function exceptionHandler($e)
{
    echo $e->getMessage();
    print_r($e->getTrace());
}
set_exception_handler('exception_handler');

$settings = 'sites/default/settings.php';

/** broken - file locking by IIS **
if (isset($_GET['use']))
{
    //    if (!unlink($settings))
    //        throw new Exception('Error removing old settings');
    $source = "sites/default/settings.{$_GET['use']}.php";
    switch ($_GET['use'])
    {
        case 'mysql':
        case 'mssql':
            if (file_exists($source))
                copy($source, $settings);
            //            if
(!copy(__DIR__.'/sites/default/settings.mysql.php', __DIR__.'/'.$settings))
            //                throw new Exception('Error copying MySQL
settings.');
            break;
    }
}
*/

require_once ($settings);

$driver = $databases['default']['default']['driver'];
$host = $databases['default']['default']['host'];
$database = $databases['default']['default']['database'];
$user = $databases['default']['default']['username'];
$pwd = $databases['default']['default']['password'];
$dsn = '';
$sql = array();
$sql['ShowTables'] = '';
$sql['DropTables'] = 'DROP TABLE ';
$dbTables = array();

echo '<pre>';

switch ($driver)
{
    case 'mysql':
        $dsn = "mysql:dbname={$database};host={$host}";
        $sql['ShowTables'] = "SHOW TABLES FROM {$database}";
        break;

    case 'sqlsrv':
        $dsn = "sqlsrv:database={$database};server={$host}";
        $sql['ShowTables'] = "exec sp_tables @table_owner = 'dbo',
@table_qualifier='{$database}'";
        break;
    default:
        throw new Exception("Database driver {$driver} not supported.");
}

$dbh = new PDO($dsn, $user, $pwd);
if (!($dbh instanceof PDO))
    throw new Exception("PDO failed to connect using dsn: {$dsn}");
if (($sth = $dbh->query($sql['ShowTables'])) === false)
    throw new Exception("SHOW TABLES: PDO query failed
{$sql['ShowTables']}");
switch ($driver)
{
    case 'mysql':
        foreach ($sth as $row)
            $dbTables[] = $row['Tables_in_'.$database];
        break;
    case 'sqlsrv':
        foreach ($sth as $row)
            $dbTables[] = $row['TABLE_NAME'];
        break;
    default:
        throw new Exception("Database driver {$driver} not supported.");
}

echo PHP_VERSION." >> Driver: {$driver} | Server: {$host} | Database:
{$database}".PHP_EOL;
echo "Server Version: ".$dbh->getAttribute(PDO::ATTR_SERVER_VERSION).' |
Client Version: ';
switch ($driver)
{
    case 'mysql':
        echo $dbh->getAttribute(PDO::ATTR_CLIENT_VERSION);
        break;
    case 'sqlsrv':
        print_r($dbh->getAttribute(PDO::ATTR_CLIENT_VERSION));
        break;
    default:
        throw new Exception("Database driver {$driver} not supported.");
}
echo PHP_EOL;
print_r($dbTables);

if (!empty($dbTables))
{
    $sql['DropTables'] .= implode('; DROP TABLE ', $dbTables);
    if (($sth = $dbh->query($sql['DropTables'])) === false)
        throw new Exception("DROP TABLES: PDO query failed
{$sql['DropTables']}");
    if (($sth = $dbh->query($sql['ShowTables'])) === false)
        throw new Exception("SHOW TABLES (check): PDO query failed
{$sql['ShowTables']}");
    echo "Number of tables in database {$database}: ".$sth->rowCount();
}
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.