Question

I have two PHP installations in parallel. When i am compiling the imagick module for php, it is including the wrong directory.

After:

    /usr/local/php-5.3.21/bin/phpize

configure goes for the wrong php:

    checking for PHP prefix... /usr
    checking for PHP includes... -I/usr/include/php -I/usr/include/php/main

which i need to be: /usr/local/php-5.3.21/include/php

I tried ./configure with --prefix, --includedir, --oldincludedir ... but it did not change the include

Once two lines in the Makefile are changed, the module compiles correctly:

    -phpincludedir = /usr/include/php
    +phpincludedir = /usr/local/php-5.3.21/include/php
    -INCLUDES = -I/usr/include/php -I/usr/include/php/main ...
    +INCLUDES = -I/usr/local/php-5.3.21/include/php ...

If just i would understand a bit more about this autoconf stuff. I have basically no idea where to change the behaviour of configure to correct the path settings.

Was it helpful?

Solution

The ./configure script is finding the first php-config in your environment's PATH variable, and extracting PHP location information to populate the makefile. To force a specific installed version of PHP, use the --with-php-config option.

./configure --with-php-config=/usr/local/php-5.3.21/bin/php-config
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top