Jump to content

I installed php as command line mode


Recommended Posts

Hi,

 

  I have installed php as command line mode. But on running a simple script , I get output as follows without http headers. This is fine but my application needs the http header as part of printing output in console .

 

<HTML>

<HEAD>

<TITLE> Hello World in PHP </TITLE>

</HEAD>

<BODY>

Hello World

</BODY>

</HTML>

 

Previously in my old php 4.1.2 I used to get like

 

X-Powered-By: PHP/4.1.2

Content-type: text/html

 

<HTML>

<HEAD>

<TITLE> Hello World in PHP </TITLE>

</HEAD>

<BODY>

<?

// Hello world in PHP

print("Hello World");

?>

</BODY>

</HTML>

 

I want to get this content type as part of running >>>> php hello.php

in my newer php also, for this how I need to configure. Please guide me .

 

Thanks in advance ,

Jai

Link to comment
Share on other sites

Our application work in such a way that it gets script name from browser and run the php script as part of CGI and print the output to browser. Seems little crap right but this is how it needs to work ... Please let me know how to get things work if possible.

Link to comment
Share on other sites

Hi,

 

Both this settings default_mime and expose_php are set as required. But even now I am not seeing headers in the output. Please verify my php -i output(Attached) and help me to figure this out.

 

Thanks,

jai

 

[attachment deleted by admin]

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.