php with mysqlnd support
Sat, 03/13/2010 - 02:11 — sandipYou can now get the latest PHP with mysqlnd (MySQL Native Driver) support via remis' yum repository as mentioned in PHP-5.3,-zts-and-mysqlnd. The blog mentions that this is enabld in php-zts. However, no php-pecl extension are available and neither are some of the extensions thread safe. So I went about rebuilding php package from source for mysqlnd support.
-
Download the source php rpm from http://rpms.famillecollet.com/
Install and apply the below diff patch to the spec file via `patch -p0 < {new_patch_file}` where "new_patch_file" has the below contents:
--- php-5.3.2-remi.spec.orig 2010-03-11 23:07:04.000000000 -0600
+++ php-5.3.2-remi.spec 2010-03-11 23:36:03.000000000 -0600
@@ -24,6 +24,7 @@
%global phpversion 5.3.2
# Optional components; pass "--with mssql" etc to rpmbuild.
+%define with_mysqlnd %{?_with_mysqlnd:1}%{!?_with_m ysqlnd:0}
%define with_oci8 %{?_with_oci8:1}%{!?_with_oci8 :0}
%define with_ibase %{?_with_ibase:1}%{!?_with_iba se:0}
%if %{?rhel}%{?fedora} > 4
@@ -677,6 +678,11 @@
%if %{?fedora}%{?rhel:99} >= 10
&nbs p; --with-system-tzdata \
%endif
+%if %{with_mysqlnd}
+ &nb sp; --with-mysql=shared,mysqlnd \
+ &nb sp; --with-mysqli=shared,mysqlnd \
+ &nb sp; --with-pdo-mysql=shared,mysqln d \
+%endif
$*
if test $? != 0; then
tail -500 config.log
@@ -704,8 +710,13 @@
&nbs p; --enable-dba=shared --with-db4=%{_prefix} \
&nbs p; --with-xmlrpc=shared \
&nbs p; --with-ldap=shared --with-ldap-sasl \
+%if %{with_mysqlnd}
+ &nb sp; --with-mysql=shared,mysqlnd \
+ &nb sp; --with-mysqli=shared,mysqlnd \
+%else
&nbs p; --with-mysql=shared,%{_prefix} \
&nbs p; --with-mysqli=shared,%{_bindir }/mysql_config \
+%endif
%ifarch x86_64
&nbs p; %{?_with_oci8:--with-oci8=shar ed,instantclient,%{_libdir}/or acle/%{oraclever}/client64/lib ,%{oraclever}} \
%else
@@ -725,7 +736,11 @@
&nbs p; --enable-fastcgi \
&nbs p; --enable-pdo=shared \
&nbs p; --with-pdo-odbc=shared,unixODB C,%{_prefix} \
+%if %{with_mysqlnd}
+ &nb sp; --with-pdo-mysql=shared,mysqln d \
+%else
&nbs p; --with-pdo-mysql=shared,%{_pre fix} \
+%endif
&nbs p; --with-pdo-pgsql=shared,%{_pre fix} \
&nbs p; --with-pdo-sqlite=shared,%{_pr efix} \
&nbs p; --with-pdo-dblib=shared,%{_pre fix} \
@@ -756,6 +771,16 @@
&nbs p; --with-recode=shared,%{_prefix }
popd
+%if %{with_mysqlnd}
+without_shared="--with out-gd \
+ &nb sp; --disable-dom --disable-dba --without-unixODBC \
+ &nb sp; --disable-xmlreader --disable-xmlwriter \
+ &nb sp; --without-sqlite \
+ &nb sp; --disable-phar --disable-fileinfo \
+ &nb sp; --disable-json --without-pspell --disable-wddx \
+ &nb sp; --without-curl --disable-posix \
+ &nb sp; --disable-sysvmsg --disable-sysvshm --disable-sysvsem"
+%else
without_shared="--without -mysql --without-gd \
&nbs p; --disable-dom --disable-dba --without-unixODBC \
&nbs p; --disable-pdo --disable-xmlreader --disable-xmlwriter \
@@ -764,6 +789,7 @@
&nbs p; --disable-json --without-pspell --disable-wddx \
&nbs p; --without-curl --disable-posix \
&nbs p; --disable-sysvmsg --disable-sysvshm --disable-sysvsem"
+%endif
# Build Apache module, and the CLI SAPI, /usr/bin/php
pushd build-apache
rpmbuild -bb --with mysqlnd --define "rhel 5" SPECS/php-5.3.2-remi.specTo install via yum, change to the directory where rpms are located and recreate the repodata via:
createrepo .
Static compile and install of apache + mod_ssl + php on FC4
Tue, 05/22/2007 - 15:24 — sandipLatest Compile with pdo drivers for mysql along with mod_security.
NOTE:
Remove the MySQL-shared rpm else openssl will not work.
# rpm -e MySQL-shared-5.0.20a-0.glibc23