Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2005-09-16 18:49:27

jdueck
Plugin Author
From: Minneapolis, MN
Registered: 2004-02-27
Posts: 147
Website

OK let's get this working on IIS

I have a site running g1.19 on IIS that’s doing ok, but you know, it’s good to upgrade. So I got a sandbox database/site ready and boy am I glad I didn’t just do a cutover upgrade cause there are some issues.

Since this is not a time-critical upgrade, I am taking my time and documenting everything I can about txp on IIS, which won’t be a lot since I am not an IIS expert but I have a little experience.

Any input on these issues?

  1. Language updates aren’t working: Warning: gzinflate(): data error in C:\Inetpub2\zeta\sporck\textpattern\lib\IXRClass.php on line 556 – but I suspect this is problem with the language server
  2. All slashes and double quotes are escaped (in forms, pages, etc).

(folder names have been changed)

<pre><code>
Textpattern version: 4.0.1 (r888)
last_update: 2005-09-15 21:56:35/2005-09-15 21:50:22
Document root: C:\\Inetpub2\\zeta (C:\Inetpub2\zeta)
$path_to_site: C:\\Inetpub2\\zeta\\sporck
Textpattern path: C:\Inetpub2\zeta\sporck\textpattern
Permanent link mode: messy
upload_tmp_dir: C:\PHP_upload_tmp
Temp folder:
Site URL: www.zeta.com/sporck
PHP version: 4.3.2
Register globals: 1
Magic quotes: 1/1
MySQL: 3.23.49-nt
Locale: English_United States.1252
Server: Microsoft-IIS/6.0

Pre-flight check:
————————————
Temp folder is not writable:
C:\Inetpub2\zeta\sporck\textpattern\setup\ still exists
no_temp_dir
————————————

.htaccess file contents:
————————————
#DirectoryIndex index.php index.html
#Options +FollowSymLinks
#RewriteBase /relative/web/path/

<IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{REQUEST_FILENAME} -f [OR] RewriteCond %{REQUEST_FILENAME} -d RewriteRule ^(.+) – [PT,L]

RewriteRule ^(.*) index.php </IfModule> ———————————— </pre></code>

Offline

#2 2005-09-16 19:52:32

jdueck
Plugin Author
From: Minneapolis, MN
Registered: 2004-02-27
Posts: 147
Website

Re: OK let's get this working on IIS

Haven’t touched clean urls yet, but I’ll be looking at getting that working (with ISAPI Rewrite) & documenting it, after I get these showstoppers worked out.

Offline

#3 2005-09-17 04:17:42

zem
Developer Emeritus
From: Melbourne, Australia
Registered: 2004-04-08
Posts: 2,579

Re: OK let's get this working on IIS

You might also like to take a look at this thread.


Alex

Offline

#4 2005-09-18 21:44:08

jdueck
Plugin Author
From: Minneapolis, MN
Registered: 2004-02-27
Posts: 147
Website

Re: OK let's get this working on IIS

I looked at it and tried to examine a var_dump…but my immediate problem is, something magical is happening with quotes. Every time I modify or save a page, for example, another level of slash-escaping is added.

So now my page code looks like:
<pre><code>&lt;html xmlns=\\\“http://www.w3.org/1999/xhtml\\\” xml:lang=\\\“en\\\” lang=\\\“en\\\”>
&lt;head> &lt;meta http-equiv=\\\“content-type\\\” content=\\\“text/html; charset=utf-8\\\” /> &lt;link rel=\\\“stylesheet\\\” href=\\\”<txp:css />\\\” type=\\\“text/css\\\” media=\\\“screen\\\” /></code></pre>

And my var_dump looks like:

<pre><code>
&lt;pre>
&lt;?php var_dump($GLOBALS[\‘pretext\’]);
?>
&lt;/pre>
</code></pre>

So I need to get rid of those slashes some how.

Offline

#5 2005-09-18 21:50:25

jdueck
Plugin Author
From: Minneapolis, MN
Registered: 2004-02-27
Posts: 147
Website

Re: OK let's get this working on IIS

I wonder if the php/mysql versions on the server are just out of date.

Offline

#6 2005-09-26 21:05:05

jdueck
Plugin Author
From: Minneapolis, MN
Registered: 2004-02-27
Posts: 147
Website

Re: OK let's get this working on IIS

bump

Offline

#7 2005-09-27 02:35:20

zem
Developer Emeritus
From: Melbourne, Australia
Registered: 2004-04-08
Posts: 2,579

Re: OK let's get this working on IIS

Textpattern strips out slashes in the ps() and gps() functions in txplib_misc.php. Perhaps you can do some var_dump()s in that function and see why they’re not being stripped.

