You are reading

Fix PECL Error: '/bin/sh: bad interpreter: Permission denied'

Posted: January 27, 2010 | By: TJ | In Technology | No comments yet

Continuing off my last post on PECL issues, I’ve run into additional problems installing PECL extensions on my CentOS 5.4 server. Now that PECL is able to at least run, I was seeing permission issues as it finished compiling:

$ pecl install apc

downloading APC-3.0.19.tgz …
Starting to download APC-3.0.19.tgz (115,735 bytes)
…………………….done: 115,735 bytes
47 source files, building
running: phpize
Configuring for:
PHP Api Version: 20041225
Zend Module Api No: 20060613
Zend Extension Api No: 220060519
/usr/local/bin/phpize: /tmp/pear/temp/APC/build/shtool: /bin/sh: bad interpreter: Permission denied
Cannot find autoconf. Please check your autoconf installation and the $PHP_AUTOCONF environment variable. Then, rerun this script.

ERROR: ‘phpize’ failed

The problem is that for security reasons, the /tmp file system is mounted with the noexec flag. You can check this by executing the following command:

$ mount | grep \/tmp
simfs on /tmp type simfs (rw,noexec)
simfs on /var/tmp type simfs (rw,noexec)

To fix this, you can temporary remount the directory to make it executable. To do this, issue the following command:

$ mount -o remount,exec /tmp

Once you’ve installed the extension, remount the directory again to set it back to noexec:

$ mount -o remount,noexec /tmp

Comments for this entry

[...] stable patch method works well however it still requires you to compile PHP manually. This is considered the [...]

Have you a complete tutorial between Nginx 0.8.36 + php-fpm 5.3.2 + wordpress on Ubuntu 9.04. I need that, please.

Thank you before.

Thanks a lot for this very useful article. Everything works like a charm =)

Jim

Just want to say thank you for sharing your knowledge in this matter. Following the steps that you have outlined in this article I’ve been able to put a close to one frustration. Now smooth sailing until the next bug/errata surfaces. Thank you.

Just for the record, the problem seems to be fixed in apc-beta.

You can ‘sudo pecl install apc-beta’, and it installs fine, at least on Lucid.

Super-helpful. Thanks!

Michael

Confirmed. `pecl install apc-beta` also works here (Fedora Core 13). As of 2010.08.14, the beta APC that I grabbed and installed is 3.1.4.

marcofang

This is short and easy, also proved super useful! Thanks the great snippet.

BTW, the “copy to clipboard” js function includes the leading “$” symbol in the clipboard.

Leave your comment



Copyright © 2010. All rights reserved.

This blog is powered by WordPress and proudly hosted by (mt) Media Temple.