Note: You are currently viewing documentation for Moodle 2.6. Up-to-date documentation for the latest stable version of Moodle may be available here: TMPFS.

TMPFS

From MoodleDocs

On Solaris:

/tmp is mounted swapfs and is it correct to put the eaccelerator files into /tmp/eaccelerator. You will have to remake the directory after a reboot.

On Ubuntu (Linux):

In linux tmpfs can be used in the same way as Solaris, either on /tmp or elsewhere.

mkdir /var/tmp/eaccelerator
sudo chown www-data.www-data /var/tmp/eaccelerator
sudo mount -t tmpfs tmpfs /var/tmp/eaccelerator

Now put it in your /etc/fstab:

tmpfs /var/tmp/eaccelerator tmpfs defaults 0 0

In your php.ini, change this line to:

eaccelerator.cache_dir="/var/tmp/eaccelerator"

And restart Apache:

sudo /etc/init.d/apache2 restart

You now don't have to recreate the /var/tmp/eaccelerator directory after the reboot, and the tmpfs will automount.

If you are VERY clever, then you might copy the cached files off of the tmpfs when apache stops and copy the cached files back on when apache starts.

See Also: