473,378 Members | 1,321 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,378 software developers and data experts.

Install oddity Win2K/Apache2/PHP4

PHP Newbie question: I installed the above, and if I point directly to a
..php file (i.e. http://localhost/phpinfo.php, I get the php script executed
properly. If I put a <?php ... ?> tag in html, nothing happens. No error
in any Apache logs, no obvious errors in php, nothing displayed on the
page.

I installed as cgi, I saw an earlier post someone recommended SAPI - could
that be a problem (I'm guessing it's some line in one of the configs I
screwed up).

Thanks,
-G
Jul 17 '05 #1
6 2557
On Wed, 29 Oct 2003 14:15:53 +0000, Greg Bryant wrote:
PHP Newbie question: I installed the above, and if I point directly to a
.php file (i.e. http://localhost/phpinfo.php, I get the php script executed
properly. If I put a <?php ... ?> tag in html, nothing happens. No error
in any Apache logs, no obvious errors in php, nothing displayed on the
page.

I installed as cgi, I saw an earlier post someone recommended SAPI - could
that be a problem (I'm guessing it's some line in one of the configs I
screwed up).

Thanks,
-G

If installed as a CGI, I think the scripts need to be coded like Perl
scripts and use a Shebang line:
#!/usr/bin/php
[ ... rest of script ... ]
rather than the "usual" <?php ... ?> tag method. Your path to your PHP
binary may differ to the above naturally =)

My recommendation would be to reinstall as a module rather than CGI as
this is both faster and more secure.
HTH =)

Regards,

Ian

--
Ian.H [Design & Development]
digiServ Network - Web solutions
www.digiserv.net | irc.digiserv.net | forum.digiserv.net
Programming, Web design, development & hosting.

