Supertext Home
Chief of the System Blog

Archive for the 'IIS' Category


Download failed. Could not open handle for fopen()

Thursday, July 14th, 2011

I tried to use the automatic update feature for WordPress Plugins on my Windows Server 2008 R2 with IIS7. I setup the FTP account and entered the setting in WordPress. But unfortunately it did not work.

After setting

define(‘WP_DEBUG’, true);

in the wp-config.php file I got the following error messages:

 

Updating Plugin SexyBookmarks (1/1)
Downloading update from
http://downloads.wordpress.org/plugin/sexybookmarks.4.0.4.2.zip…

Warning: touch() [function.touch]: Unable to create file C:\inetpub\wwwroot\some_blog/wp-content/sexybookmarks.tmp because Permission denied in C:\inetpub\wwwroot\some_blog\wp-admin\includes\file.php on line 177

Warning: fopen(C:\inetpub\wwwroot\some_blog/wp-content/sexybookmarks.tmp) [function.fopen]: failed to open stream: Permission denied in C:\inetpub\wwwroot\some_blog\wp-includes\class-http.php on line 1070

Warning: unlink(C:\inetpub\wwwroot\some_blog/wp-content/sexybookmarks.tmp) [function.unlink]: No such file or directory in C:\inetpub\wwwroot\some_blog\wp-admin\includes\file.php on line 489

An error occurred while updating SexyBookmarks: Download failed. Could not open handle for fopen() to C:\inetpub\wwwroot\some_blog/wp-content/sexybookmarks.tmp.

 

You need to do the following two things to fix this:

First, add this to your wp-config.php file:

define(‘WP_TEMP_DIR’,ABSPATH.’wp-content/uploads/’);

Second, give the IIS_IUSRS account read and write access to the wp-content folder.

That should help.


blogger.getUsersBlogs method received from the blog server was invalid

Wednesday, July 13th, 2011

Invalid response document returned from XmlRpc server

I’m using Windows Live Writer to publish to my WordPress 3.2 Blog that runs on a Windows Server 2008 R2. This all worked fine for a while until I upgraded the blog today. Now I got the following error message:

 

Can’t connect to your blog service:

Invalid Server Response – The response to the blogger.getUsersBlogs method received from the blog was invalid:

Invalid response document returned from XmlRpc server

Please try fixing the problem and then try again.

 

Lovely. Try fixing the problem or call the system administrator. Unfortunately I’m the administrator, so nobody there to call.

But then I remembered that I had a similar issue a while back. I wrote about it in the post WordPress XML-RPC Issues.

And, oh wonder, this solved the problem again!

Quick repetition:

Edit the class-IXR.php file from the wp-includes directory. Change

header(‘Content-Length: ‘.$length);

to

header(‘Content-Length: ‘.$length + 2);

And you are fine until next time.


IIS7: Worker process reached its allowed processing time limit

Wednesday, August 4th, 2010

You just lost your ASP.NET session object and your app restarted? Check the Event Log for the following message:

A worker process with process id of ’23232′ serving application pool ‘ASP.NET v4.0′ has requested a recycle because the worker process reached its allowed processing time limit.

I’ve already posted the solution for this for IIS6. It’s basically the same for IIS 7.

Go to the Application Pools section of your IIS. Right-click on the right pool and choose Recycling.

IIS7 Application Pool recycling

Here you can adjust when you want you Application Pool to recycle. No recycling is not really recommended. So either out put in a very high number of requests or you choose fixed time when you assume there are no users on your site.

Specify a time for recycling

We decided to just recycle during the night.

What would be nice is to get some kind of notification, so one could save all ASP.NET sessions and then restore them afterwards.


WordPress XML-RPC Issues

Wednesday, May 5th, 2010

After upgrading my wordpress blog I could not connect my Windows Live Writer anymore. Funny enough it will worked with my other blog (blog.supertext.ch). The only difference that I could find, was that remy.supertext.ch was configured to use iso-8859-1 and blog.supertext.ch used utf-8. But changing that did not actually help. Could be that the issue is some info that is still in the database.

Using the WordPress iPhone App, I got the following error:

NSXMLParserErrorDomain error 73

Does not really help either. But I found some posts, suggesting all kind of things that all didn’t apply or work.

Now, getting a little desperate, I installed Fiddler (which is really an awesome tool) and discovered that if I rerun the rpc call that Windows Live Writer is doing, I get a Content-Length mismatch Error:

image

Here is the request in raw form, you can try it yourself to see what results you get. Password/Username do not matter for the test, but you have to set the POST and Host value correctly:

POST http://blog.yourhost.ch/xmlrpc.php HTTP/1.1
Accept: */*
Accept-Language: en-US, en, *
User-Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Writer 1.0)
Content-Type: text/xml
Host: blog.yourhost.ch
Content-Length: 491
Connection: Close

<?xml version="1.0" encoding="utf-8"?>
<methodCall>
 <methodName>blogger.getUsersBlogs</methodName>
 <params>
  <param>
   <value>
    <string>ffffffabffffff716</string>
   </value>
  </param>
  <param>
   <value>
    <string>admin</string>
   </value>
  </param>
  <param>
   <value>
    <string>password</string>
   </value>
  </param>
 </params>
</methodCall>

I don’t really have an idea on how to fix this for real, but what helped is to just add 2 to the length of the response. Edit the class-IXR.php file from the wp-includes directory on line 396. I’m using WordPress Version 2.9.2

function output($xml) {
    $xml = '<?xml version="1.0"?>'."\n".$xml;
    $length = strlen($xml);
    header('Connection: close');
    header('Content-Length: '.$length  + 2);
    //+2 Solves the Live Writer issue
    header('Content-Type: text/xml');
    header('Date: '.date('r'));
    echo $xml;
    exit;
}

Just FYI:
I’m using IIS 6.0 on Windows 2003.


Unknown server tag ‘asp:ListView’

Saturday, November 8th, 2008

If you get this message after you upgraded to ASP.NET 3.5 and possible SP1, make sure you have the following settings correctly in your web.config file:

 

<assemblies> <add assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> <pages> <controls> <add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> <add tagPrefix="asp" namespace="System.Web.UI.WebControls" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> </controls> </pages>

And by the way, there is no ASP.NET 3.5 Version on the ASP.NET tab in the IIS 6.0. It’s still running on 2.0. Just in case you were trying to figure out what was wrong with your installation (I was too).


Supertext.ch is valid XHTML 1.0 Strict

Saturday, July 26th, 2008

Valid XHTML 1.0 Strict

I’ve always put some effort into making our homepage valid XHTML 1.0 Strict, but there was always the issue with ASP.NET not rendering the page correctly when the W3C validator visited the page. The first error message you get is:

Line 9, Column 11: there is no attribute “name”.

<form name="aspnetForm" method="post"
action="Default.aspx" id="aspnetForm">

The issue is explained here.

One workaround is to just copy&paste the source from a browser into the validation or as explained in the link above to create a browser capabilities (call it w3cvalidator.browser) file and copy it into the \App_Browsers directory of your ASP.NET project. Or into the .NET installation folder (this way all projects automatically work with the W3C validator. The directory is:

C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\CONFIG\Browsers

Unfortunately that did not do the trick for me. It only started working after I recompiled the server settings:

c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_regbrowsers.exe -i

I’ve had that problem before, when I had to update the CSS MenuAdapter.

Yes, I know, there are still some XHTML issues with the blog, but we are working on those too.

  • Topics
  • Archive
  • Subscribe
  • Facebook
  • Twitter