1. Open the URL in Postman: http://api.pcs.wjdev.chinamcloud.cn/v1/assets/upload, upload a file, and the response fails, as shown in Figure 1

2019-09-29 17:19:34 [10.42.165.54][8][-][warning][yii\validators\FileValidator::validateValue] Missing the temporary folder to store the uploaded file: 360wallpaper(0).jpg
in /mcloud/www/pcs-api/api/rests/asset/UploadAction.php:84
2. Check /runtime/logs/app.log, and the error is: [warning][yii\validators\FileValidator::validateValue] Missing the temporary folder to store the uploaded file: 360wallpaper(0).jpg
3. Roll back to the previous version, where no error occurs. Check the Git log to analyze the differences, as shown in Figure 2

4. Check the upload_tmp_dir value under File Uploads, ;upload_tmp_dir =, which is the temporary directory used to store files when uploading. It must be writable by the user running PHP. If not specified, PHP will use the system default. The system’s default temporary directory is /tmp. Check the permissions of the /tmp directory in the current version, as shown in Figure 3

drwxrwxr-x 1 root root
5. Check the permissions of the /tmp directory in the previous version. There is a difference in permissions. The analysis leads to the conclusion that the cause is: the /tmp directory was overwritten, which in turn caused the permissions to be modified, as shown in Figure 4

drwxrwxrwt 1 root root
6. Move /build/c_files/tmp/yii-cmc-console-user-sync.ini and /build/c_files/tmp/yii-config-column-user-sync.ini to /build/c_files/mcloud/yii-cmc-console-user-sync.ini and /build/c_files/mcloud/yii-config-column-user-sync.ini, as shown in Figure 5

7. Edit \build\c_files\config\init\console_init.sh, replacing /tmp with /mcloud. The code is as follows, as shown in Figure 6

env | grep PCS_API_CFG_CONSOLE || export PCS_API_CFG_CONSOLE="false"
if [[ $PCS_API_CFG_CONSOLE == "true" ]]
then
\cp /mcloud/yii-cmc-console-user-sync.ini /etc/supervisord.d/
echo "复制 yii-cmc-console-user-sync.ini 至 /etc/supervisord.d/"
\cp /mcloud/yii-config-column-user-sync.ini /etc/supervisord.d/
echo "复制 yii-config-column-user-sync.ini 至 /etc/supervisord.d/"
elif [[ $PCS_API_CFG_CONSOLE == "false" ]]
then
echo "copy without console"
else
echo "please set environment variable PCS_API_CFG_CONSOLE true or false"
fi
8. Open the URL in Postman: http://api.pcs.wjdev.chinamcloud.cn/v1/assets/upload, upload a file, and the response is successful, as shown in Figure 7

