Bug #52434 [Com]: mysqlnd: host cannot be "localhost" when connecting to tcp port

2012-10-10 Thread register at bazanov dot net
Edit report at https://bugs.php.net/bug.php?id=52434&edit=1

 ID: 52434
 Comment by: register at bazanov dot net
 Reported by:anthon dot pang at gmail dot com
 Summary:mysqlnd: host cannot be "localhost" when connecting
 to tcp port
 Status: Not a bug
 Type:   Bug
 Package:MySQL related
 Operating System:   Ubuntu 10.04
 PHP Version:5.3.3
 Block user comment: N
 Private report: N

 New Comment:

Athon!
Thank you very much for bringing this BUG out!
I killed 1-2 hours of my time trying to understand why I can't connect to the 
server.
Then I found this bug report and changed localhost to 127.0.0.1 and it worked!

This is one of the most annoying and frustrating bugs ever. It must be fixed!

For search engines, here is the error I got:
Warning: mysqli_real_connect() ... [2002] ... connection refused. (trying to 
connect via tcp://localhost:3306)
Warning: mysqli_real_connect() ... (HY000/2002) ... connection refused. (trying 
to connect via tcp://localhost:3306)


Previous Comments:

[2010-09-17 04:59:19] neweracracker at gmail dot com

I agree with anthon.

Someone has to fix this :)


[2010-09-17 04:15:28] anthon dot pang at gmail dot com

This doesn't have anything to do with the hosts file or DNS resolution.

mysqlnd (rightly or wrongly) specially interprets "localhost" to mean a local 
socket, to mimic some of the behavior of MySQL command-line utilities.


[2010-09-17 03:50:57] neweracracker at gmail dot com

# localhost name resolution is handled within DNS itself.
#   127.0.0.1   localhost
#   ::1 localhost

Its disabled :)
Still no result hmm.

I blame Microsoft for this. lol


[2010-09-16 23:30:01] paj...@php.net

There are dozen of reports about that on Windows and it is unrelated to this 
problem.

A work around for the windows issue will be present in 5.3.4, in the meantime 
you can disable ::1 in your windows' host file.


[2010-09-16 23:01:03] neweracracker at gmail dot com

Hello.

I am able to reproduce this issue with:

Windows 7 build 7600 (Ultimate Edition) x86
PHP Version 5.3.3 MSVC6
mysqlnd 5.0.7-dev - 091210 - $Revision: 300533 $ 
MySQL 5.1.50

Steps to reproduce:
1. Download phpmyadmin
2. Extract on html/www/public_html (or similar)
3. Try to connect to mysql (example: login)
4. It won't work, stop php
5. Edit config.inc.php and change localhost to 127.0.0.1
6. No more errors. I guess this needs a fix




The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at

https://bugs.php.net/bug.php?id=52434


-- 
Edit this bug report at https://bugs.php.net/bug.php?id=52434&edit=1


[PHP-BUG] Bug #62721 [NEW]: False positive "Argument ... must be an array, null given"

2012-08-01 Thread register at bazanov dot net
From: register at bazanov dot net
Operating system: Debian
PHP version:  5.3.15
Package:  Unknown/Other Function
Bug Type: Bug
Bug description:False positive "Argument ... must be an array, null given"

Description:

in php.log I see (2 times for the last month):

[20-Jul-2012 12:12:32] PHP Catchable fatal error:  Argument 2 passed to
PendingOrderService::PreparePendingOrder() must be an array, null given,
called in /srv/www/example.org/public_html/OrderHelper.php on line 478 and
defined in /srv/www/example.org/public_html/bll/PendingOrderService.php on
line 58

...
// OrderHelper.php, Line 478:
$order = PendingOrderService::PreparePendingOrder($customer, $orderLines,
$isDDP, $CustomerOrderN);
PendingOrderService::AddOrder($order, $_SESSION['RestrictWithMinPrices']);

CustomerActionsLogAccessor::AddLogEntry(
  $CustomerID, ADD_PENDING_ORDER_FROM_EXCEL, $CustomerOrderN,
count($orderLines) . " positions", '');
...

...
// PendingOrderService.php, Line 58:
public static function PreparePendingOrder(Customer $customer, array
$orderLines, $isDDP, $orderN = null)
...

At the same time in my log I see that the order was added on [20-Jul-2012
12:12:32] (same time when fatal error was logged) and the log contains "419
positions", so count($orderLines) executed successfully and it means
$orderLines was array and not null. Also I see the saved order in the
database with timestamp [20-Jul-2012 12:12:32].

So, everything went fine, $orderLines was not null, but still I got that
log entry.


-- 
Edit bug report at https://bugs.php.net/bug.php?id=62721&edit=1
-- 
Try a snapshot (PHP 5.4):
https://bugs.php.net/fix.php?id=62721&r=trysnapshot54
Try a snapshot (PHP 5.3):
https://bugs.php.net/fix.php?id=62721&r=trysnapshot53
Try a snapshot (trunk):  
https://bugs.php.net/fix.php?id=62721&r=trysnapshottrunk
Fixed in SVN:
https://bugs.php.net/fix.php?id=62721&r=fixed
Fixed in SVN and need be documented: 
https://bugs.php.net/fix.php?id=62721&r=needdocs
Fixed in release:
https://bugs.php.net/fix.php?id=62721&r=alreadyfixed
Need backtrace:  
https://bugs.php.net/fix.php?id=62721&r=needtrace
Need Reproduce Script:   
https://bugs.php.net/fix.php?id=62721&r=needscript
Try newer version:   
https://bugs.php.net/fix.php?id=62721&r=oldversion
Not developer issue: 
https://bugs.php.net/fix.php?id=62721&r=support
Expected behavior:   
https://bugs.php.net/fix.php?id=62721&r=notwrong
Not enough info: 
https://bugs.php.net/fix.php?id=62721&r=notenoughinfo
Submitted twice: 
https://bugs.php.net/fix.php?id=62721&r=submittedtwice
register_globals:
https://bugs.php.net/fix.php?id=62721&r=globals
PHP 4 support discontinued:  
https://bugs.php.net/fix.php?id=62721&r=php4
Daylight Savings:https://bugs.php.net/fix.php?id=62721&r=dst
IIS Stability:   
https://bugs.php.net/fix.php?id=62721&r=isapi
Install GNU Sed: 
https://bugs.php.net/fix.php?id=62721&r=gnused
Floating point limitations:  
https://bugs.php.net/fix.php?id=62721&r=float
No Zend Extensions:  
https://bugs.php.net/fix.php?id=62721&r=nozend
MySQL Configuration Error:   
https://bugs.php.net/fix.php?id=62721&r=mysqlcfg