php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #57507 when htscanner.so is loaded, php gives no commandline output (shell)
Submitted: 2007-02-03 11:56 UTC Modified: 2007-02-19 05:34 UTC
From: wouter at widexs dot nl Assigned: pajoye (profile)
Status: Closed Package: htscanner (PECL)
PHP Version: 0.6.3 OS: FreeBSD 6.2 / Linux
Private report: No CVE-ID: None
 [2007-02-03 11:56 UTC] wouter at widexs dot nl
Description:
------------
As soon as htscanner.so get's loaded, running `php -v` for example gives no output (on the shell, compiled as CGI)

Observe :

[user@s02 ~]# php -v
[user@s02 ~]#

Skipping loading ini files :

[user@s02 ~]# php -v
PHP 5.2.0 (cgi) (built: Jan 16 2007 20:17:38)
Copyright (c) 1997-2006 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2006 Zend Technologies
[user@s02 ~]#

Disabling htscanner.ini :

mv htscanner.ini htscanner.ini-disabled

[user@s02 ~]# php -v
PHP 5.2.0 (cgi) (built: Jan 16 2007 20:17:38)
Copyright (c) 1997-2006 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2006 Zend Technologies
[user@s02 ~]#

I've only verified this on multiple FreeBSD 6.x machines, with PHP 5.2.0

htscanner.ini looks like this :

[htscanner]
extension="htscanner.so"
config_file=".htaccess"
default_docroot="/"
default.ttl=300

I've tried various options in this file, none had impact.

Reproduce code:
---------------
php -v

Expected result:
----------------
PHP 5.2.0 (cgi) (built: Jan 16 2007 20:17:38)
Copyright (c) 1997-2006 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2006 Zend Technologies


Actual result:
--------------
(nothing)

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-02-04 06:38 UTC] pierre dot php at gmail dot com
Which version of htscanner do you use?
 [2007-02-04 11:14 UTC] wouter at widexs dot nl
htscanner 0.6.3

I've verified this issue also on Linux.
Only tried with PHP 5.2.0
 [2007-02-04 11:23 UTC] pierre dot php at gmail dot com
It may be due to the lack of document root.

Can you try to add:
zend_error(E_WARNING, "No path translated, cannot determine the current script\n");

on line 335. You will end with something like:

if (doc_root == NULL) {
    zend_error(E_WARNING, "No path translated, cannot determine the current script\n");
}

I cannot test myself before tomorrow. Let me know what you get.
 [2007-02-04 11:44 UTC] wouter at widexs dot nl
Mmm, I couldn't get anything to output with zend_error, but if I add a php_printf("uhohw"), it exactly prints it at line 335 as you mentioned.

So doc_root == NULL
 [2007-02-04 11:57 UTC] pierre dot php at gmail dot com
Thanks. Now the question is if it is good to always return SUCCESS but raises a warning when no doc_root has been found (or any other error). I think it can minimize the annoyances when one uses cgi in console mode.

If yes, I will put a fix in 0.6.4, expect it to be released later this week.
 [2007-02-04 12:11 UTC] wouter at widexs dot nl
I've been playing with returning SUCCESS already now :))

and I personally can't think of any bad ideas when returning SUCCESS if doc_root is empty. If you want to yell a warning (if I understood you correctly), maybe create a .ini option for it to shut that down as well ?

Also, thanks for your great support.

htscanner r0x, now only if it could handle PHP4 :)
 [2007-02-04 12:22 UTC] pierre dot php at gmail dot com
I have a couple of patches pending to add php4 support but I lack the time to test and maintain them. I'm also not very motivated to support php4 as I consider it as dead.

I will try to put them in he README in 0.6.4
 [2007-02-04 12:56 UTC] wouter at widexs dot nl
Great :)

I'll await 0.6.4, currently running with SUCCESS w/o any problem so far.

[offtopic]
I know PHP4 could be considered dead, but when you have 100's of websites of clients that don't want to hire developers to make their sites php5+ compatible .. and you don't want them to go to another ISP, as an ISP you have to support it :(
[/offtopic]
 [2007-02-15 08:04 UTC] pierre dot php at gmail dot com
Current CVS contains the fix.

A new ini option has been added:

htscanner.stop_on_error

Setting to 1 will make htscanner returns a failure when an error occured internally (cache, doc_root missing, etc.). If it is et to 0 (the default), it will simply return SUCCESS and do nothing.

Can you test it please?
 [2007-02-19 05:34 UTC] pierre dot php at gmail dot com
Thank you for your bug report. This issue has been fixed
in the latest released version of the package, which you can download at
http://pecl.php.net/get/htscanner


 
PHP Copyright © 2001-2018 The PHP Group
All rights reserved.
Last updated: Tue Sep 25 07:01:25 2018 UTC