Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Running the following command:

> sudo pecl install spidermonkey

I receive the following error:

... a bunch of successful checks ...
checking whether to enable spidermonkey support... yes, shared
configure: error: jsapi.h not found. Please reinstall libjs.
ERROR: `/var/tmp/spidermonkey/configure' failed

I attempted to remedy the problem by installing js-devel, which, after wrestling with various yum repositories, I finally did manually like so:

> wget
> wget
> yum install js-1.60-1.el6.rf.x86_64.rpm
> yum install js-devel-1.60-1.el6.rf.x86_64.rpm

(Not sure why js-devel required js to be installed first ... but, it complained when I tried to install js-devel solo.)

Re-running the pecl install, I receive the same error. Is my understanding that the js-devel package contains the libjs stuff simply incorrect? Are there additional steps? Or, do I need to look elsewhere to get libjs?

ADDENDUM: I also tried removing the above packages (using yum) and installing these builds:

> wget
> yum install js-1.70-12.puias6.x86_64.rpm
> wget
> yum install js-devel-1.70-12.puias6.x86_64.rpm

No dice. The command line js interpreter works perfectly. But, PECL yields the same error.

share|improve this question

While this doesn't address the problem of the package not installing correctly using the package manager, the steps in this article left me with spidermonkey functioning correctly in PHP:

This is a workaround, in my opinion. I'm assuming the PECL package installed through the pecl package manager is intended to work correctly. So, I'm still interested in other more qualified answers.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.