[PHP] #exec and php together

2001-07-03 Thread Paolo Ciraci

I'm trying to include the output of a php script into a standard html 
file via SSI #exec.

The following is a sample php file (hello.php):

?php
echo Hello World!\n;
?

and the following is the sample html file (hello.htm):

HTML
BODY
!--#exec cgi=hello.php --
/BODY
/HTML

both files are in the same directory.

If I issue http://www.mysite.com/hello.php 
the script works well and I obtain the page showing the message 
Hello World!

but if I try http://www.mysite.com/hello.htm
I obtain an empty page.

My system is BSDI 4.1 + Apache 1.3.11 + PHP 4.0.3pl1 (both module and 
cgi version) but I've tested the same example on a Window NT 4 + 
Apache 1.3.12 + PHP 4.0.3pl1 (cgi version) without success.

Any idea, suggestion ?

Thanks.


Dr. Paolo Ciraci
~
Responsabile Sistemi Informativi [EMAIL PROTECTED]
Nautica Editrice S.r.l. http://www.nautica.it
Via Tevere 44, Roma - tel 06 8413060

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] #exec and php together

2001-07-03 Thread Paolo Ciraci

 The problem with this is that, by default, Apache will ONLY parse 
 PHP code if the extension matches the PHP extension in 
 httpd.conf.  You could add .htm and .html to that extension match 
 if you'd like, and that could possibly do it.

No, that is not the problem.

I don't want the .htm file parsed by Apache server.
I want to include the output of php into an html file.

I've also tried to specify the full path of php executable into 
hello.htm with the following:

!--#exec cgi=/usr/local/bin/php -q /v/www/hello.php --

without success.



Dr. Paolo Ciraci
~
Responsabile Sistemi Informativi [EMAIL PROTECTED]
Nautica Editrice S.r.l. http://www.nautica.it
Via Tevere 44, Roma - tel 06 8413060

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Fopen only absolute IP

2001-02-26 Thread Paolo Ciraci

I can't use any filesystem function (fopen, file, fsockopen, etc.) to 
open a remote file (fopen wrapper is obviously on). 

For example if I try the following:

$S = file ("http://www.yahoo.com/");

I obtain the error: "Bad file descriptor"

If I use an absolute IP address:

$S = file ("http://216.32.74.50/");

I have no problem.

The machine runs BSDI BSD/OS 4.1 + PHP 4.0.3pl1 + Apache 1.3.11

No problem to access dns from this machine as "ping www.yahoo.com" or 
"wget www.yahoo.com" work well.

I don't want to use absolute IP numbers to retrieve data from remote 
file (as they can change often). Any ideas, suggestions?

Thank you.



Dr. Paolo Ciraci - EDP Manager and Webmaster

Nautica On Line  - http://www.nautica.it
EuroMeteo- http://www.eurometeo.com
SCUBAweb - http://www.scubaweb.it

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]