tags:

views:

20

answers:

1

I'm trying to install a PECL package on Linux, but the installer never gets past the configure stage.

My hosting provider mounted a file system at /var/tmp that prevents files from executing, and that's causing this error:

root@host [/usr/local/apache/conf/includes]# pecl install pdo
downloading PDO-1.0.3.tgz ...
Starting to download PDO-1.0.3.tgz (52,613 bytes)
.............done: 52,613 bytes
12 source files, building
running: phpize
Configuring for:
PHP Api Version:         20041225
Zend Module Api No:      20060613
Zend Extension Api No:   220060519
building in /var/tmp/pear-build-root/PDO-1.0.3
running: /root/tmp/pear/PDO/configure
checking for egrep... grep -E
checking for a sed that does not truncate output... /bin/sed
checking for cc... cc
checking for C compiler default output file name... a.out
checking whether the C compiler works... configure: error: cannot run C compiled programs.
If you meant to cross compile, use `--host'.
See `config.log' for more details.
ERROR: `/root/tmp/pear/PDO/configure' failed

I'm 99% sure the problem is that you can't execute files in /var/tmp (I copied an executable file over here and tried it to verify). I'm sure I can get PECL to complete if I have it do its build work somewhere else, but I can't find the appropriate configuration setting.

How do you tell PECL to build in a non-default folder?

+2  A: 

Whoa, why are you installing PDO from PECL? PDO has been built in to PHP since 5.1. Are you running 5.0?

If you're running 5.1 or higher and are missing PDO, chances are that:

  1. Your copy of PHP was compiled without it, and must be recompiled; or
  2. Your copy of PHP was installed from your OS's repository without the PDO module

If 1, you'll need to either recompile PHP from scratch, or compile just the shared module and copy it to the correct location.

If 2, you'll just need to install your OS's PDO extension. Under RHEL and CentOS, try yum search php-pdo. I don't know the proper syntax for calling the package installer for other distros, but the package will almost certainly include the string "php-pdo". (Tip: If you got your PHP from your OS, they also might provide common PECL packages. Try searching for "pecl" in their repositories.)

Finally, if you're running 5.0... for the sake of all that is good in this world, upgrade! Read through the upgrade notes in the PHP manual first, just in case you're using old behavior by accident.

(Also, to reconfigure pecl, try pecl config-show to see what settings are available, followed by a pecl config-set ... to change a setting. Do not try to install the PDO extension for a version of PHP newer than 5.0.x, it will break. There's even a big fat box at the top of the PDO page on the PECL site.)

Charles
Thanks! I ran phpinfo() and saw "./configure' '--disable-mbregex' '--disable-pdo'". No idea why they'd have PDO disable...
jodonnell
If it's your host, they're insane. If it's your OS distro, it's so they could compile it as a separate module for whatever insane reason they have.
Charles