Home » Php » laravel – How to enable or install PHP's mysql_xdevapi extension in WAMPServer to install datatable?

laravel – How to enable or install PHP's mysql_xdevapi extension in WAMPServer to install datatable?

Posted by: admin February 25, 2020 Leave a comment

Questions:

I wanted to install DataTable in laravel, I used WAMPServer and my

PHP version is 7.3.5, 
Mysql version 5.7.26.

I follow many steps on the internet, such as download from pecl.php.net but my problem remain.

When write

composer require yajra/laravel-datatables-oracle:^9.0

in CMD, after wile the below error showed and cause installation stop.
Error: problem1

-The requested PHP extension ext-mysql_xdevapi * is missing from your system. Install or enable PHP’s mysql_xdevapi extension.

How to&Answers:

php_mysql_devapi extension provides access to the MySQL Document Store via the X DevAPI.

The XDevAPI is a common API provided by multiple MySQL Connectors providing easy access to relational tables as well as collections of documents, which are represented in JSON, from a API with CRUD-style operations.

The X DevAPI uses the X Protocol, the new generation client-server protocol of the MySQL 8.0 server.

To install this extension, you need to have mysql 8 on your system.

Wamp

After installing mysql 8 follow these steps to install php_mysql_xdevapi.

Go to this link https://pecl.php.net/package/mysql_xdevapi to download the .dll for the php_mysql_xdevapi .

After downloading the extension paste in your php installation directory subfolder ext C:\wamp64\bin\php\php7.2.4\ext.

Now you have to add this extension in the php.ini file near the dynamic extensions. extension=php_mysql_xdevapi.dll

One important caveat is that in wamp default mysql 8 installation , XDevApi

plugin is disable, you have to enable it by commenting the part which is disabling mysql_xdevapi.

 ;Disabling X Plugin
       ;mysqlx=0

Now you successfully have install the php_mysql_xdevapi on wamp, to see it working,

$session = mysql_xdevapi\getSession('mysqlx://<user>:<password>@host:33060?connect-timeout=5000&ssl-mode=disabled');

More Info