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 compling:
$ 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 filesystem 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





