./configure \ --prefix=/usr/local \ --mandir=/usr/local/man \ --infodir=/usr/local/info \ --with-apxs2=/usr/local/apache2/bin/apxs \ --with-curl=/usr/local \ --enable-exif \ --enable-ftp \ --with-gd=/usr/local \ --with-jpeg-dir=/usr/local \ --with-png-dir=/usr/local \ --with-zlib-dir=/usr/local \ --with-freetype-dir=/usr/local \ --with-mcrypt=/usr/local \ --with-mysql=/usr/local/mysql \ --with-mysqli=/usr/local/mysql/bin/mysql_config \ --with-pdo-mysql=/usr/local/mysql \ --with-libxml-dir=/usr/local \ --enable-zip \ --with-pgsql=/usr/local/pgsql \ --with-pdo-pgsql=/usr/local/pgsql \ --enable-mbstring make sudo make install
:!:I had problems installing on Leopard with ld (when linking). The problem seems to be with libxml2. I installed my own libxml2, but Leopard has it's own. It seems like my headers were read, but it tried to link against Apple's older libraries. To fix it, do the following:
gcc -bundle -bundle_loader /usr/local/apache2/bin/httpd -L/usr/lib -L/usr/lib -laprutil-1 -lsqlite3 -lexpat -liconv -L/usr/lib -lapr-1 -lpthread -I/usr/include -g -O2 -L/usr/local/lib -L/usr/local/mysql/lib/mysql ... -lz -lmysqlclient -lmcrypt -lltdl -liconv -lgd -lfreetype -lpng -lz -ljpeg -lcurl -lz -lm -lxml2 -lz -liconv -lm -lcurl -lssl -lcrypto -lldap -lz -lxml2 -lz -liconv -lm -lmysqlclient -lz -lm -lxml2 -lz -liconv -lm -lxml2 -lz -liconv -lm -lxml2 -lz -liconv -lm -lxml2 -lz -liconv -lm -o libs/libphp5.bundle && cp libs/libphp5.bundle libs/libphp5.so
./configure --prefix=/usr/local --mandir=/usr/local/man --infodir=/usr/local/info --with-apxs2=/usr/local/apache2/bin/apxs --disable-cli make sudo make install
The apache configuration files should automatically be modified. If not, make sure you have the following in httpd.conf:
# this line should already have been added by the php install process LoadModule php5_module modules/libphp5.so # instead of this, add the lines in the following step to mime.types # AddHandler php5-script php
Instead of the AddHandler line, add these lines to mime.types:
application/x-httpd-php php phtml application/x-httpd-php-source phps
If you want to control custom settings for php, create or edit php.ini in /usr/local/lib. If it doesn't exist, go into your php build directory and run this:
sudo cp php.ini-development /usr/local/lib/php.ini
display_errors=1
error_reporting=E_ALL
error_log=/usr/local/apache2/logs/phperror.log log_errors=1
extension=libpdf_php.so
Start or restart apache, make a php page with the following to test the installation and configuration:
<?php echo phpinfo(); ?>
see php_cgi