简体   繁体   English

缺少临时文件夹 wordpress 上传

[英]missing a temporary folder wordpress upload

I have a wordpress installed .我安装了 wordpress。 Host provider is 1&1.主机提供商是 1&1。 Now if i tried to upload media file it show me the error missing a temporary folder .现在,如果我尝试上传媒体文件,它会显示缺少临时文件夹的错误。 I also define a path fpr temp directory .我还定义了一个路径 fpr temp directory 。 I refer this link link .我指的是这个链接链接 And created the php.ini file in the home directory .并在主目录中创建了 php.ini 文件。 My php.ini file content is我的 php.ini 文件内容是

upload_max_filesize = 16M
upload_tmp_dir = on
upload_tmp_dir = /epigram.co.uk/tmp

I also tried to change wp-config file and added this我也尝试更改 wp-config 文件并添加了这个

define('WP_TEMP_DIR','/epigram.co.uk/tmp');

Also tried with full path .还尝试使用完整路径。 like喜欢

define('WP_TEMP_DIR',$_SERVER['DOCUMENT_ROOT'].'/tmp');

Nothing helped me .没有任何帮助。 any help will be appreciated .Thanks任何帮助将不胜感激。谢谢

Edit your php.ini file which is located in etc/ folder, remove comment from the line upload_tmp_dir (by deleting the semi-colon “;”) and pointing the variable to a folder using an absolute path.编辑位于etc/文件夹中的php.ini文件,从upload_tmp_dir行中删除注释(通过删除分号“;”)并使用绝对路径将变量指向文件夹。

1.) open a terminal 1.) 打开一个终端

2.) create a temporary folder for all apache tasks in your user folder and grant all right to all users: 2.) 在您的用户文件夹中为所有 apache 任务创建一个临时文件夹,并授予所有用户所有权限:

mkdir wwwtmp && chmod 0777 wwwtmp

3.) edit php.ini with your text editor and set the temporary folder (you must switch to root user) 3.) 用你的文本编辑器编辑 php.ini 并设置临时文件夹(你必须切换到 root 用户)

 su
 vim /opt/lampp/etc/php.ini
 upload_tmp_dir = /home/my_user/wwwtmp/

Remeber to remove preceding “;”记得去掉前面的“;”

4.) save the file (in vim type :wq an press enter) and restart xampp using this command 4.) 保存文件(在 vim 中输入:wq 并按 Enter)并使用此命令重新启动 xampp

/opt/lampp/./lampp restart

I hope this will remove error if everything went fine.如果一切顺利,我希望这会消除错误。

Problem : WordPress is giving error on image upload : "image.jpg" has failed to upload due to an error "Missing a temporary folder."问题:WordPress 在上传图片时出错:“image.jpg”由于“缺少临时文件夹”错误而无法上传。

If you are receiving this error please follow these simple instructions below:如果您收到此错误,请按照以下简单说明进行操作:

  1. Create a "tmp" folder in your WordPress root directory with 777 permissions.在您的 WordPress 根目录中创建一个具有777权限的"tmp"文件夹。 This can be done by your FTP program.这可以通过您的 FTP 程序来完成。

  2. Also create a "php.ini" file in same location.还要在同一位置创建一个"php.ini"文件。

  3. Add the following in php.ini file:在 php.ini 文件中添加以下内容:

    upload_max_filesize = 16M

    upload_tmp_dir = on

    upload_tmp_dir = /home/username/public_html/wordpressDir/tmp

Please make sure to replace username with your hosting username, and wordpressDir with the directory name of your WordPress install.请确保将 username 替换为您的托管用户名,并将 wordpressDir 替换为 WordPress 安装的目录名称。 If you have installed WordPress on your homepage then the path will be like: upload_tmp_dir = /home/username/public_html/tmp如果您在主页上安装了 WordPress,那么路径将类似于:upload_tmp_dir = /home/username/public_html/tmp

  1. Copy the same php.ini file to your wp_admin folder.将相同的 php.ini 文件复制到 wp_admin 文件夹。

That's it.就是这样。

My server is a shared one powerd by plesk.我的服务器是由 plesk 提供支持的共享服务器。 I just changed the PHP vesion from 7.something to 5.something, and the problem was solved!我刚刚将PHP版本从7.something更改为5.something,问题就解决了! I can upload images to the wordpress media galery我可以将图片上传到 wordpress 媒体库

On Linux at aws.在 aws 的 Linux 上。 The below worked for me以下为我工作

chmod -R 775 /tmp

This error can happen if you are using IIS server and a fastCGI module with Thread-safe version of Php.如果您使用 IIS 服务器和带有线程安全版本的 Php 的 fastCGI 模块,则可能会发生此错误。 As the Php download page states:正如 PHP 下载页面所述:

IIS If you are using PHP as FastCGI with IIS you should use the Non-Thread Safe (NTS) versions of PHP. IIS 如果您将 PHP 作为 FastCGI 与 IIS 一起使用,您应该使用 PHP 的非线程安全 (NTS) 版本。

Hope this helps someone.希望这可以帮助某人。

Add From Server plugin saved my time.添加从服务器插件节省了我的时间。 it's easy to use, just upload your image through ftp and use Add from sever plugin to import to your Media Library.它易于使用,只需通过 ftp 上传您的图像并使用 Add from sever 插件导入到您的媒体库中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM