Advertisement
Guest User

Untitled

a guest
Jun 6th, 2016
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.96 KB | None | 0 0
  1. [markusjm@localhost compress]$ php --version
  2. PHP 5.6.22 (cli) (built: May 26 2016 14:22:49)
  3. Copyright (c) 1997-2016 The PHP Group
  4. Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies
  5. [markusjm@localhost compress]$ cat compress.php
  6. <?php
  7.  
  8. // $client_flags = 0;
  9. // works fine
  10.  
  11. $client_flags = MYSQLI_CLIENT_COMPRESS;
  12. // hangs
  13.  
  14. $mysqli = mysqli_init();
  15.  
  16. $mysqli->options(MYSQLI_OPT_CONNECT_TIMEOUT, 10);
  17.  
  18. $hostname = '127.0.0.1';
  19. $username = 'maxuser';
  20. $password = 'maxpwd';
  21. $port = 4008;
  22. $database = '';
  23. $socket = '';
  24.  
  25. $mysqli->real_connect($hostname, $username, $password, $database, $port, $socket, $client_flags);
  26.  
  27. if ($mysqli->connect_errno) {
  28. echo "Failed to connect to MySQL: (" . $mysqli->connect_errno . ") " . $mysqli->connect_error;
  29. }
  30.  
  31. echo $mysqli->host_info . "\n";
  32.  
  33. $res = $mysqli->query("SELECT @@server_id id, @@hostname host");
  34.  
  35.  
  36. while ($row = $res->fetch_assoc()) {
  37. echo " res = " . $row['id'] . ' : ' . $row['host'] . "\n";
  38. }
  39.  
  40. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement