chmod 777 /dev/shm/tmp
mount -B /dev/shm/tmp /tmp
將php的session文件放在/tmp下
vim /etc/php.ini
有則修改,無則添加
session.save_path = “/tmp”
/dev/shm/tmp目錄重啟以后會丟失,設置重啟自動重新添加/dev/shm/tmp
touch shmTmp.sh
chmod x shmTmp.sh
vim shmTmp.sh
添加:
#!/bin/bash
mkdir /dev/shm/tmp
chmod 777 /dev/shm/tmp
mount -B /dev/shm/tmp/ /tmp
設置開機自動執行腳本
vim /etc/rc.local
末尾添加:
/root/shmTmp.sh
保存退出,增加執行文件屬性
chmod x /etc/rc.local
更多關于云服務器,域名注冊,虛擬主機的問題,請訪問三五互聯官網:m.shinetop.cn