gpt4 book ai didi

IIS上的Wordpress永久链接?

转载 作者:行者123 更新时间:2023-12-04 03:23:51 25 4
gpt4 key购买 nike

我正在Windows 7 IIS上使用WordPress进行开发。我正在WordPress中上传图片以撰写博客文章。该图像在网站上可以正常显示,但是一旦启用永久链接,这些图像将不再起作用,并且以后上传的任何图像都会返回一个错误:

HTTP Error 500.50 - URL Rewrite Module Error.
The page cannot be displayed because an internal server error has occurred.

我不确定为什么会这样,这是我的 web.config:

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="wordpress" patternSyntax="Wildcard">
<match url="*" />
<conditions>
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
</conditions>
<action type="Rewrite" url="index.php" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>

一旦我关闭永久链接并使用默认设置,任何人都知道为什么会这样吗?

最佳答案

The image issue was a permission issue, but simply setting it manually on the original image file or parent folder is inadequate. The behavior of WordPress is that it writes the original file using IUSR to a temporary system directory that is defined in the PHP.ini file. This temp folder does not have IIS_IUSRS permissions on it, so when windows moves this file from the temp folder to the application's upload folder, its final home, IIS_IUSRS only has read permissions, so the permissions are not inherited from the file's parent folder.

To fix this, there are two solutions.

  1. Change the permissions on the temp folder giving IIS_IUSRS write/modify.
  2. Change the path of the temp folder in the PHP.ini file to a folder that does have IIS_IUSRS write/modify permission.

Here is a good source detailing the problem: http://www.howyoudo.info/index.php/how-to-fix-windows-server-upload-file-inherit-permissions-error/

I chose to move the temp folder in my PHP.ini to C:\inetpub\temp\uploads and also give it permissions. After uploading an image in wp-admin, I was able to access the image (original, not resized) from a browser wihout the 500.50 error.



From source

关于IIS上的Wordpress永久链接?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4403514/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com