1

I'm trying to setup mysqlenterprise.so. I have installed the native driver and loaded before mysqlent, but when I try to start it I got:

Starting php-fpm: [14-Jul-2015 14:27:40] NOTICE: PHP message: PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/mysqlenterprise.so' - /usr/lib64/php/modules/mysqlenterprise.so: undefined symbol: php_body_write in Unknown on line 0

I have googled and found the error undefined symbol: php_body_write in Unknown on line 0 for other php modules that got solved upgrading the module.

Is it possible to load this mysqlenterprise.so into php 5.4? Documentation says that i need a minimal version of 5.3.

So far I got: Config files:

ls -la /etc/php.d/
total 96
drwxr-xr-x.  2 root root 4096 Jul 15 20:35 .
drwxr-xr-x. 87 root root 4096 Jul 15 18:21 ..
-rw-r--r--.  1 root root   49 Jun 15 09:46 curl.ini
(omitted output)
-rw-r--r--.  1 root root   55 Jun 15 09:46 mysqlnd.ini
-rw-r--r--.  1 root root   69 Jun 15 09:46 mysqlnd_mysqli.ini
-rw-r--r--.  1 root root   67 Jun 15 09:46 mysqlnd_mysql.ini
(omitted output)
-rw-r--r--.  1 root root   29 Jul 15 20:35 zzmysqlenterprise.ini

Loaded modules

ls /usr/lib64/php/modules/mysqlenterprise.so 
/usr/lib64/php/modules/mysqlenterprise.so

Config file contents:

cat /etc/php.d/zzmysqlenterprise.ini
extension=mysqlenterprise.so

With @mim help now I know that php 5.3 vs 5.4 changed on output.c symbol php_body_write in favour to php_output_write (why? why broke like this the libs compat?)

https://github.com/php/php-src/blob/PHP-5.4.42/main/output.c vs https://github.com/php/php-src/blob/PHP-5.3.29/main/output.c

nm /usr/lib64/php/modules/mysqlenterprise.so | grep php
                 U _php_stream_free
                 U _php_stream_get_line
                 U _php_stream_read
                 U _php_stream_write
                 U _php_stream_xport_create
                 U php_base64_encode
                 U php_body_write
                 U php_error_docref0
                 U php_info_print_table_end
                 U php_info_print_table_header
                 U php_info_print_table_row
                 U php_info_print_table_start
0000000000006d42 t php_mysqlenterprise_conn_change_user_pub
0000000000006e8c t php_mysqlenterprise_conn_close_pub
0000000000006e4a t php_mysqlenterprise_conn_end_psession_pub
0000000000006e6b t php_mysqlenterprise_conn_free_contents_pub
0000000000006cbd t php_mysqlenterprise_conn_kill_connection_pub
0000000000006c90 t php_mysqlenterprise_conn_ping_pub
0000000000006b76 t php_mysqlenterprise_conn_query_pub
0000000000006cf9 t php_mysqlenterprise_conn_select_db_pub
0000000000002659 t php_mysqlenterprise_init_globals
                 U php_sprintf
                 U php_stream_xport_get_name

I'm having trouble opening Oracle support case, but I'm suspecting is incompatible or there are newer versions from them.

closed as off-topic by Jack Douglas Jul 19 '15 at 12:38

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Too localized - this could be because your code has a typo, basic error, or is not relevant to most of our audience. Consider revising your question so that it appeals to a broader audience. As it stands, the question is unlikely to help other users (regarding typo questions, see this meta question for background)." – Jack Douglas
If this question can be reworded to fit the rules in the help center, please edit the question.

1

Now a little update:

I tried mysqlenterprise.so for php 5.4, 5.5 and 5.6 and i'm sure it won't work cause it's a compatibility issue.

In PHP Plugin Pack 3.0.22 there's only mysql-enterprise-plugin-1.0.1-php5.3 and unfortunately it works only on php 5.3. It caused by the change of php_body_write to php_output_write on PHPAPI main/output.c after 5.4 release. I checked if there's a new extension but can not find anything.

Only solution seems to open a support ticket.


As shown in documentation you need to load your mysqlnd before mysqlenterprise.so. Mostly this error is about wrong configuration or choosing wrong version for extensions.

Did you compile your php enabled with mysqlnd or installed mysqlnd extension?

First check your php configuration on command line with php -i for controlling your extensions loaded successfully. You can read more clean you grep result with mysql and check your extension list with grep -Hrv ";" /etc/php.d/ | grep -i "extension="

/etc/php.d directory can be different in different installations.

If you can't see your extensions details, check your php configuration ini files under extension folderand make sure you have mysqlnd.ini. For mysql enterprise ini file, you can create one mysqlzz_enterprise.ini or just add it in mysqlnd.ini file.

If this not solve your problem, try to uninstall php and make sure you installed mysqlnd, then add your extension to your ini file, check your extension ini files as in documentation tells.

Example configure options for php source build:

./configure --with-pdo-mysql=mysqlnd --with-mysql=mysqlnd

  • Thank you for your reply. I had this error before and the solution was to let mysqld load first. But this time is not having trouble loading mysqlnd symbols. The symbol with problem is: php_body_write. – FarDarkMist Jul 15 '15 at 0:08
  • if i remember correctly php_body_write changed to php_output_write. this could be a version issue but here dev.mysql.com/doc/mysql-monitor/3.0/en/… they wrote about similar problem about ini files. – mim. Jul 15 '15 at 0:32
  • Thank yoy. Yes they talk about loading : extension=mysqlnd.so before : extension=mysqlenterprise.so I already did that. I'll try to get support from Oracle in this php version compatibility. – FarDarkMist Jul 15 '15 at 2:24
  • Let us know how that works out. – Vérace Jul 15 '15 at 4:30

Not the answer you're looking for? Browse other questions tagged or ask your own question.