mysql - PHP Fatal error: Class 'mysqli' not found after building PHP 5.6 from source -


I have compiled PHP 5.6 from the source and received the following error on the runtime because mysqli did not get found

 PHP Fatal error: Class not found in 'mysqli'  

I have compiled with the following configuration

 .configure \ --with-mysqli = / usr / bin / mysql_config \ - with- libdir = lib64 \ --prefix = / usr / local \ --with - layout = PHP \ --with-pear \ --enable-calendar \ --enable-bcmath \ --with-gmp \ - Enable -exif \ --with-mcrypt \ --with-mhash \ --with-zlib \ --with-bz2 \ --enable-zip \ --enable-ftp \ --enable-mbstring \ --with- Iconv \ --enable-intl \ --with-icu-dir = / usr \ --with-gettext \ --with-pspell \ - -sing-sockets \ --with-openssl \ --with-curl \ - with-gd \ --enable-gd-native-ttf \ --with-jpeg-dir = / usr \ --with-png-dir = / Usr \ --with-zlib-dir = / usr \ with -xpm-dir = / usr \ --with-vpx-dir = / usr \ --with-freetype-dir = / usr \ --with- T1lib = / usr \ --with-libxml-dir = / usr \ -with-mysql = mysqlnd \ --with-mysqli = mysqlnd \ --with-pdo-mysql = mysqlnd \ --enable-soap \ --with -xmlrpc \ --with-xsl \ --with-readline \ --enable-pcntl \ --enable-sysvshm \ --enable-sysvmsg \ --enable-shmop \  

i mysqli.so Can not be found in the lib directory:

 [root @ ns507257 php] # cd / usr / lib64 / php / modules / [root @ ns507257 module] # Total 3300-RWXR-XR-X1 root Route 74648 September 30 05:47 curl.so -rwxr-xr-x 1 root root 2713352 30s 05:47 fileinfo.so -rwxr-xr-x 1 root root 44680 Sep 30 05:47 json.so -rwxr-xr-x 1 root root 116296 September 30 05:47 pdo.so -rwxr-xr-x 1 Root root 29168 30 Sep 05:47 pdo_sqlite.so -rwxr-xr-x 1 root root 271960 30 September 05:47 forero.SWWXR-XR-X1 root route 51336 30 Sep 05:47 sqlite3.so -rwxr- Xr-x 1 root root 58384 30 Sep 05:47 zip.so  

php code

 class dbutil {get public static function ($ query, $ dbinfo) {// print_r ( $ Dbinfo); $ Host = $ dbinfo ['host']; $ User name = $ dbinfo ['username']; $ Password = $ dbinfo ['password']; $ Db = $ dbinfo ['database']; $ Mysqli = new mysqli ($ host, $ username, $ password, $ db); / * Check connection * / if ($ mysqli- & gt; connect_errno) {printf ("Connect failed:% s \ n", $ mysqli-> Connect_uper); Go out(); } / * Select questions one resultet * / if ($ result = $ mysqli- & gt; query ("$ query")) / / set free result * / $ result- & gt; Close (); Return result; Also, it seems that my  / usr / local / lib64 /  is empty.  

What's wrong?

It turns out that the previous PHP installation was not properly deleted and with my build Was interrupting

To correct it, I need to:

  Delete yum to php-common. Install / Config   

Now, it works!

Comments

Popular posts from this blog

java - ImportError: No module named py4j.java_gateway -

python - Receiving "KeyError" after decoding json result from url -

.net - Creating a new Queue Manager and Queue in Websphere MQ (using C#) -