Compiling PHP on Centos

Posted by admin on Nov 30, 2009 in Database, Unix |

The precompiled PHP binary does not include MySQL support so it must be recompiled from source.

Download the PHP package and untar it

Download the httpd headers
yum install httpd-devel

./configure –with-mysql=/usr/bin/ –with-libdir=lib64
–with-apxs2 –with-pic –without-aolserver

make test
make install
edit http.conf

LoadModule php5_module        /usr/lib64/httpd/modules/

AddType application/x-httpd-php .php

Alias /php/ "/var/www/html/php/htdocs/"
<Directory "/var/www/html/php/htdocs/">
   Options Indexes FollowSymlinks
   AllowOverride All
   <LimitExcept POST GET>
      Order deny,allow
      Deny from all

ScriptAlias /cgi-php/ "/var/www/html/php/"
<Directory "/var/www/html/php/">
SetEnv LD_LIBRARY_PATH /opt/oracle/product/10.2.0/client_1/lib32
   Options +ExecCGI
   AllowOverride None
   <LimitExcept POST GET>
      Order deny,allow
      Deny from all

Restart the httpd daemon

Leave a Reply

XHTML: You can use these tags:' <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

Copyright © 2008-2018 Brinsmead Data Services All rights reserved.