Reply to Re: [CLI] HTML output even with -q switch?

Your name:

Reply:


Posted by AnrDaemon on 01/25/08 06:44

Greetings, Gilles Ganault.
In reply to Your message dated Friday, January 25, 2008, 08:56:14,

> I need to write PHP scripts on an AstLinux distribution. Even
> though I added the "-q" switch on the shebbang line, PHP still outputs
> some HTML:

> ==========
> # cat test.php

> #!/usr/bin/php -q
> <?php
> echo "test";
?>>
> ==========
> # ./test.php
> X-Powered-By: PHP/5.2.5
> Content-type: text/html

You're using CGI, not CLI version.
CLI version will NEVER output a HTTP header.
Also try the "php --help" and see if that switch exists at all.

> test#
> ==========

> Is there a switch somewhere to tell PHP to actually run scripts quietly,

"quiet" mode is NOT supposed to hide output at all.
It is in the best case will hide any PHP engine(!) generated messages, but
YOUR OWN output will be indeed written.

> or is it just the way PHP works when called from mini-httpd?

It is just how's it intended to work. If You don't want any output from script
- remove any output-generating commands from script or enclose it in
conditional checks.


--
Sincerely Yours, AnrDaemon <anrdaemon@freemail.ru>

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация