# mysqlnd as a shared extension ?

- Thread: https://externals.io/message/45302
- Original archive: https://news-web.php.net/php.internals/45302
- Started by Remi Collet on 2009-08-17T17:12:46+00:00
- Messages: 5
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #45302 — Remi Collet — 2009-08-17T17:12:46+00:00

URL: https://externals.io/message/45302#45302

Hi,

Building 5.3.1 snapshot with options
      --with-mysql=shared,mysqlnd
      --with-mysqli=shared,mysqlnd
      --with-pdo-mysql=shared,mysqlnd

create 3 .so files, ok.
But mysqlnd extension still build as static within php core.

Is it a way to build mysqlnd as a shared extension ?

Don't find any option and .m4 file set this extension as static
(changing this result in a .so which cannot be load)

My goal will be to provides both solutions (libmysql and mysqlnd) to be
able to quickly switch from one to the other (for tests / benchmark)

Any idea / solution ?

Regards.

P.S. main question is probably, should we use mysqlnd under linux ?

---

## #45303 — Jani Taskinen — 2009-08-17T17:28:07+00:00

URL: https://externals.io/message/45302#45303 · In reply to: #45302

> Hi,
>
> Building 5.3.1 snapshot with options
>        --with-mysql=shared,mysqlnd
>        --with-mysqli=shared,mysqlnd
>        --with-pdo-mysql=shared,mysqlnd
>
> create 3 .so files, ok.
> But mysqlnd extension still build as static within php core.

It's not an extension.

> Is it a way to build mysqlnd as a shared extension ?

No, it's not an extension.

> Don't find any option and .m4 file set this extension as static
> (changing this result in a .so which cannot be load)
>
> My goal will be to provides both solutions (libmysql and mysqlnd) to be
> able to quickly switch from one to the other (for tests / benchmark)

Not possible.

> Any idea / solution ?

No idea or solutions.

> P.S. main question is probably, should we use mysqlnd under linux ?

If you want to use experimental stuff then yes. Otherwise not.

--Jani

---

## #45305 — Ulf Wendel — 2009-08-17T18:20:37+00:00

URL: https://externals.io/message/45302#45305 · In reply to: #45302

Remi Collet schrieb:

> My goal will be to provides both solutions (libmysql and mysqlnd) to be
> able to quickly switch from one to the other (for tests / benchmark)
> 
> Any idea / solution ?

Andrey might have. CC'ing him.

> P.S. main question is probably, should we use mysqlnd under linux ?

Depends who you ask. If you ask me, go for it. If you don't, it remains 
"untested" forever. "untested"? Well not really. We never had that many 
tests before.

Ulf

---

## #45308 — Tjerk Anne Meesters — 2009-08-17T23:55:13+00:00

URL: https://externals.io/message/45302#45308 · In reply to: #45302

Well, if you're doing speed comparisons why not just compile both
mysqlnd and mysql(i) as static? ;-)


> Hi,
>
> Building 5.3.1 snapshot with options
>       --with-mysql=shared,mysqlnd
>       --with-mysqli=shared,mysqlnd
>       --with-pdo-mysql=shared,mysqlnd
>
> create 3 .so files, ok.
> But mysqlnd extension still build as static within php core.
>
> Is it a way to build mysqlnd as a shared extension ?
>
> Don't find any option and .m4 file set this extension as static
> (changing this result in a .so which cannot be load)
>
> My goal will be to provides both solutions (libmysql and mysqlnd) to be
> able to quickly switch from one to the other (for tests / benchmark)
>
> Any idea / solution ?
>
> Regards.
>
> P.S. main question is probably, should we use mysqlnd under linux ?
>
> --
> 
> 
>
>


-- 
--
Tjerk

---

## #45312 — johannes@php.net — 2009-08-18T17:20:58+00:00

URL: https://externals.io/message/45302#45312 · In reply to: #45302

Hi,


> My goal will be to provides both solutions (libmysql and mysqlnd) to be
> able to quickly switch from one to the other (for tests / benchmark)

Like others said I'd go with different static builds - it's not like PHP
would take ages to compile.

Other than that: it should be possible to build PHP first with
--with-mysql=shared,mysqlnd and then cd ext/mysql; phpize; ./configre;
make clean; make and end up with a .so using mysqlnd and one using
libmysql and then load one or the other. The mysqlnd core would still be
static but shouldn't hurt while measuring.

Didn't test this, though. Best is using different builds.

johannes
