Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Re: Commenting not working properly - URL is broken
But I’m not sure where that is being set?
See the above linked thread: http://forum.textpattern.com/viewtopic.php?id=10190
We need the request_uri to have a target action (this is because comments can appear in any aprt of the site at any url – independent of the article that it is linked to). IIS and PHP are not that good of a match, because depending on the server-configuration some variables are not being set. This code is from pretext():
$out['request_uri'] = serverSet('REQUEST_URI');
$out['qs'] = serverSet('QUERY_STRING');
// IIS - can someone confirm whether or not this works?
if (!$out['request_uri'] and $argv = serverSet('argv'))
$out['request_uri'] =
substr($argv0, strpos($argv0, ‘;’ + 1));@
Maybe you can talk with your server admin, and make sure that the environment variable $_SERVER[‘REQUEST_URI’] gets set.
—
Btw: Here is more on the PARTLY_MESSY stuff. It basically uses messy urls for comments and would incidently solve your comment problem as well (but it has potentially some drawbacks as explained in the article).
Offline
#14 2005-12-28 20:41:20
- bruno1378
- Member
- Registered: 2005-12-22
- Posts: 22
Re: Commenting not working properly - URL is broken
Hi Sencer,
Thanks for your comment.
I had completely missed this line in comment.php
<code>
$url = $GLOBALS[‘pretext’][‘request_uri’];
</code>
what is pretext()?
And this is running on my local machine, so how do I check to make sure that the variable $_SERVER[‘REQUEST_URI’] is being set? When I look at phpinfo() I do not see REQUEST_URI under Enviorment…..should I?
Offline
#15 2005-12-28 20:43:13
- bruno1378
- Member
- Registered: 2005-12-22
- Posts: 22
Re: Commenting not working properly - URL is broken
when i tried to echo that variable on a test page on my local machine, i get this error:
Notice: Undefined index: REQUEST_URI in D:\My Documents\Web\servervariables.php on line 10
Offline
#16 2005-12-28 20:45:50
- bruno1378
- Member
- Registered: 2005-12-22
- Posts: 22
Re: Commenting not working properly - URL is broken
could I edit comment.php to use SCRIPT_NAME instead?
Offline
#17 2005-12-28 20:52:59
- bruno1378
- Member
- Registered: 2005-12-22
- Posts: 22
Re: Commenting not working properly - URL is broken
i saw on another forum that IIS does not support request_uri and they recommened this:
<code>
if (!isset($_SERVER[‘REQUEST_URI’])) {
$_SERVER[‘REQUEST_URI’] = $_SERVER[“SCRIPT_NAME”] .
$_SERVER[‘QUERY_STRING’];
}
</code>
i guess i’d have to do that in pretext but i’m not sure where that is yet….
Last edited by bruno1378 (2005-12-28 21:17:35)
Offline
#18 2005-12-28 21:06:49
- bruno1378
- Member
- Registered: 2005-12-22
- Posts: 22
Re: Commenting not working properly - URL is broken
Ok I played around a bit and added this to the top of publish.php
<code>
if (!isset($_SERVER[‘REQUEST_URI’])) {
$_SERVER[‘REQUEST_URI’] = $_SERVER[“SCRIPT_NAME”];
if (isset($_SERVER[‘QUERY_STRING’])) {
$_SERVER[‘REQUEST_URI’] = $_SERVER[‘REQUEST_URI’].”?”.$_SERVER[‘QUERY_STRING’];
}
}
</code>
and now all seems to be working ok for the moment. does anyone know of any reason this would be bad to do? this is something that should go into the product itself and it would certainly help all future IIS users, how can I make that recommendation?
Last edited by bruno1378 (2005-12-28 21:07:06)
Offline
Re: Commenting not working properly - URL is broken
Are you using clean or messy urls? Which method of clean urls are you running? Are you running IIS with php as module, or as CGI? Which version of IIS are you using? Thanks for your cooperation. :)
Offline
#20 2005-12-28 21:39:18
- bruno1378
- Member
- Registered: 2005-12-22
- Posts: 22
Re: Commenting not working properly - URL is broken
messy URLs for the moment, as I don’t have anything installed to rewrite the URL’s on IIS, and I don’t really care too much about the URLs – google and other SE’s index dynamic pages just fine.
>>Are you running IIS with php as module, or as CGI?
How do I tell? I just did the basic PHP install…
IIS version is v5.1 I believe, I’m on WinXP Pro – not even Windows Server. :-)
Offline
Re: Commenting not working properly - URL is broken
What is a basic php-install? Do you remember reading or configuring anything about php5isapi.dll or php-cgi.exe somewhere along the way? You may also just look into diagnostics which may tell you the answer.
Out of curiosity: Why are you trying to make it run on such a system, when that’s hardly the envirnoment where a site is going to be in production, when it is so much easier and more reliable to use Apache for local-hosted experimenting?
Offline
#22 2005-12-28 21:59:23
- bruno1378
- Member
- Registered: 2005-12-22
- Posts: 22
Re: Commenting not working properly - URL is broken
Sencer,
I work at a company that is pretty standarized on MS, and they are looking into implementing a blog for discussion points during webinars. We will likely start out with something hosted like blogger to see if it’s worth pursuing, but if so, we’ll probably want to host it ourselves. I’m personally somewhat familiar with PHP, and can kinda muck my way through MySQL as I’m familiar with SQL Server, but have no knowledge of Apache. I tried installing it locally to see if I could run it and IIS together, and things did not go smoothly.
Also, for my own personal use, I’d like to host a blog from my home computer which is connected to the internet with a static IP, and now, a domain pointing to it as well. Home computer is also XP Pro, so would like to find a solution that will work for both these situations. Currently torn between Textpattern and Nucleus CMS.
So in other words, this is almost exactly the environment it’ll be on in production. :-)
A basic PHP install means I downloaded the Windows installed and ran it. I didn’t configure anything special, just let it do it’s thing. If I had to guess I’d say it’s running as a CGI….but I’m not entirely sure how to verify.
Offline
Re: Commenting not working properly - URL is broken
Yeah, sounds like plenty of good reasons. :)
When you run a php file with <?php phpinfo() ?>
it should mention the Server API somewhere right along the first block or so.
Offline
#24 2005-12-28 22:45:11
- bruno1378
- Member
- Registered: 2005-12-22
- Posts: 22
Re: Commenting not working properly - URL is broken
indeed it does:
CGI/FastCGI
(btw is it just me or did the forums lose their nice yellow glow?)
Offline