title: PHP can connect database but can't query any sql
body: <p>I've installed php (5.4.16), php-mysql, php-fpm, nginx, MariaDB on CentOS 7. Now I can connect database with following code. But it can't execute any sql. I've checked the /etc/php.d/pdo.ini, /etc/php.d/mysql.ini and /etc/php.d/pdo_mysql.ini , and all of extensions have been enabled. </p>
  
  <pre><code>&lt;?php
  ///print_r(phpinfo());exit;
      $dbhost = 'localhost';
      $dbuser = 'root';
      $dbpass = 'XXXX;
      $dbname = 'XXXX';
      $conn = mysql_connect($dbhost,$dbuser,$dbpass,$dbname);
      if ($conn) {
          echo "Connection Successfully\n";
      } else {
          echo "Connection failed\n";
      }
  
      $sql = 'SELECT * FROM `user` LIMIT 0, 10';
  
      try{
  
          if(mysql_query($sql,$conn)){
              echo "execute successfully";
          }else{
              echo "execute failed";
          }
      }catch(Exception $e){
          echo $e;
      }
  
  ?&gt;
  </code></pre>
  
  <p>PHP info:</p>
  
  <pre><code>PHP Warning:  phpinfo(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /var/www/lcpd/info.php on line 1
  phpinfo()
  PHP Version =&gt; 5.4.16
  
  System =&gt; Linux host-10-6-101-2 3.10.0-229.7.2.el7.x86_64 #1 SMP Tue Jun 23 22:06:11 UTC 2015 x86_64
  Build Date =&gt; Jun 23 2015 21:17:19
  Server API =&gt; Command Line Interface
  Virtual Directory Support =&gt; disabled
  Configuration File (php.ini) Path =&gt; /etc
  Loaded Configuration File =&gt; /etc/php.ini
  Scan this dir for additional .ini files =&gt; /etc/php.d
  Additional .ini files parsed =&gt; /etc/php.d/curl.ini,
  /etc/php.d/fileinfo.ini,
  /etc/php.d/json.ini,
  /etc/php.d/mysql.ini,
  /etc/php.d/mysqli.ini,
  /etc/php.d/pdo.ini,
  /etc/php.d/pdo_mysql.ini,
  /etc/php.d/pdo_sqlite.ini,
  /etc/php.d/phar.ini,
  /etc/php.d/sqlite3.ini,
  /etc/php.d/zip.ini
  
  PHP API =&gt; 20100412
  PHP Extension =&gt; 20100525
  Zend Extension =&gt; 220100525
  Zend Extension Build =&gt; API220100525,NTS
  PHP Extension Build =&gt; API20100525,NTS
  Debug Build =&gt; no
  Thread Safety =&gt; disabled
  Zend Signal Handling =&gt; disabled
  Zend Memory Manager =&gt; enabled
  Zend Multibyte Support =&gt; disabled
  IPv6 Support =&gt; enabled
  DTrace Support =&gt; disabled
  
  Registered PHP Streams =&gt; https, ftps, compress.zlib, compress.bzip2, php, file, glob, data, http, ftp, phar, zip
  Registered Stream Socket Transports =&gt; tcp, udp, unix, udg, ssl, sslv3, sslv2, tls
  Registered Stream Filters =&gt; zlib.*, bzip2.*, convert.iconv.*, string.rot13, string.toupper, string.tolower, string.strip_tags, convert.*, consumed, dechunk
  
  This program makes use of the Zend Scripting Language Engine:
  Zend Engine v2.4.0, Copyright (c) 1998-2013 Zend Technologies
  
  
   _______________________________________________________________________
  
  
  Configuration
  
  bz2
  
  BZip2 Support =&gt; Enabled
  Stream Wrapper support =&gt; compress.bzip2://
  Stream Filter support =&gt; bzip2.decompress, bzip2.compress
  BZip2 Version =&gt; 1.0.6, 6-Sept-2010
  
  calendar
  
  Calendar support =&gt; enabled
  
  Core
  
  PHP Version =&gt; 5.4.16
  
  Directive =&gt; Local Value =&gt; Master Value
  allow_url_fopen =&gt; On =&gt; On
  allow_url_include =&gt; Off =&gt; Off
  always_populate_raw_post_data =&gt; Off =&gt; Off
  arg_separator.input =&gt; &amp; =&gt; &amp;
  arg_separator.output =&gt; &amp; =&gt; &amp;
  asp_tags =&gt; Off =&gt; Off
  auto_append_file =&gt; no value =&gt; no value
  auto_globals_jit =&gt; On =&gt; On
  auto_prepend_file =&gt; no value =&gt; no value
  browscap =&gt; no value =&gt; no value
  default_charset =&gt; no value =&gt; no value
  default_mimetype =&gt; text/html =&gt; text/html
  disable_classes =&gt; no value =&gt; no value
  disable_functions =&gt; no value =&gt; no value
  display_errors =&gt; Off =&gt; Off
  display_startup_errors =&gt; Off =&gt; Off
  doc_root =&gt; no value =&gt; no value
  docref_ext =&gt; no value =&gt; no value
  docref_root =&gt; no value =&gt; no value
  enable_dl =&gt; Off =&gt; Off
  enable_post_data_reading =&gt; On =&gt; On
  error_append_string =&gt; no value =&gt; no value
  error_log =&gt; no value =&gt; no value
  error_prepend_string =&gt; no value =&gt; no value
  error_reporting =&gt; 22527 =&gt; 22527
  exit_on_timeout =&gt; Off =&gt; Off
  expose_php =&gt; On =&gt; On
  extension_dir =&gt; /usr/lib64/php/modules =&gt; /usr/lib64/php/modules
  file_uploads =&gt; On =&gt; On
  highlight.comment =&gt; &lt;font style="color: #FF8000"&gt;#FF8000&lt;/font&gt; =&gt; &lt;font style="color: #FF8000"&gt;#FF8000&lt;/font&gt;
  highlight.default =&gt; &lt;font style="color: #0000BB"&gt;#0000BB&lt;/font&gt; =&gt; &lt;font style="color: #0000BB"&gt;#0000BB&lt;/font&gt;
  highlight.html =&gt; &lt;font style="color: #000000"&gt;#000000&lt;/font&gt; =&gt; &lt;font style="color: #000000"&gt;#000000&lt;/font&gt;
  highlight.keyword =&gt; &lt;font style="color: #007700"&gt;#007700&lt;/font&gt; =&gt; &lt;font style="color: #007700"&gt;#007700&lt;/font&gt;
  highlight.string =&gt; &lt;font style="color: #DD0000"&gt;#DD0000&lt;/font&gt; =&gt; &lt;font style="color: #DD0000"&gt;#DD0000&lt;/font&gt;
  html_errors =&gt; Off =&gt; Off
  ignore_repeated_errors =&gt; Off =&gt; Off
  ignore_repeated_source =&gt; Off =&gt; Off
  ignore_user_abort =&gt; Off =&gt; Off
  implicit_flush =&gt; On =&gt; On
  include_path =&gt; .:/usr/share/pear:/usr/share/php =&gt; .:/usr/share/pear:/usr/share/php
  log_errors =&gt; On =&gt; On
  log_errors_max_len =&gt; 1024 =&gt; 1024
  mail.add_x_header =&gt; On =&gt; On
  mail.force_extra_parameters =&gt; no value =&gt; no value
  mail.log =&gt; no value =&gt; no value
  max_execution_time =&gt; 0 =&gt; 0
  max_file_uploads =&gt; 20 =&gt; 20
  max_input_nesting_level =&gt; 64 =&gt; 64
  max_input_time =&gt; -1 =&gt; -1
  max_input_vars =&gt; 1000 =&gt; 1000
  memory_limit =&gt; 128M =&gt; 128M
  open_basedir =&gt; no value =&gt; no value
  output_buffering =&gt; 0 =&gt; 0
  output_handler =&gt; no value =&gt; no value
  post_max_size =&gt; 8M =&gt; 8M
  precision =&gt; 14 =&gt; 14
  realpath_cache_size =&gt; 16K =&gt; 16K
  realpath_cache_ttl =&gt; 120 =&gt; 120
  register_argc_argv =&gt; On =&gt; On
  report_memleaks =&gt; On =&gt; On
  report_zend_debug =&gt; Off =&gt; Off
  request_order =&gt; GP =&gt; GP
  sendmail_from =&gt; no value =&gt; no value
  sendmail_path =&gt; /usr/sbin/sendmail -t -i =&gt; /usr/sbin/sendmail -t -i
  serialize_precision =&gt; 17 =&gt; 17
  short_open_tag =&gt; Off =&gt; Off
  SMTP =&gt; localhost =&gt; localhost
  smtp_port =&gt; 25 =&gt; 25
  sql.safe_mode =&gt; Off =&gt; Off
  track_errors =&gt; Off =&gt; Off
  unserialize_callback_func =&gt; no value =&gt; no value
  upload_max_filesize =&gt; 2M =&gt; 2M
  upload_tmp_dir =&gt; no value =&gt; no value
  user_dir =&gt; no value =&gt; no value
  user_ini.cache_ttl =&gt; 300 =&gt; 300
  user_ini.filename =&gt; .user.ini =&gt; .user.ini
  variables_order =&gt; GPCS =&gt; GPCS
  xmlrpc_error_number =&gt; 0 =&gt; 0
  xmlrpc_errors =&gt; Off =&gt; Off
  zend.detect_unicode =&gt; On =&gt; On
  zend.enable_gc =&gt; On =&gt; On
  zend.multibyte =&gt; Off =&gt; Off
  zend.script_encoding =&gt; no value =&gt; no value
  
  ctype
  
  ctype functions =&gt; enabled
  
  curl
  
  cURL support =&gt; enabled
  cURL Information =&gt; 7.29.0
  Age =&gt; 3
  Features
  AsynchDNS =&gt; Yes
  Debug =&gt; No
  GSS-Negotiate =&gt; Yes
  IDN =&gt; Yes
  IPv6 =&gt; Yes
  Largefile =&gt; Yes
  NTLM =&gt; Yes
  SPNEGO =&gt; No
  SSL =&gt; Yes
  SSPI =&gt; No
  krb4 =&gt; No
  libz =&gt; Yes
  CharConv =&gt; No
  Protocols =&gt; dict, file, ftp, ftps, gopher, http, https, imap, imaps, ldap, ldaps, pop3, pop3s, rtsp, scp, sftp, smtp, smtps, telnet, tftp
  Host =&gt; x86_64-redhat-linux-gnu
  SSL Version =&gt; NSS/3.15.4
  ZLib Version =&gt; 1.2.7
  libSSH Version =&gt; libssh2/1.4.3
  
  date
  
  date/time support =&gt; enabled
  "Olson" Timezone Database Version =&gt; 0.system
  Timezone Database =&gt; internal
  Default timezone =&gt; UTC
  
  Directive =&gt; Local Value =&gt; Master Value
  date.default_latitude =&gt; 31.7667 =&gt; 31.7667
  date.default_longitude =&gt; 35.2333 =&gt; 35.2333
  date.sunrise_zenith =&gt; 90.583333 =&gt; 90.583333
  date.sunset_zenith =&gt; 90.583333 =&gt; 90.583333
  date.timezone =&gt; no value =&gt; no value
  
  ereg
  
  Regex Library =&gt; Bundled library enabled
  
  exif
  
  EXIF Support =&gt; enabled
  EXIF Version =&gt; 1.4 $Id$
  Supported EXIF Version =&gt; 0220
  Supported filetypes =&gt; JPEG,TIFF
  
  Directive =&gt; Local Value =&gt; Master Value
  exif.decode_jis_intel =&gt; JIS =&gt; JIS
  exif.decode_jis_motorola =&gt; JIS =&gt; JIS
  exif.decode_unicode_intel =&gt; UCS-2LE =&gt; UCS-2LE
  exif.decode_unicode_motorola =&gt; UCS-2BE =&gt; UCS-2BE
  exif.encode_jis =&gt; no value =&gt; no value
  exif.encode_unicode =&gt; ISO-8859-15 =&gt; ISO-8859-15
  
  fileinfo
  
  fileinfo support =&gt; enabled
  version =&gt; 1.0.5
  
  filter
  
  Input Validation and Filtering =&gt; enabled
  Revision =&gt; $Id: 2aa8dd57d9c0c655cd45e6e5872bb95fa5ad76cf $
  
  Directive =&gt; Local Value =&gt; Master Value
  filter.default =&gt; unsafe_raw =&gt; unsafe_raw
  filter.default_flags =&gt; no value =&gt; no value
  
  ftp
  
  FTP support =&gt; enabled
  
  gettext
  
  GetText Support =&gt; enabled
  
  gmp
  
  gmp support =&gt; enabled
  GMP version =&gt; 6.0.0
  
  hash
  
  hash support =&gt; enabled
  Hashing Engines =&gt; md2 md4 md5 sha1 sha224 sha256 sha384 sha512 ripemd128 ripemd160 ripemd256 ripemd320 whirlpool tiger128,3 tiger160,3 tiger192,3 tiger128,4 tiger160,4 tiger192,4 snefru snefru256 gost adler32 crc32 crc32b fnv132 fnv164 joaat haval128,3 haval160,3 haval192,3 haval224,3 haval256,3 haval128,4 haval160,4 haval192,4 haval224,4 haval256,4 haval128,5 haval160,5 haval192,5 haval224,5 haval256,5
  
  iconv
  
  iconv support =&gt; enabled
  iconv implementation =&gt; glibc
  iconv library version =&gt; 2.17
  
  Directive =&gt; Local Value =&gt; Master Value
  iconv.input_encoding =&gt; ISO-8859-1 =&gt; ISO-8859-1
  iconv.internal_encoding =&gt; ISO-8859-1 =&gt; ISO-8859-1
  iconv.output_encoding =&gt; ISO-8859-1 =&gt; ISO-8859-1
  
  json
  
  json support =&gt; enabled
  json version =&gt; 1.2.1
  
  libxml
  
  libXML support =&gt; active
  libXML Compiled Version =&gt; 2.9.1
  libXML Loaded Version =&gt; 20901
  libXML streams =&gt; enabled
  
  mhash
  
  MHASH support =&gt; Enabled
  MHASH API Version =&gt; Emulated Support
  
  mysql
  
  MySQL Support =&gt; enabled
  Active Persistent Links =&gt; 0
  Active Links =&gt; 0
  Client API version =&gt; 5.5.41-MariaDB
  MYSQL_MODULE_TYPE =&gt; external
  MYSQL_SOCKET =&gt; /var/lib/mysql/mysql.sock
  MYSQL_INCLUDE =&gt; -I/usr/include/mysql
  MYSQL_LIBS =&gt; -L/usr/lib64/mysql -lmysqlclient
  
  Directive =&gt; Local Value =&gt; Master Value
  mysql.allow_local_infile =&gt; On =&gt; On
  mysql.allow_persistent =&gt; On =&gt; On
  mysql.connect_timeout =&gt; 60 =&gt; 60
  mysql.default_host =&gt; no value =&gt; no value
  mysql.default_password =&gt; no value =&gt; no value
  mysql.default_port =&gt; no value =&gt; no value
  mysql.default_socket =&gt; /var/lib/mysql/mysql.sock =&gt; /var/lib/mysql/mysql.sock
  mysql.default_user =&gt; no value =&gt; no value
  mysql.max_links =&gt; Unlimited =&gt; Unlimited
  mysql.max_persistent =&gt; Unlimited =&gt; Unlimited
  mysql.trace_mode =&gt; Off =&gt; Off
  
  mysqli
  
  MysqlI Support =&gt; enabled
  Client API library version =&gt; 5.5.41-MariaDB
  Active Persistent Links =&gt; 0
  Inactive Persistent Links =&gt; 0
  Active Links =&gt; 0
  Client API header version =&gt; 5.5.41-MariaDB
  MYSQLI_SOCKET =&gt; /var/lib/mysql/mysql.sock
  
  Directive =&gt; Local Value =&gt; Master Value
  mysqli.allow_local_infile =&gt; On =&gt; On
  mysqli.allow_persistent =&gt; On =&gt; On
  mysqli.default_host =&gt; no value =&gt; no value
  mysqli.default_port =&gt; 3306 =&gt; 3306
  mysqli.default_pw =&gt; no value =&gt; no value
  mysqli.default_socket =&gt; no value =&gt; no value
  mysqli.default_user =&gt; no value =&gt; no value
  mysqli.max_links =&gt; Unlimited =&gt; Unlimited
  mysqli.max_persistent =&gt; Unlimited =&gt; Unlimited
  mysqli.reconnect =&gt; Off =&gt; Off
  
  openssl
  
  OpenSSL support =&gt; enabled
  OpenSSL Library Version =&gt; OpenSSL 1.0.1e-fips 11 Feb 2013
  OpenSSL Header Version =&gt; OpenSSL 1.0.1e-fips 11 Feb 2013
  
  pcntl
  
  pcntl support =&gt; enabled
  
  pcre
  
  PCRE (Perl Compatible Regular Expressions) Support =&gt; enabled
  PCRE Library Version =&gt; 8.32 2012-11-30
  
  Directive =&gt; Local Value =&gt; Master Value
  pcre.backtrack_limit =&gt; 1000000 =&gt; 1000000
  pcre.recursion_limit =&gt; 100000 =&gt; 100000
  
  PDO
  
  PDO support =&gt; enabled
  PDO drivers =&gt; mysql, sqlite
  
  pdo_mysql
  
  PDO Driver for MySQL =&gt; enabled
  Client API version =&gt; 5.5.41-MariaDB
  
  Directive =&gt; Local Value =&gt; Master Value
  pdo_mysql.default_socket =&gt; /var/lib/mysql/mysql.sock =&gt; /var/lib/mysql/mysql.sock
  
  pdo_sqlite
  
  PDO Driver for SQLite 3.x =&gt; enabled
  SQLite Library =&gt; 3.7.17
  
  Phar
  
  Phar: PHP Archive support =&gt; enabled
  Phar EXT version =&gt; 2.0.1
  Phar API version =&gt; 1.1.1
  SVN revision =&gt; $Id: c5042cc34acebcc0926625b57dff03deebbe6472 $
  Phar-based phar archives =&gt; enabled
  Tar-based phar archives =&gt; enabled
  ZIP-based phar archives =&gt; enabled
  gzip compression =&gt; enabled
  bzip2 compression =&gt; enabled
  Native OpenSSL support =&gt; enabled
  
  
  Phar based on pear/PHP_Archive, original concept by Davey Shafik.
  Phar fully realized by Gregory Beaver and Marcus Boerger.
  Portions of tar implementation Copyright (c) 2003-2009 Tim Kientzle.
  Directive =&gt; Local Value =&gt; Master Value
  phar.cache_list =&gt; no value =&gt; no value
  phar.readonly =&gt; On =&gt; On
  phar.require_hash =&gt; On =&gt; On
  
  readline
  
  Readline Support =&gt; enabled
  Readline library =&gt; EditLine wrapper
  
  Directive =&gt; Local Value =&gt; Master Value
  cli.pager =&gt; no value =&gt; no value
  cli.prompt =&gt; \b \&gt;  =&gt; \b \&gt;
  
  Reflection
  
  Reflection =&gt; enabled
  Version =&gt; $Id: 6c4d8062369898a397e4b128348042f5c01b4427 $
  
  session
  
  Session Support =&gt; enabled
  Registered save handlers =&gt; files user
  Registered serializer handlers =&gt; php php_binary
  
  Directive =&gt; Local Value =&gt; Master Value
  session.auto_start =&gt; Off =&gt; Off
  session.cache_expire =&gt; 180 =&gt; 180
  session.cache_limiter =&gt; nocache =&gt; nocache
  session.cookie_domain =&gt; no value =&gt; no value
  session.cookie_httponly =&gt; Off =&gt; Off
  session.cookie_lifetime =&gt; 0 =&gt; 0
  session.cookie_path =&gt; / =&gt; /
  session.cookie_secure =&gt; Off =&gt; Off
  session.entropy_file =&gt; /dev/urandom =&gt; /dev/urandom
  session.entropy_length =&gt; 32 =&gt; 32
  session.gc_divisor =&gt; 1000 =&gt; 1000
  session.gc_maxlifetime =&gt; 1440 =&gt; 1440
  session.gc_probability =&gt; 1 =&gt; 1
  session.hash_bits_per_character =&gt; 5 =&gt; 5
  session.hash_function =&gt; 0 =&gt; 0
  session.name =&gt; PHPSESSID =&gt; PHPSESSID
  session.referer_check =&gt; no value =&gt; no value
  session.save_handler =&gt; files =&gt; files
  session.save_path =&gt; no value =&gt; no value
  session.serialize_handler =&gt; php =&gt; php
  session.upload_progress.cleanup =&gt; On =&gt; On
  session.upload_progress.enabled =&gt; On =&gt; On
  session.upload_progress.freq =&gt; 1% =&gt; 1%
  session.upload_progress.min_freq =&gt; 1 =&gt; 1
  session.upload_progress.name =&gt; PHP_SESSION_UPLOAD_PROGRESS =&gt; PHP_SESSION_UPLOAD_PROGRESS
  session.upload_progress.prefix =&gt; upload_progress_ =&gt; upload_progress_
  session.use_cookies =&gt; On =&gt; On
  session.use_only_cookies =&gt; On =&gt; On
  session.use_trans_sid =&gt; 0 =&gt; 0
  
  shmop
  
  shmop support =&gt; enabled
  
  SimpleXML
  
  Simplexml support =&gt; enabled
  Revision =&gt; $Id: 692516840b2d7d6e7aedb0bedded1f53b764a99f $
  Schema support =&gt; enabled
  
  sockets
  
  Sockets Support =&gt; enabled
  
  SPL
  
  SPL support =&gt; enabled
  Interfaces =&gt; Countable, OuterIterator, RecursiveIterator, SeekableIterator, SplObserver, SplSubject
  Classes =&gt; AppendIterator, ArrayIterator, ArrayObject, BadFunctionCallException, BadMethodCallException, CachingIterator, CallbackFilterIterator, DirectoryIterator, DomainException, EmptyIterator, FilesystemIterator, FilterIterator, GlobIterator, InfiniteIterator, InvalidArgumentException, IteratorIterator, LengthException, LimitIterator, LogicException, MultipleIterator, NoRewindIterator, OutOfBoundsException, OutOfRangeException, OverflowException, ParentIterator, RangeException, RecursiveArrayIterator, RecursiveCachingIterator, RecursiveCallbackFilterIterator, RecursiveDirectoryIterator, RecursiveFilterIterator, RecursiveIteratorIterator, RecursiveRegexIterator, RecursiveTreeIterator, RegexIterator, RuntimeException, SplDoublyLinkedList, SplFileInfo, SplFileObject, SplFixedArray, SplHeap, SplMinHeap, SplMaxHeap, SplObjectStorage, SplPriorityQueue, SplQueue, SplStack, SplTempFileObject, UnderflowException, UnexpectedValueException
  
  sqlite3
  
  SQLite3 support =&gt; enabled
  SQLite3 module version =&gt; 0.7
  SQLite Library =&gt; 3.7.17
  
  Directive =&gt; Local Value =&gt; Master Value
  sqlite3.extension_dir =&gt; no value =&gt; no value
  
  standard
  
  Dynamic Library Support =&gt; enabled
  Path to sendmail =&gt; /usr/sbin/sendmail -t -i
  
  Directive =&gt; Local Value =&gt; Master Value
  assert.active =&gt; 1 =&gt; 1
  assert.bail =&gt; 0 =&gt; 0
  assert.callback =&gt; no value =&gt; no value
  assert.quiet_eval =&gt; 0 =&gt; 0
  assert.warning =&gt; 1 =&gt; 1
  auto_detect_line_endings =&gt; 0 =&gt; 0
  default_socket_timeout =&gt; 60 =&gt; 60
  from =&gt; no value =&gt; no value
  url_rewriter.tags =&gt; a=href,area=href,frame=src,input=src,form=fakeentry =&gt; a=href,area=href,frame=src,input=src,form=fakeentry
  user_agent =&gt; no value =&gt; no value
  
  tokenizer
  
  Tokenizer Support =&gt; enabled
  
  xml
  
  XML Support =&gt; active
  XML Namespace Support =&gt; active
  libxml2 Version =&gt; 2.9.1
  
  zip
  
  Zip =&gt; enabled
  Extension Version =&gt; $Id: 0c033d4e4613d577409950ed7bf8da4b68286d15 $
  Zip version =&gt; 1.11.0
  Compiled against libzip version =&gt; 0.10.1
  
  zlib
  
  ZLib Support =&gt; enabled
  Stream Wrapper =&gt; compress.zlib://
  Stream Filter =&gt; zlib.inflate, zlib.deflate
  Compiled Version =&gt; 1.2.7
  Linked Version =&gt; 1.2.7
  
  Directive =&gt; Local Value =&gt; Master Value
  zlib.output_compression =&gt; Off =&gt; Off
  zlib.output_compression_level =&gt; -1 =&gt; -1
  zlib.output_handler =&gt; no value =&gt; no value
  
  Additional Modules
  
  Module Name
  
  Environment
  
  Variable =&gt; Value
  XDG_SESSION_ID =&gt; 21
  HOSTNAME =&gt; host-10-6-101-2
  SELINUX_ROLE_REQUESTED =&gt;
  TERM =&gt; xterm-256color
  SHELL =&gt; /bin/bash
  HISTSIZE =&gt; 1000
  SSH_CLIENT =&gt; 180.175.175.173 2401 22
  SELINUX_USE_CURRENT_RANGE =&gt;
  SSH_TTY =&gt; /dev/pts/0
  USER =&gt; root
  LS_COLORS =&gt; rs=0:di=38;5;27:ln=38;5;51:mh=44;38;5;15:pi=40;38;5;11:so=38;5;13:do=38;5;5:bd=48;5;232;38;5;11:cd=48;5;232;38;5;3:or=48;5;232;38;5;9:mi=05;48;5;232;38;5;15:su=48;5;196;38;5;15:sg=48;5;11;38;5;16:ca=48;5;196;38;5;226:tw=48;5;10;38;5;16:ow=48;5;10;38;5;21:st=48;5;21;38;5;15:ex=38;5;34:*.tar=38;5;9:*.tgz=38;5;9:*.arc=38;5;9:*.arj=38;5;9:*.taz=38;5;9:*.lha=38;5;9:*.lz4=38;5;9:*.lzh=38;5;9:*.lzma=38;5;9:*.tlz=38;5;9:*.txz=38;5;9:*.tzo=38;5;9:*.t7z=38;5;9:*.zip=38;5;9:*.z=38;5;9:*.Z=38;5;9:*.dz=38;5;9:*.gz=38;5;9:*.lrz=38;5;9:*.lz=38;5;9:*.lzo=38;5;9:*.xz=38;5;9:*.bz2=38;5;9:*.bz=38;5;9:*.tbz=38;5;9:*.tbz2=38;5;9:*.tz=38;5;9:*.deb=38;5;9:*.rpm=38;5;9:*.jar=38;5;9:*.war=38;5;9:*.ear=38;5;9:*.sar=38;5;9:*.rar=38;5;9:*.alz=38;5;9:*.ace=38;5;9:*.zoo=38;5;9:*.cpio=38;5;9:*.7z=38;5;9:*.rz=38;5;9:*.cab=38;5;9:*.jpg=38;5;13:*.jpeg=38;5;13:*.gif=38;5;13:*.bmp=38;5;13:*.pbm=38;5;13:*.pgm=38;5;13:*.ppm=38;5;13:*.tga=38;5;13:*.xbm=38;5;13:*.xpm=38;5;13:*.tif=38;5;13:*.tiff=38;5;13:*.png=38;5;13:*.svg=38;5;13:*.svgz=38;5;13:*.mng=38;5;13:*.pcx=38;5;13:*.mov=38;5;13:*.mpg=38;5;13:*.mpeg=38;5;13:*.m2v=38;5;13:*.mkv=38;5;13:*.webm=38;5;13:*.ogm=38;5;13:*.mp4=38;5;13:*.m4v=38;5;13:*.mp4v=38;5;13:*.vob=38;5;13:*.qt=38;5;13:*.nuv=38;5;13:*.wmv=38;5;13:*.asf=38;5;13:*.rm=38;5;13:*.rmvb=38;5;13:*.flc=38;5;13:*.avi=38;5;13:*.fli=38;5;13:*.flv=38;5;13:*.gl=38;5;13:*.dl=38;5;13:*.xcf=38;5;13:*.xwd=38;5;13:*.yuv=38;5;13:*.cgm=38;5;13:*.emf=38;5;13:*.axv=38;5;13:*.anx=38;5;13:*.ogv=38;5;13:*.ogx=38;5;13:*.aac=38;5;45:*.au=38;5;45:*.flac=38;5;45:*.mid=38;5;45:*.midi=38;5;45:*.mka=38;5;45:*.mp3=38;5;45:*.mpc=38;5;45:*.ogg=38;5;45:*.ra=38;5;45:*.wav=38;5;45:*.axa=38;5;45:*.oga=38;5;45:*.spx=38;5;45:*.xspf=38;5;45:
  MAIL =&gt; /var/spool/mail/root
  PATH =&gt; /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin
  PWD =&gt; /var/www/lcpd
  LANG =&gt; en_US.UTF-8
  SELINUX_LEVEL_REQUESTED =&gt;
  HISTCONTROL =&gt; ignoredups
  SHLVL =&gt; 1
  HOME =&gt; /root
  LOGNAME =&gt; root
  SSH_CONNECTION =&gt; 180.175.175.173 2401 10.6.101.2 22
  LC_CTYPE =&gt; UTF-8
  LESSOPEN =&gt; ||/usr/bin/lesspipe.sh %s
  XDG_RUNTIME_DIR =&gt; /run/user/0
  _ =&gt; /usr/bin/php
  OLDPWD =&gt; /var/www
  
  PHP Variables
  
  Variable =&gt; Value
  _SERVER["XDG_SESSION_ID"] =&gt; 21
  _SERVER["HOSTNAME"] =&gt; host-10-6-101-2
  _SERVER["SELINUX_ROLE_REQUESTED"] =&gt;
  _SERVER["TERM"] =&gt; xterm-256color
  _SERVER["SHELL"] =&gt; /bin/bash
  _SERVER["HISTSIZE"] =&gt; 1000
  _SERVER["SSH_CLIENT"] =&gt; 180.175.175.173 2401 22
  _SERVER["SELINUX_USE_CURRENT_RANGE"] =&gt;
  _SERVER["SSH_TTY"] =&gt; /dev/pts/0
  _SERVER["USER"] =&gt; root
  _SERVER["LS_COLORS"] =&gt; rs=0:di=38;5;27:ln=38;5;51:mh=44;38;5;15:pi=40;38;5;11:so=38;5;13:do=38;5;5:bd=48;5;232;38;5;11:cd=48;5;232;38;5;3:or=48;5;232;38;5;9:mi=05;48;5;232;38;5;15:su=48;5;196;38;5;15:sg=48;5;11;38;5;16:ca=48;5;196;38;5;226:tw=48;5;10;38;5;16:ow=48;5;10;38;5;21:st=48;5;21;38;5;15:ex=38;5;34:*.tar=38;5;9:*.tgz=38;5;9:*.arc=38;5;9:*.arj=38;5;9:*.taz=38;5;9:*.lha=38;5;9:*.lz4=38;5;9:*.lzh=38;5;9:*.lzma=38;5;9:*.tlz=38;5;9:*.txz=38;5;9:*.tzo=38;5;9:*.t7z=38;5;9:*.zip=38;5;9:*.z=38;5;9:*.Z=38;5;9:*.dz=38;5;9:*.gz=38;5;9:*.lrz=38;5;9:*.lz=38;5;9:*.lzo=38;5;9:*.xz=38;5;9:*.bz2=38;5;9:*.bz=38;5;9:*.tbz=38;5;9:*.tbz2=38;5;9:*.tz=38;5;9:*.deb=38;5;9:*.rpm=38;5;9:*.jar=38;5;9:*.war=38;5;9:*.ear=38;5;9:*.sar=38;5;9:*.rar=38;5;9:*.alz=38;5;9:*.ace=38;5;9:*.zoo=38;5;9:*.cpio=38;5;9:*.7z=38;5;9:*.rz=38;5;9:*.cab=38;5;9:*.jpg=38;5;13:*.jpeg=38;5;13:*.gif=38;5;13:*.bmp=38;5;13:*.pbm=38;5;13:*.pgm=38;5;13:*.ppm=38;5;13:*.tga=38;5;13:*.xbm=38;5;13:*.xpm=38;5;13:*.tif=38;5;13:*.tiff=38;5;13:*.png=38;5;13:*.svg=38;5;13:*.svgz=38;5;13:*.mng=38;5;13:*.pcx=38;5;13:*.mov=38;5;13:*.mpg=38;5;13:*.mpeg=38;5;13:*.m2v=38;5;13:*.mkv=38;5;13:*.webm=38;5;13:*.ogm=38;5;13:*.mp4=38;5;13:*.m4v=38;5;13:*.mp4v=38;5;13:*.vob=38;5;13:*.qt=38;5;13:*.nuv=38;5;13:*.wmv=38;5;13:*.asf=38;5;13:*.rm=38;5;13:*.rmvb=38;5;13:*.flc=38;5;13:*.avi=38;5;13:*.fli=38;5;13:*.flv=38;5;13:*.gl=38;5;13:*.dl=38;5;13:*.xcf=38;5;13:*.xwd=38;5;13:*.yuv=38;5;13:*.cgm=38;5;13:*.emf=38;5;13:*.axv=38;5;13:*.anx=38;5;13:*.ogv=38;5;13:*.ogx=38;5;13:*.aac=38;5;45:*.au=38;5;45:*.flac=38;5;45:*.mid=38;5;45:*.midi=38;5;45:*.mka=38;5;45:*.mp3=38;5;45:*.mpc=38;5;45:*.ogg=38;5;45:*.ra=38;5;45:*.wav=38;5;45:*.axa=38;5;45:*.oga=38;5;45:*.spx=38;5;45:*.xspf=38;5;45:
  _SERVER["MAIL"] =&gt; /var/spool/mail/root
  _SERVER["PATH"] =&gt; /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin
  _SERVER["PWD"] =&gt; /var/www/lcpd
  _SERVER["LANG"] =&gt; en_US.UTF-8
  _SERVER["SELINUX_LEVEL_REQUESTED"] =&gt;
  _SERVER["HISTCONTROL"] =&gt; ignoredups
  _SERVER["SHLVL"] =&gt; 1
  _SERVER["HOME"] =&gt; /root
  _SERVER["LOGNAME"] =&gt; root
  _SERVER["SSH_CONNECTION"] =&gt; 180.175.175.173 2401 10.6.101.2 22
  _SERVER["LC_CTYPE"] =&gt; UTF-8
  _SERVER["LESSOPEN"] =&gt; ||/usr/bin/lesspipe.sh %s
  _SERVER["XDG_RUNTIME_DIR"] =&gt; /run/user/0
  _SERVER["_"] =&gt; /usr/bin/php
  _SERVER["OLDPWD"] =&gt; /var/www
  _SERVER["PHP_SELF"] =&gt; info.php
  _SERVER["SCRIPT_NAME"] =&gt; info.php
  _SERVER["SCRIPT_FILENAME"] =&gt; info.php
  _SERVER["PATH_TRANSLATED"] =&gt; info.php
  _SERVER["DOCUMENT_ROOT"] =&gt;
  _SERVER["REQUEST_TIME_FLOAT"] =&gt; 1438831459.0191
  _SERVER["REQUEST_TIME"] =&gt; 1438831459
  _SERVER["argv"] =&gt; Array
  (
      [0] =&gt; info.php
  )
  
  _SERVER["argc"] =&gt; 1
  
  PHP License
  This program is free software; you can redistribute it and/or modify
  it under the terms of the PHP License as published by the PHP Group
  and included in the distribution in the file:  LICENSE
  
  This program is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  
  If you did not receive a copy of the PHP license, or have any
  questions about PHP licensing, please contact license@php.net.
  </code></pre>
  
  <p>BTW:I can get the result with mysql cli</p>