473,396 Members | 2,033 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

[CLI] HTML output even with -q switch?

Hello

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

test#
==========

Is there a switch somewhere to tell PHP to actually run scripts
quietly, or is it just the way PHP works when called from mini-httpd?

FWIW, here's phpinfo:

http://pastebin.ca/871766

Thank you.
Jan 25 '08 #1
2 2030
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 <an*******@freemail.ru>

Jan 25 '08 #2
On Fri, 25 Jan 2008 09:44:50 +0300, AnrDaemon <an*******@freemail.ru>
wrote:
>You're using CGI, not CLI version.
CLI version will NEVER output a HTTP header
Yup, I looked at the configuration script, and this is the CGI
version:

PHP5_BINARY:=sapi/cgi/php-cgi

Is it possible to compile both the CLI and CGI versions? I don't see
any "--enable-cli" or "--disable-cli" option in the same file.

Thanks.
Jan 25 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: yawnmoth | last post by:
The portion of the PHP manual entitled "Using PHP from the command line" states that "The CGI SAPI supports the CLI SAPI behaviour by means of the -C switch when run from the command line.": ...
4
by: J | last post by:
I've just been reading a few articles on how Managed Extensions are now obsolete! Tough thing to hear, as I've been spending every spare moment studying them to try to solve a problem. I'd like...
1
by: steingold | last post by:
Hi all, I'm developing a C++ application that needs to communicate with DB2. It seems that the only way to do that, according to the IBM documentation, is with the CLI API. The problem with...
34
by: Roman Mashak | last post by:
Hello, All! I'm implementing simple CLI (flat model, no tree-style menu etc.). Command line looks like this: <command> <param1> <param2> ... <paramN> (where N=1..4) And idea is pretty simple: ...
81
by: Don Kim | last post by:
I've been looking for a new IT position, and so far, the majority of work with respect to the Windows platform is C#/.Net, with some vb.net requests every so often. Even many of the C++/MFC/ATL...
62
by: Born | last post by:
GC is really garbage itself Reason 1: There is delay between the wanted destruction and the actual destruction.
1
by: Noah Roberts | last post by:
Trying to use boost::function in a C++/CLI program. Here is code: pragma once #include <boost/function.hpp> #include <boost/shared_ptr.hpp> #include <vector> using namespace System;
2
by: Dragan | last post by:
Hi, We're working in VS 2005, Team edition, if it makes any difference at all (should be up-to-date and all that, but could not guarantee it is 100%). We've implemented a simple generic wrapper...
2
by: kelvin.koogan | last post by:
Our company has a mix of users with VS2003 & VS2005. I'm am having difficulty working out how components written with these 2 tools can be written together. I want to be able to a) incorporate a...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.