Re: [PHP] why does PHP parse *.html files in one subdir/ but not in another?

2009-07-20 Thread Stuart
2009/7/19 Paul M Foster pa...@quillandmouse.com:
 On Sun, Jul 19, 2009 at 07:18:34PM +0100, Stuart wrote:

 2009/7/19 Paul M Foster pa...@quillandmouse.com:
  On Sun, Jul 19, 2009 at 09:30:33AM +0530, kranthi wrote:
 
 
   You do realize that PHP does not parse HTML files, right? The web server
   does that. In fact, the web server also parses PHP files, using a
   different library.
 
  Kindly elaborate If you are saying that PHP cant parse files with
  extension .html
  http://us2.php.net/manual/en/security.hiding.php.
 
  That's exactly what I'm saying. Apache or IIS (or whatever) discern the
  contents of a file and determine how to parse it. As far as I know,
  Apache, even with a PHP file, parses the HTML in the file and hands PHP
  off to a PHP module to decode. The PHP engine itself does not parse the
  HTML which is interspersed in and amongst your PHP code. The web server
  does that. Unless some php internals person says otherwise, that's the
  story. At best, the PHP engine would simply echo non-PHP text to the
  browser, which is not parsing it.

 Actually that's not accurate. The web server does nothing with a file
 before it passes it to the PHP engine. PHP gets the entire file, it
 simply echo's anything not inside PHP tags.

 Then I stand corrected. But again, this means that PHP doesn't actually
 *parse* the HTML it echoes.

Technically it parses the the entire file looking for PHP tags, but
that's being overly picky.

-Stuart

-- 
http://stut.net/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] why does PHP parse *.html files in one subdir/ but not in another?

2009-07-19 Thread Stuart
2009/7/19 Jim Lucas li...@cmsws.com:
 Govinda wrote:

 Hi all,

 ..sitting here thinking this is so easy, and I must have been over this
 already in the past..  but it is eluding me just now..

 I can't figure out why files with the .html extension ARE being parsed by
 PHP when they are in the main doc root dir/, or in one subdirectory down
 from there..  BUT NOT when in *another* new subdirectory that I just
 created.  Both subdirectories have the exact same perms (same owner  group
 too), both have the same php.ini file in them,...  neither have an .htaccess
 file in them..  (if that would matter?).

 Anyway I just need to get PHP tp process all .html files in this and in
 any new subdirectory(ies) that I will make.
 Can someone point me to what I need to pay attention to?

 Thank you
 -Govinda



 
 Govinda
 govinda.webdnat...@gmail.com



 Another thing you could do is, instead of a .htaccess, use a php.ini file in
 your
 DOCUMENT_ROOT.  Sometimes hosts allow this file.  If allowed, you will then
 be able
 to set any php.ini configuration option you want.

 Give it a shot!  What do you have to loose at this point?

Lose not loose, and php.ini has no control over what file types get
parsed by PHP.

-Stuart

-- 
http://stut.net/

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] why does PHP parse *.html files in one subdir/ but not in another?

2009-07-19 Thread Paul M Foster
On Sun, Jul 19, 2009 at 09:30:33AM +0530, kranthi wrote:

 
  You do realize that PHP does not parse HTML files, right? The web server
  does that. In fact, the web server also parses PHP files, using a
  different library.

 Kindly elaborate If you are saying that PHP cant parse files with
 extension .html
 http://us2.php.net/manual/en/security.hiding.php.

That's exactly what I'm saying. Apache or IIS (or whatever) discern the
contents of a file and determine how to parse it. As far as I know,
Apache, even with a PHP file, parses the HTML in the file and hands PHP
off to a PHP module to decode. The PHP engine itself does not parse the
HTML which is interspersed in and amongst your PHP code. The web server
does that. Unless some php internals person says otherwise, that's the
story. At best, the PHP engine would simply echo non-PHP text to the
browser, which is not parsing it.

Paul

-- 
Paul M. Foster

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] why does PHP parse *.html files in one subdir/ but not in another?

2009-07-19 Thread Ashley Sheridan
On Sun, 2009-07-19 at 14:07 -0400, Paul M Foster wrote:
 On Sun, Jul 19, 2009 at 09:30:33AM +0530, kranthi wrote:
 
  
   You do realize that PHP does not parse HTML files, right? The web server
   does that. In fact, the web server also parses PHP files, using a
   different library.
 
  Kindly elaborate If you are saying that PHP cant parse files with
  extension .html
  http://us2.php.net/manual/en/security.hiding.php.
 
 That's exactly what I'm saying. Apache or IIS (or whatever) discern the
 contents of a file and determine how to parse it. As far as I know,
 Apache, even with a PHP file, parses the HTML in the file and hands PHP
 off to a PHP module to decode. The PHP engine itself does not parse the
 HTML which is interspersed in and amongst your PHP code. The web server
 does that. Unless some php internals person says otherwise, that's the
 story. At best, the PHP engine would simply echo non-PHP text to the
 browser, which is not parsing it.
 
 Paul
 
 -- 
 Paul M. Foster
 
