Symptoms
- On a Plesk for Linux server, an error similar to below one occurs on attempt to use the command
pecl install
:# /opt/plesk/php/7.1/bin/pecl install memcached
…
shtool at ‘/tmp/memcached/build/shtool’ does not exist or is not executable.
Make sure that the file exists and is executable and then rerun this script.
ERROR: `phpize’ failed - The directory
/tmp
is mounted with the flagÂnoexec
:# mount | grep /tmp
tmpfs on /tmp type tmpfs (rw,nosuid,noexec,noatime)
Cause
Installation of PHP modules fails because of the noexec
flag on the /tmpÂ
directory.
Resolution
Use one of the solutions:
Remount the directory /tmp
-
Connect to the server using SSH.
-
Remount the directory
/tmp
with the flagexec
:# mount -o remount,exec /tmp
Use another temporary directory
-
Connect to the server using SSH.
-
Create new temporary directory on a partition that mounted with
exec
option, for example:# mkdir /root/tmp
-
Change temporary directory for
pecl
to this newly created directory:# /opt/plesk/php/7.1/bin/pear config-set temp_dir /root/tmp
or
# /opt/plesk/php/7.1/bin/pecl config-set temp_dir /root/tmp