马根托。目标文件夹不可写或不存在
嘿,我遇到了以下问题,请帮忙。
尝试将图像添加到产品时,我收到“目标文件夹不可写..”,但所有所需文件夹的权限为777!我删除了服务器上的所有文件,没有触及数据库,使用新数据库从头开始重新安装 Magento,一切正常。 但是当我切换到以前的数据库(更改 local.xml 中的设置)时,错误再次出现。
数据库如何影响文件夹权限?
更新:
非常感谢,我们发现 Magento 从这个方法跳转
public function getBaseMediaUrl()
{
return Mage::getBaseUrl('media') . 'catalog/product';
}
到以下方法:
public function getBaseTmpMediaUrl()
{
return Mage::getBaseUrl('media') . 'tmp/catalog/product';
}
有谁知道为什么以及如何???
Hey I'm stuck with the following problem, plz help.
I get "Destination folder is not writable.." when trying to add an image to a product, but the permission for all needed folders is 777! I had deleted all files on server, didn`t touch DB, reinstalled Magento from scratch with new DB, and everything is OK.
But when I switched to previous DB (change settings in the local.xml) the bug appeared again.
How can the DB impact the folder permissions?
UPDATE:
Thanx a lot, we found out that Magento jump from this method:
public function getBaseMediaUrl()
{
return Mage::getBaseUrl('media') . 'catalog/product';
}
to the following method:
public function getBaseTmpMediaUrl()
{
return Mage::getBaseUrl('media') . 'tmp/catalog/product';
}
Does anybody know why and how????
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(7)
Magento 代码库中只有一个位置使用该错误语言。
在上面添加一些临时调试代码这
将使您知道 Magento 想要写入但不能写入的确切文件夹。检查这个文件夹,你会发现它不可写。查看 is_writable 上的边缘情况也可能有助于阐明该主题。
There's only one spot in the Magento code base that uses that error language.
Add some temporary debugging code right above this
This will let you know the exact folder Magento wants to write to, but can't. Examine this folder, and you'll find it's not writable. Reviewing the edge cases on is_writable may also shed some light on the subject.
转到:lib/Varien/File/Uploader.php
临时更改以下代码并尝试上传图像。现在在错误消息中您可以看到文件夹路径。
在文件夹路径中,您必须授予文件权限 777,它将正常工作。错误解决后,将代码恢复到原来的状态。
Goto : lib/Varien/File/Uploader.php
Temporary change the following code and try to upload image. Now in error message you can see folder path.
In folder path you have to give file permission 777 and it will work as normal. After the error is resolved revert your code to as it wass.
我在 Magento 中上传图像时遇到以下错误,然后我执行了以下步骤,这对我有用。
然后重新启动阿帕奇..
I got the below error while uploading images in Magento then I did the below steps and that worked for me.
then restart apache ..
Magento 2
这是 Magento 2 中的文件,错误来自于:
vendor/magento/framework/File/Uploader.php
在第
256
行,您可以暂时将此代码放置到获取不可写/不存在的文件夹:否则,您可以检查您是否拥有这些文件夹,并且这些文件夹可由网络服务器写入:
pub/media/catalog/
pub/media/catalog/category
pub/media/catalog/product
pub/media/images
pub/media/wysiwyg/
Magento 2
This is the file in Magento 2 where the error come from:
vendor/magento/framework/File/Uploader.php
At line
256
you can temporarily place this code to get the unwritable/unexisting folder:Otherwise you can check you have these folders and that are writable by the web server:
pub/media/catalog/
pub/media/catalog/category
pub/media/catalog/product
pub/media/images
pub/media/wysiwyg/
这可能是 Plesk 管理部门颁发的过期证书(这是我的情况)。
我尝试了上面的步骤,但没有成功。从那里我尝试通过 FileZilla 访问文件以立即向所有文件夹授予权限,因此出现有关证书过期的错误消息。它不是商店本身的 SSL 证书,而是 Plesk 的管理。我创建了一个新的自签名证书,应用了其 Plesk 管理,一切都恢复正常。
这对我有用。我在这里留下我的贡献。
祝你好运
It may be the expired certificate from the Plesk administration (it was my case).
I tried the steps above, but it did not work. From there I tried to access the files through FileZilla to give the permissions at once to all folders, hence an error message about the expired certificate. It is not the SSL certificate of the store itself, but the administration of Plesk. I created a new self-signed certificate, applied its Plesk administration and everything went back to normal.
This worked for me. I leave here my contribution.
Good luck
我遇到了同样的问题:
登录到 SSH:
通过运行以下命令授予媒体文件夹权限:
I had the same problem:
Sign in to your SSH:
Give media folder permissions through run this command:
更改媒体文件夹的权限后,我的问题得到解决。只需找到服务器上的媒体文件夹,右键单击 -> 更改权限 -> 将文件夹权限设置为 777。
My issue is solved after changing the permissions of the media folder. Just go locate the media folder on your server, right click->change permissions->set value 777 for folder permissions.