I thought that files that were deemed to be PHP files (indicated to the
web server by the extension and not the content) were sent to the PHP
parser, and *that* decided what bits went to the web server as regular
output.

Thanks
Ash
www.ashleysheridan.co.uk


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] why does PHP parse *.html files in one subdir/ but not in another?

2009-07-19 Thread Stuart
2009/7/19 Paul M Foster pa...@quillandmouse.com:
 On Sun, Jul 19, 2009 at 09:30:33AM +0530, kranthi wrote:


  You do realize that PHP does not parse HTML files, right? The web server
  does that. In fact, the web server also parses PHP files, using a
  different library.

 Kindly elaborate If you are saying that PHP cant parse files with
 extension .html
 http://us2.php.net/manual/en/security.hiding.php.

 That's exactly what I'm saying. Apache or IIS (or whatever) discern the
 contents of a file and determine how to parse it. As far as I know,
 Apache, even with a PHP file, parses the HTML in the file and hands PHP
 off to a PHP module to decode. The PHP engine itself does not parse the
 HTML which is interspersed in and amongst your PHP code. The web server
 does that. Unless some php internals person says otherwise, that's the
 story. At best, the PHP engine would simply echo non-PHP text to the
 browser, which is not parsing it.

Actually that's not accurate. The web server does nothing with a file
before it passes it to the PHP engine. PHP gets the entire file, it
simply echo's anything not inside PHP tags.

In general web servers don't know or care about the format of the
files they serve. You configure certain extensions to be passed to
certain modules, even in the case of something like SSI. The web
server itself doesn't usually parse any of the files it serves.

-Stuart

-- 
http://stut.net/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] why does PHP parse *.html files in one subdir/ but not in another?

2009-07-18 Thread Govinda


On Jul 18, 2009, at 6:36 PM, Adam Shannon wrote:




On Sat, Jul 18, 2009 at 7:01 PM, Govinda  
govinda.webdnat...@gmail.com wrote:

Hi all,

..sitting here thinking this is so easy, and I must have been over  
this already in the past..  but it is eluding me just now..


I can't figure out why files with the .html extension ARE being  
parsed by PHP when they are in the main doc root dir/, or in one  
subdirectory down from there..  BUT NOT when in *another* new  
subdirectory that I just created.  Both subdirectories have the  
exact same perms (same owner  group too), both have the same  
php.ini file in them,...  neither have an .htaccess file in them..   
(if that would matter?).


Anyway I just need to get PHP tp process all .html files in this and  
in any new subdirectory(ies) that I will make.

Can someone point me to what I need to pay attention to?

It sounds like your .htaccess file may be telling .html files in a / 
sub/directory/ to treat .html files as .php


Just add this to your root .htaccess
AddType x-mapp-php5 .html


Thanks Adam.  But still no luck.  I did add that line to the .htaccess  
file in my doc root, but my file.html in subdir/ is still not being  
parsed by PHP.

??

-G

Re: [PHP] why does PHP parse *.html files in one subdir/ but not in another?

2009-07-18 Thread Adam Shannon
On Sat, Jul 18, 2009 at 7:54 PM, Govinda govinda.webdnat...@gmail.comwrote:


 On Jul 18, 2009, at 6:36 PM, Adam Shannon wrote:



 On Sat, Jul 18, 2009 at 7:01 PM, Govinda govinda.webdnat...@gmail.comwrote:

 Hi all,

 ..sitting here thinking this is so easy, and I must have been over this
 already in the past..  but it is eluding me just now..

 I can't figure out why files with the .html extension ARE being parsed by
 PHP when they are in the main doc root dir/, or in one subdirectory down
 from there..  BUT NOT when in *another* new subdirectory that I just
 created.  Both subdirectories have the exact same perms (same owner  group
 too), both have the same php.ini file in them,...  neither have an .htaccess
 file in them..  (if that would matter?).

 Anyway I just need to get PHP tp process all .html files in this and in
 any new subdirectory(ies) that I will make.
 Can someone point me to what I need to pay attention to?


 It sounds like your .htaccess file may be telling .html files in a
 /sub/directory/ to treat .html files as .php

 Just add this to your root .htaccess
 AddType x-mapp-php5 .html


 Thanks Adam.  But still no luck.  I did add that line to the .htaccess file
 in my doc root, but my file.html in subdir/ is still not being parsed by
 PHP.
 ??


Try to put that same line of .htaccess into the sub directory.  Your host
may not allow .htaccess rules to be many directories deep.



 -G




