Aug 132012
 

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

It was failing with this error:

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

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.

<br />
touch /var/cpanel/easy/apache/rawopts/all_php5<br />
vim /var/cpanel/easy/apache/rawopts/all_php5<br />
add:<br />
--enable-mysqlnd<br />
--with-mysqli=mysqlnd<br />
: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.

Share This!
 Posted by at 11:23 am

Sorry, the comment form is closed at this time.