Easyapache mysqli extension error

  • Post author:
  • Post category:cPanel

It seems that sometimes the mysqli extension in EasyApache will not compile in properly on CentOS4.

It was failing with this error:

/bin/sh /home/cpeasyapache/src/php-5.3.15/libtool --silent
--preserve-dup-deps --mode=compile gcc -Iext/mysqli/
-I/home/cpeasyapache/src/php-5.3.15/ext/mysqli/ -DPHP_ATOM_INC
-I/home/cpeasyapache/src/php-5.3.15/include
-I/home/cpeasyapache/src/php-5.3.15/main
-I/home/cpeasyapache/src/php-5.3.15
-I/home/cpeasyapache/src/php-5.3.15/ext/date/lib
-I/home/cpeasyapache/src/php-5.3.15/ext/ereg/regex
-I/opt/xml2/include/libxml2 -I/opt/pcre/include -I/opt/curlssl//include
-I/usr/X11R6/include -I/usr/include/freetype2
-I/opt/php_with_imap_client//include
-I/home/cpeasyapache/src/php-5.3.15/ext/mbstring/oniguruma
-I/home/cpeasyapache/src/php-5.3.15/ext/mbstring/libmbfl
-I/home/cpeasyapache/src/php-5.3.15/ext/mbstring/libmbfl/mbfl
-I/opt/libmcrypt//include -I/usr/include/mysql
-I/home/cpeasyapache/src/php-5.3.15/ext/sqlite3/libsqlite
-I/home/cpeasyapache/src/php-5.3.15/TSRM
-I/home/cpeasyapache/src/php-5.3.15/Zend -g -O2 -prefer-non-pic
-c /home/cpeasyapache/src/php-5.3.15/ext/mysqli/mysqli.c -o
ext/mysqli/mysqli.lo
In file included from /usr/include/mysql/my_pthread.h:832,
from /usr/include/mysql/my_sys.h:44,
from /home/cpeasyapache/src/php-5.3.15/ext/mysqli/php_mysqli_structs.h:77,
from /home/cpeasyapache/src/php-5.3.15/ext/mysqli/mysqli.c:33:
/usr/include/mysql/mysql/psi/mysql_thread.h:100: error: syntax error
before "pthread_rwlock_t"
/usr/include/mysql/mysql/psi/mysql_thread.h:100: warning: no semicolon
at end of struct or union
/usr/include/mysql/mysql/psi/mysql_thread.h:107: error: syntax error
before '}' token
/usr/include/mysql/mysql/psi/mysql_thread.h: In function
`inline_mysql_rwlock_init':
/usr/include/mysql/mysql/psi/mysql_thread.h:683: error: dereferencing
pointer to incomplete type
/usr/include/mysql/mysql/psi/mysql_thread.h:683: error: dereferencing
pointer to incomplete type
/usr/include/mysql/mysql/psi/mysql_thread.h:691: error: dereferencing
pointer to incomplete type
/usr/include/mysql/mysql/psi/mysql_thread.h: In function
`inline_mysql_rwlock_destroy':
/usr/include/mysql/mysql/psi/mysql_thread.h:715: error: dereferencing
pointer to incomplete type
/usr/include/mysql/mysql/psi/mysql_thread.h:717: error: dereferencing
pointer to incomplete type
/usr/include/mysql/mysql/psi/mysql_thread.h:718: error: dereferencing
pointer to incomplete type
/usr/include/mysql/mysql/psi/mysql_thread.h:721: error: dereferencing
pointer to incomplete type
/usr/include/mysql/mysql/psi/mysql_thread.h: In function
`inline_mysql_rwlock_rdlock':
/usr/include/mysql/mysql/psi/mysql_thread.h:750: error: dereferencing
pointer to incomplete type
/usr/include/mysql/mysql/psi/mysql_thread.h:752: error: dereferencing
pointer to incomplete type
/usr/include/mysql/mysql/psi/mysql_thread.h:758: error: dereferencing
pointer to incomplete type
/usr/include/mysql/mysql/psi/mysql_thread.h: In function
`inline_mysql_rwlock_wrlock':
/usr/include/mysql/mysql/psi/mysql_thread.h:806: error: dereferencing
pointer to incomplete type
/usr/include/mysql/mysql/psi/mysql_thread.h:808: error: dereferencing
pointer to incomplete type
/usr/include/mysql/mysql/psi/mysql_thread.h:814: error: dereferencing
pointer to incomplete type
/usr/include/mysql/mysql/psi/mysql_thread.h: In function
`inline_mysql_rwlock_tryrdlock':
/usr/include/mysql/mysql/psi/mysql_thread.h:862: error: dereferencing
pointer to incomplete type
/usr/include/mysql/mysql/psi/mysql_thread.h:864: error: dereferencing
pointer to incomplete type
/usr/include/mysql/mysql/psi/mysql_thread.h:870: error: dereferencing
pointer to incomplete type
/usr/include/mysql/mysql/psi/mysql_thread.h: In function
`inline_mysql_rwlock_trywrlock':
/usr/include/mysql/mysql/psi/mysql_thread.h:889: error: dereferencing
pointer to incomplete type
/usr/include/mysql/mysql/psi/mysql_thread.h:891: error: dereferencing
pointer to incomplete type
/usr/include/mysql/mysql/psi/mysql_thread.h:897: error: dereferencing
pointer to incomplete type
/usr/include/mysql/mysql/psi/mysql_thread.h: In function
`inline_mysql_rwlock_unlock':
/usr/include/mysql/mysql/psi/mysql_thread.h:910: error: dereferencing
pointer to incomplete type
/usr/include/mysql/mysql/psi/mysql_thread.h:911: error: dereferencing
pointer to incomplete type
/usr/include/mysql/mysql/psi/mysql_thread.h:913: error: dereferencing
pointer to incomplete type
make: *** [ext/mysqli/mysqli.lo] Error 1
make: *** Waiting for unfinished jobs....
!! 'make -j2' failed with exit code '512' !!
!! Restoring original working apache !!
!! Executing '/scripts/initsslhttpd' !!
!! Restarting 'httpd' ... !!
!! 'httpd' restart complete. !!
Building global cache for cpanel...Done
!! Executing '/scripts/initfpsuexec' !!
!! Executing '/scripts/initsslhttpd' !!
!! Executing '/scripts/update_apachectl' !!
!! Executing '/scripts/enablefileprotect' !!
!! Feel free to submit a support ticket at
https://tickets.cpanel.net/submit/index.cgi?reqtype=tickets !!
!! Verbose logfile is at
'/usr/local/cpanel/logs/easy/apache/build.1344792998' !!

Evidently, CentOS 4 has some issues with mysqli. The fix that worked is as follows:

Add the following to lines to the all_php5 file which should allow mysqli to install properly.


touch /var/cpanel/easy/apache/rawopts/all_php5
vim /var/cpanel/easy/apache/rawopts/all_php5
add:
--enable-mysqlnd
--with-mysqli=mysqlnd
:wq

to save the file. After that, simply re-run
/scripts/easyapache --build
and mysqli should install properly after that.

When the build completes verify the install with a
php -m |grep mysqli
and/or
php -i |grep mysqli
for the mysqli extension settings.

g33kadmin

I am a g33k, Linux blogger, developer, student and Tech Writer for Liquidweb.com/kb. My passion for all things tech drives my hunt for all the coolz. I often need a vacation after I get back from vacation....