-- 
- Adam Shannon ( http://ashannon.us )


Re: [PHP] why does PHP parse *.html files in one subdir/ but not in another?

2009-07-18 Thread Adam Shannon
On Sat, Jul 18, 2009 at 7:01 PM, Govinda govinda.webdnat...@gmail.comwrote:

 Hi all,

 ..sitting here thinking this is so easy, and I must have been over this
 already in the past..  but it is eluding me just now..

 I can't figure out why files with the .html extension ARE being parsed by
 PHP when they are in the main doc root dir/, or in one subdirectory down
 from there..  BUT NOT when in *another* new subdirectory that I just
 created.  Both subdirectories have the exact same perms (same owner  group
 too), both have the same php.ini file in them,...  neither have an .htaccess
 file in them..  (if that would matter?).

 Anyway I just need to get PHP tp process all .html files in this and in any
 new subdirectory(ies) that I will make.
 Can someone point me to what I need to pay attention to?


It sounds like your .htaccess file may be telling .html files in a
/sub/directory/ to treat .html files as .php

Just add this to your root .htaccess
AddType x-mapp-php5 .html



 Thank you
 -Govinda



 
 Govinda
 govinda.webdnat...@gmail.com




-- 
- Adam Shannon ( http://ashannon.us )


Re: [PHP] why does PHP parse *.html files in one subdir/ but not in another?

2009-07-18 Thread Paul M Foster
On Sat, Jul 18, 2009 at 06:01:14PM -0600, Govinda wrote:

 Hi all,

 ..sitting here thinking this is so easy, and I must have been over
 this already in the past..  but it is eluding me just now..

 I can't figure out why files with the .html extension ARE being parsed
 by PHP when they are in the main doc root dir/, or in one subdirectory
 down from there..  BUT NOT when in *another* new subdirectory that I
 just created.  Both subdirectories have the exact same perms (same
 owner  group too), both have the same php.ini file in them,...
 neither have an .htaccess file in them..  (if that would matter?).

 Anyway I just need to get PHP tp process all .html files in this and
 in any new subdirectory(ies) that I will make.
 Can someone point me to what I need to pay attention to?

You do realize that PHP does not parse HTML files, right? The web server
does that. In fact, the web server also parses PHP files, using a
different library.

Paul

-- 
Paul M. Foster

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] why does PHP parse *.html files in one subdir/ but not in another?

2009-07-18 Thread kranthi
i never used x-mapp-php5, but most of a forums say it is specific to
1and1 hosting service. php recommends application/x-httpd-php

http://us2.php.net/manual/en/install.unix.apache2.php

try adding AddType application/x-httpd-php .html in your root htaccess
if that dosent help you'll have to add that to your htpd.conf file

 You do realize that PHP does not parse HTML files, right? The web server
 does that. In fact, the web server also parses PHP files, using a
 different library.
Kindly elaborate If you are saying that PHP cant parse files with
extension .html
http://us2.php.net/manual/en/security.hiding.php.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] why does PHP parse *.html files in one subdir/ but not in another?

2009-07-18 Thread Govinda


Just add this to your root .htaccess
AddType x-mapp-php5 .html


Thanks Adam.  But still no luck.  I did add that line to  
the .htaccess file in my doc root, but my file.html in subdir/ is  
still not being parsed by PHP.

??

Try to put that same line of .htaccess into the sub directory.  Your  
host may not allow .htaccess rules to be many directories deep.


I just tried this, at your recommendation, but still no luck.

Re: [PHP] why does PHP parse *.html files in one subdir/ but not in another?

2009-07-18 Thread Govinda
You do realize that PHP does not parse HTML files, right? The web  
server

does that. In fact, the web server also parses PHP files, using a
different library.


I understand.  I just was saying it that way.  Actually I rarely think  
too deeply about that specifically, but now that you pointed it out I  
realize I do know that.  Thanks..

-G

Re: [PHP] why does PHP parse *.html files in one subdir/ but not in another?

2009-07-18 Thread Jim Lucas

Govinda wrote:

Hi all,

..sitting here thinking this is so easy, and I must have been over this 
already in the past..  but it is eluding me just now..


I can't figure out why files with the .html extension ARE being parsed 
by PHP when they are in the main doc root dir/, or in one subdirectory 
down from there..  BUT NOT when in *another* new subdirectory that I 
just created.  Both subdirectories have the exact same perms (same owner 
 group too), both have the same php.ini file in them,...  neither have 
an .htaccess file in them..  (if that would matter?).


Anyway I just need to get PHP tp process all .html files in this and in 
any new subdirectory(ies) that I will make.

Can someone point me to what I need to pay attention to?

Thank you
-Govinda




Govinda
govinda.webdnat...@gmail.com




Another thing you could do is, instead of a .htaccess, use a php.ini file in 
your
DOCUMENT_ROOT.  Sometimes hosts allow this file.  If allowed, you will then be 
able
to set any php.ini configuration option you want.

Give it a shot!  What do you have to loose at this point?

Jim

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php