Jul 17 '05 #2
Greg Bryant wrote:
PHP Newbie question: I installed the above, and if I point directly to a
.php file (i.e. http://localhost/phpinfo.php, I get the php script executed
properly. If I put a <?php ... ?> tag in html, nothing happens. No error
in any Apache logs, no obvious errors in php, nothing displayed on the
page.

I installed as cgi, I saw an earlier post someone recommended SAPI - could
that be a problem (I'm guessing it's some line in one of the configs I
screwed up).

Thanks,
-G


Well ... I never used PHP as a cgi, but with php as a module and apache
not configured to call php for xxx.html pages the php code is send
"as-is" to the browser. Check the page source and you'll see the source
there. My guess is your browser is hiding the <?php ... ?> tags the same
way it hides <b>, <a title="xxx">, etc.
--
I have a spam filter working.
To mail me include "urkxvq" (with or without the quotes)
in the subject line, or your mail will be ruthlessly discarded.
Jul 17 '05 #3
Pedro <he****@hotpop.com> wrote in message news:<bn*************@ID-203069.news.uni-berlin.de>...
Greg Bryant wrote:
PHP Newbie question: I installed the above, and if I point directly to a
.php file (i.e. http://localhost/phpinfo.php, I get the php script executed
properly. If I put a <?php ... ?> tag in html, nothing happens. No error
in any Apache logs, no obvious errors in php, nothing displayed on the
page.

I installed as cgi, I saw an earlier post someone recommended SAPI - could
that be a problem (I'm guessing it's some line in one of the configs I
screwed up).

Thanks,
-G


Well ... I never used PHP as a cgi, but with php as a module and apache
not configured to call php for xxx.html pages the php code is send
"as-is" to the browser. Check the page source and you'll see the source
there. My guess is your browser is hiding the <?php ... ?> tags the same
way it hides <b>, <a title="xxx">, etc.


It is noted in the PHP documentation that PHP is not supported in
Apache2 except at highly experimental levels. You might be having
other issues as well, but to be sure I would downgrade your Apache
version to 1.3.28.

It is also noted in the PHP docs that running PHP as a CGI from Apache
is not all that good of an idea unless you really know what you are
doing.

To run PHP as an Apache Module in 1.3.28, configure your php.ini file
with the needed info and then copy php.ini and php4ts.dll to the
Apache server root. Then add the following lines to your httpd.conf
file in the appropriate sections:

LoadModule php4_module c:/php4win/sapi/php4apache.dll

AddModule mod_php4.c

AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
Jul 17 '05 #4
Pedro <he****@hotpop.com> wrote in message news:<bn*************@ID-203069.news.uni-berlin.de>...
Greg Bryant wrote:
PHP Newbie question: I installed the above, and if I point directly to a
.php file (i.e. http://localhost/phpinfo.php, I get the php script executed
properly. If I put a <?php ... ?> tag in html, nothing happens. No error
in any Apache logs, no obvious errors in php, nothing displayed on the
page.

I installed as cgi, I saw an earlier post someone recommended SAPI - could
that be a problem (I'm guessing it's some line in one of the configs I
screwed up).

Thanks,
-G


Well ... I never used PHP as a cgi, but with php as a module and apache
not configured to call php for xxx.html pages the php code is send
"as-is" to the browser. Check the page source and you'll see the source
there. My guess is your browser is hiding the <?php ... ?> tags the same
way it hides <b>, <a title="xxx">, etc.


Another thing about embedding php in a doc with a .html extension...
it won't work. You need to rename the file with a .php extension in
order for the server to proerly parse the info.
Jul 17 '05 #5
On Wed, 29 Oct 2003 19:00:52 -0800, zdope wrote:
Another thing about embedding php in a doc with a .html extension... it
won't work. You need to rename the file with a .php extension in order for
the server to proerly parse the info.

That's completely wrong!

You configure what extensions you want to parse as PHP files when you
install / config it all, there's _nothing_ to stop you using .html files
for PHP execution, although personally, I wouldn't recommend it.

Regards,

Ian

--
Ian.H [Design & Development]
digiServ Network - Web solutions
www.digiserv.net | irc.digiserv.net | forum.digiserv.net
Programming, Web design, development & hosting.

Jul 17 '05 #6
zd******@hotmail.com (zdope) wrote in message news:<b6**************************@posting.google. com>...
Pedro <he****@hotpop.com> wrote in message news:<bn*************@ID-203069.news.uni-berlin.de>...

Another thing about embedding php in a doc with a .html extension...
it won't work. You need to rename the file with a .php extension in
order for the server to proerly parse the info.
CORRECTION:
"gf" <gf******@earthlink.net> wrote in message news:<iJ****************@newsread4.news.pas.earthl ink.net>...
In your apache httpd.conf file, make sure you have this line (or similar) to
parse your php code in your .htm* documents. That will resolve your issue.

AddType application/x-httpd-php .phtml .php .php3 .htm .html

Jul 17 '05 #7

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

Similar topics

0
by: Aldo Polli | last post by:
Hi, I have this error when I start apache2 with php4 Syntax error on line 233 of /mypath/apache2/conf/httpd.conf: Cannot load /mypath/apache2/modules/libphp4.so into server: dynamic linker:...
0
by: Alexander Skwar | last post by:
Hello! I'm having problems getting PHP 4.3.3RC4 successfully to install on my HP-UX 11.00 server. After a (successfull?) compile, "make install" errors out with this error message: ...
0
by: bissatch | last post by:
Hi, I have installed Apache2. I have installed PHP4.3.0. All is working fine. I have now went and tried to install DOMXML into PHP by simply uncommenting the extension = php_domxml.dll (or...
3
by: bissatch | last post by:
Hi, I have recently installed PHP4 with Apache2. Currently I am trying to install the DOMXML extension. According to what I have read, if I uncomment the extension=php_domxml.dll line in php.ini...
1
by: news8080 | last post by:
I downloaded a GUI for nagios that uses PHP but when I point the browser at the PHP file, it shows me the source of .php file instead of executing it, if i use command line 'php filname.php'...
3
by: masterx | last post by:
I developed and maintained a site for someone using Apache 1.3 and PHP 4.0.3 and used to be able to reference a page without explicitly specifying the .php extension. ie....
3
by: Joseph S. | last post by:
Hi, I am trying to install PHP 5.0.4 on Apache 2.0.54 on WinXP Pro SP2 as a cgi binary. Apache2 directory is c:/Apache2 htdocs is c:/Apache2/htdocs php is installed in c:/php This contains...
8
by: lawrence k | last post by:
I've installed Apache 1.3.36 on my Redhat EL 3 machine. Now I'm trying to install PHP 5.1.4. I can not get the ./configure command to work. I keep getting this error: configure: error: Invalid...
1
by: hansgso | last post by:
please help I am lost. I'm running debian linux and I am trying to install apache + PHP First I downloaded apache and PHP manualy, tried to configure and compile it but some how the apache...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...

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.