You’ll be able to stop it by changing the magic_quotes ini setting, but that won’t help others – it’d be much better to find out why it’s not working in the first place.


Alex

Offline

#8 2005-09-27 22:04:12

jdueck
Plugin Author
From: Minneapolis, MN
Registered: 2004-02-27
Posts: 147
Website

Re: OK let's get this working on IIS

I had some time to look at this today. I changed part of the gps() to look like this:

<pre><code>
} elseif (isset($_POST[$thing])) {

echo ‘&lt;pre>magic quotes:’.get_magic_quotes_gpc().’&lt;/pre>’;

if (get_magic_quotes_gpc()) { echo ‘&lt;pre>back in gps():’.var_dump(doStrip($_POST[$thing])).’&lt;/pre>’; return doStrip($_POST[$thing]); } else { return $_POST[$thing]; } } return ‘’; }
</code></pre>

What I found is that A) my debug statements are reached, so get_magic_quotes is detecting properly, and B) doStrip($_POST[$thing]) does in fact return a stripslash()ed copy of the data as it should (I tested it on the presentation > pages tab in txp, saving a page).

So the problem is upstream from gps somewhere. …

Last edited by jdueck (2005-09-27 22:05:06)

Offline

#9 2005-09-27 23:05:11

zem
Developer Emeritus
From: Melbourne, Australia
Registered: 2004-04-08
Posts: 2,579

Re: OK let's get this working on IIS

Try applying this change to txplib_db.php.


Alex

Offline

#10 2005-09-28 00:22:46

jdueck
Plugin Author
From: Minneapolis, MN
Registered: 2004-02-27
Posts: 147
Website

Re: OK let's get this working on IIS

I saw that…I wondered if it was just for me :)

Offline

#11 2005-09-28 01:51:11

zem
Developer Emeritus
From: Melbourne, Australia
Registered: 2004-04-08
Posts: 2,579

Re: OK let's get this working on IIS

We’ve had occasional reports of problems. Apparently it’s been overlooked until now – it’s rare for that to be on by default.


Alex

Offline

#12 2005-09-28 03:00:30

jdueck
Plugin Author
From: Minneapolis, MN
Registered: 2004-02-27
Posts: 147
Website

Re: OK let's get this working on IIS

you know what…that worked!

On to clean urls…as soon as I return from nothern michigan on sunday.

Offline

#13 2005-09-28 03:15:37

jdueck
Plugin Author
From: Minneapolis, MN
Registered: 2004-02-27
Posts: 147
Website

Re: OK let's get this working on IIS

clean urls are working using ISAPI rewrite, but only section/id/title … If I get time next week I will try and make rules for the other url formats.

Offline

#14 2005-10-04 21:19:58

aesop1
Archived Plugin Author
Registered: 2004-09-19
Posts: 142

Re: OK let's get this working on IIS

It would be cool if you could post the regexp (I think ISAPI Rewrite requires those, right?) and what you had to do to get ISAPI Rewrite playing nice with both TXP and IIS. Maybe a step-by-step?

I wrestled with TXP/IIS months ago and just bagged it for a Linux box/Apache.

Offline

#15 2005-10-04 21:51:26

jdueck
Plugin Author
From: Minneapolis, MN
Registered: 2004-02-27
Posts: 147
Website

Re: OK let's get this working on IIS

I certainly don’t recommend IIS. If you were able to use an Apache/*nix type setup, I’d say stick with it.

I didn’t have to handle the installation of ISAPI Rewrite, I got the admins at the hosting company to do that. After it is installed, put a text file called <code>httpd.ini</code> in the public root dir of your web site.

ISAPI Rewrite’s regexp syntax is slightly different than mod_rewrite’s syntax. Here’s what my <code>httpd.ini</code> looks like (sort of):

<pre><code>[ISAPI_Rewrite]

RewriteRule /news/(CompanyNews|Articles|Events)$ /index.php\?s=news&c=$1 [I,O,U,L]
RewriteRule /(?:news|about|services|contact|case|client)/(\d+)/(.*) /index.php\?id=$1 [I,O,U,L]
RewriteRule /(news|about|services|contact|case|client)(/*)$ /index.php\?s=$1 [I,O,U]
</code></pre>

There is probably a better way to do it, but this is what I have found that works. The only thing is A) this only works for the “section/id/title” url scheme and B) you have to edit your <code>httpd.ini</code> every time you add a new section, although you probably don’t need to do that very often.

Last edited by jdueck (2005-10-04 21:52:58)

Offline

Board footer

Powered by FluxBB