ASPNetFAQ.com: What is ASP.NET?

Technology posts on ASP.NET, IIS, Windows (+ a little Linux), Cloud Servers, Hosting, and more!
  • Blog Home
Search the site...

WordPress IIS and PNG Not Showing Up Headaches

Tweet
Share
0 Shares

Okay, this bit me again today, and I didn’t remember the solution from previous research so I had to research it again. That to me means I need to write it up in a blog post. :)

I’m running WordPress for this blog. It is hosted on a Windows 2012 R2 server (using IIS, not Apache) with the latest versions of PHP and MySQL installed.

Looking for the BEST WordPress Hosting?
Read my review of the Best WordPress Hosting or click the banner below to check out SiteGround's plans - starting under $4/month!
Do you already have a site? They'll migrate it for you - FREE!

Web Hosting

I uploaded a post earlier that had a PNG file screenshot included. The PNG file uploaded fine and showed up fine in the Media management screen of WordPress but it wouldn’t display in the actual post. The issue winds up being a permissions problem.

When a file is uploaded through WordPress it is actually uploaded through PHP (since WordPress is written in PHP). The way that PHP handles this is to upload the file first to a working temp directory and then move the file over to the appropriate location under the WordPress web root.

The temporary location that PHP uses is defined within the PHP.ini file under your PHP installation folder. By default it is commented out so that PHP will use whatever is defined as the system default. A good security practice would probably be to create a working folder location for PHP to use for temporary files and adjust the permissions on this folder as needed.

By default though it uses the system temp folder which would be found located at \Windows\temp\. This folder’s permissions show the IIS Users group with “special permissions”. If you edit those permissions and add the Read permissions, the problem will resolve itself.

IUSER-PHP-Temp-Permissions2

Now when a PNG (or any type of file) is uploaded it will hit this folder first, obtain the appropriate permissions for the anonymous IUSR to view the file, and get moved over to its correct home location under WordPress.

Note that if you don’t have control over all the code on the server and/or it is a shared server hosting for multiple sites/users then I’d recommend using a special folder just for PHP temp use rather than opening up Read access to that general/generic Windows temporary location.

Happy hosting!

More from my site

  • How do you add an existing user to the sudoers file?How do you add an existing user to the sudoers file?
  • How do I find my IP address in Ubuntu?How do I find my IP address in Ubuntu?
  • Video: ASP.NET Tutorial 1- Introduction and Creating Your First ASP.NET Web SiteVideo: ASP.NET Tutorial 1- Introduction and Creating Your First ASP.NET Web Site
  • Adding a Second Disk Live in VMware WorkstationAdding a Second Disk Live in VMware Workstation
  • Using URL ReWrite to host multiple sites/domains under a single siteUsing URL ReWrite to host multiple sites/domains under a single site
Tweet
Share
0 Shares

2 comments on “WordPress IIS and PNG Not Showing Up Headaches”

  1. Tauseef Alam says:
    September 6, 2014 at 12:32 pm

    Hi,

    I want to move my website on windows environment. I’ve hosted this website on WordPress and don’t want to change the platform. Let me know how can i achieve this.

    • Brad Kingsley says:
      September 8, 2014 at 1:18 pm

      Sure. Here is a good blog post on moving a WordPress site: terrid.me/blog-migration/

Proverbs 19:20

"Get all the advice and instruction you can, so you will be wise the rest of your life."

A Note On WordPress Hosting

Our main focus is of course .NET, but with a mix of Linux, virtualization, and other technologies. But if you're really looking for the best WordPress hosting specifically, read my WordPress host review to save yourself hassle AND money!




Recent Posts

  • What makes good web hosting?
  • jQuery Mobile C# ASP.NET and N5 Networks Software Repository
  • Open Source Bug Tracking Software and the Orchard Project
  • ASP.NET Development with Dreamweaver MX: Visual QuickPro Guide
  • Kendo UI Sample, ASP.NET Ajax Tutorial & More

Tags

ASP.NET Automation centos CMS css cytanium Development/Coding Email gmail Hosting htaccess http https IIS javascript Learning Linux logparser MySQL nginx openssl OrcsWeb performance PowerShell redirect RHEL security server SherWeb smtp SQL/Databases ssl System Administration telnet terminal tip Troubleshooting Ubuntu virtualization Visual Studio web farm web hosting Windows windows server Wordpress

Categories

  • ASP.net development
  • Development/Coding
  • Hosting
  • IIS (Internet Information Services)
  • SQL/Databases
  • System Administration
  • Virtualization
(c) ASPNETFAQ.com