Missing the temporary folder to store the uploaded file
1. Open the URL in Postman:http://api.pcs.wjdev.chinamcloud.cn/v1/assets/upload,Upload the file, the response failed, 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 report an error:[warning][yii\validators\FileValidator::validateValue]Missing the temperature folder to store the uploaded file: 360wallpaper(0).jpg
3. Go back to the previous version, no errors are reported, check the git log, and analyze the differences, as shown in Figure 2
4. Check the upload_tmp_dir value of file uploads; upload_tmp_dir =, the temporary directory used to store the file when uploading the file. Any user running PHP must be writable. If not specified, PHP will use the default value of the system. The default temporary directory of the system is /tmp, check the permissions of the current version /tmp directory, as shown in Figure 3
drwxrwxr-x 1 root root
5. Check the permissions of the previous version /tmp directory, there is a difference in permissions, and the analysis draws the conclusion, because the /tmp directory is overwritten and the permissions are modified, as shown in Figure 4
drwxrwxrwt 1 root root
6. Will /build/c_files/tmp/yii-cmc-console-user-sync.ini, /build/c_files/tmp/yii-config-column-user-sync.ini Shear to /build/c_files/mcloud/yii-cmc-console-user-sync.ini, /b uild/c_files/mcloud/yii-config-column-user-sync.ini, as shown in Figure 5
7. Edit \build\c_files\config\init\console_init.sh, replace /tmp to /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 the file, the response is successful, as shown in Figure 7






