Sunday, August 23, 2009

Adding Shared Objects to php and apache

Sometimes you get an install of apache and php and you realize you need a few things that weren't compiled in the first time. Let's say you don't feel like recompiling (figure out what compile switches were used the first time can be a bitch) so instead you can just add in the shared objects you want using pecl and apxs.

Here I add pdo, pdo_mysql and mod_rewrite:

sudo pecl install pdo pdo_mysql #(will compile and add compatible pdo.so and pdo_mysql.so modules to your php libs you will have to enable it in your php.ini)

(from within the root of a new copy of the apache src tree type the following (a new src tree for apache is needd because the first time apache compiled it might have cleaned out the c headers and source files for the modules that weren't included in the .configure)

/usr/local/apache2/bin/apxs -iac modules/mappers/mod_rewrite.c #(will compile and enable for you in the httpd.conf the mod_rewrite shared object)

0 Comments:

Post a Comment

<< Home