duanjiati1755 2018-10-18 05:19
浏览 87

wordpress中的文件写作问题

I am trying to import demo content in my installed theme, but every time I try to import data by uploading the XML/JSON file, it throws an error.

I get this error while trying to import a widget file from the Tools->Widget Importer and Exports->uploading a .wie file.

enter image description here

I get this error while uploading demo content through a plugin One Click Demo Import.

enter image description here

It has two option

  1. Is click on upload button and then it automatically uploads the files.

  2. Is to uploading files manually (XML,JSON files).

When I do 2nd option, it sometimes gives a success message, but no changes reflect in theme or anywhere (If the data imports successfully, it creates demo pages which shows in Pages menu[worked on localhost]).

I am having this issue on the server (AWS Linux 2), everything is working fine on localhost. I have made some changes in the php.ini file also but didn't work (changed default values with this values).

upload_max_filesize (256M)
max_input_time (300)
memory_limit (256M)
max_execution_time (300)
post_max_size (512M)

Please suggest what else I can try.

  • 写回答

1条回答 默认 最新

  • dqyknf4423 2018-10-18 06:15
    关注

    This problem can have many causes.

    First, do you have enough space in your server?

    Second, can be due to wrong permissions in the wp-content. In order to fix it, recursively change group permissions of the folders and sub-folders of wp-content to enable write permissions and change file permissions to 664.

    If you're using FileZilla, just FTP to that server, right click in the folder, go to permissions and set it to 775 and apply recursively to subdirectories only. For the files, make sure they have 664 by recursively changing the permissions of files only.

    If you want to use a terminal, inside of wp-content:

    find . -type d -exec chmod -R 775 {} \;
    
    find . -type f -exec chmod -R 664 {} \;
    

    Thirdly, If you still see the error, then you will need to empty the temporary files directory.

    WordPress uploads your images using PHP which first saves the uploads to a temporary directory on your web server. After that it moves them to your WordPress uploads folder.

    If this temporary directory is full or is poorly configured, then WordPress will not be able to write the file to disk.

    If you have no idea where to find this folder, check: https://developer.wordpress.org/reference/functions/get_temp_dir/ . This method will allow you to reach that location. You can also check 'upload_tmp_dir' in php.ini.

    If no location is defined (which is very unlikely) you need to paste this code to the wp-config.php file just before the line that says ‘That’s all, stop editing! Happy blogging’.

    define('WP_TEMP_DIR', dirname(__FILE__) . '/wp-content/temp/');
    

    Next, you need to go to wp-content/ folder and create a new folder inside it. You need to name this new folder temp.

    Fourthly, check this other answer on stack: https://stackoverflow.com/a/16091596/5675325

    评论

报告相同问题?

悬赏问题

  • ¥15 微信会员卡接入微信支付商户号收款
  • ¥15 如何获取烟草零售终端数据
  • ¥15 数学建模招标中位数问题
  • ¥15 phython路径名过长报错 不知道什么问题
  • ¥15 深度学习中模型转换该怎么实现
  • ¥15 HLs设计手写数字识别程序编译通不过
  • ¥15 Stata外部命令安装问题求帮助!
  • ¥15 从键盘随机输入A-H中的一串字符串,用七段数码管方法进行绘制。提交代码及运行截图。
  • ¥15 TYPCE母转母,插入认方向
  • ¥15 如何用python向钉钉机器人发送可以放大的图片?