我在 public html 資料夾旁邊建立了一個資料夾,並將這些程式碼放在 index.php 的最一開始。
工作階段資料夾的位置
/domains/account/session
index.php 的位置
/domains/account/public_html/index.php
我在 index.php 的第 0 行放的程式碼
<?php
ini_set('session.save_path',realpath(dirname($_SERVER['DOCUMENT_ROOT']) . '/../session'));
session_start();
這是唯一對我有用的解決方案。希望這能幫助到其他人。