Search code examples
phpphp4php-extension

compiling php4 headers instead of php5


I'm compiling certain extensions for PHP on dreamhost PS server. I got an error and found that it happens when php4 headers are used instead of php5 headers.

running phpinfo shows the server runs php5. however php-v on the command line gives php4.

How can I make the compilation use php5 instead of php4 on my server? Is there an environment variable of some kind and if so how can I change it (new to linux)

Thanks


Solution

  • You have to find out where on the box PHP 5 is installed. You might try locate phpize on your shell. The same directory should contain a php-config executable. The path might be found in the phpinfo() output. Check there for the Configuraiton cammand and in there for the --prefix parameter.

    If there are multiple PHP isntallations incl. phpize you can compile extensions using da selected version by using the correct paths:

    $ cd extension_source
    $ /full/path/to/bin/phpize
    $ ./configure --with-php-config=/full/path/to/bin/php-config
    $ make
    $ make install