Discussion:
[PHP-INSTALL] PHP Page Refuse to Display PHP content
Wei, Alice J.
2008-06-11 17:43:58 UTC
Permalink
Hi,

I am trying to install PHP so that I can connect to MS SQL from the PHP scripts.
I have successfully installed Apache and brings me back a good page with no errors, and tried to create a php page in the usr/local/apache/htdocs folder. Here is the code of what is in this page:

<html>
<head>
<title>PHP Test</title>
</head>
<body>
<h1>PHP Test</h1>
<p><b>An example of PHP in Action</b><br /></p>
<? echo "Hello!";?>

</body>
</html>

The problem is that I do not see the execution of PHP anywhere on the HTML. I have set the short_open_tag to off in the php.ini file, but I am not sure what could be the problem that I could not see the execution of the PHP page.

Can anyone please tell me what might have gone wrong?

Thanks for your help.

Alice
======================================================
Alice Wei
MIS 2009
School of Library and Information Science
Indiana University Bloomington
***@indiana.edu
Wei, Alice J.
2008-06-11 17:58:26 UTC
Permalink
Hi, Max:

I have modified my code so that the page is like this:

<html>
<head>
<title>PHP Test</title>
</head>
<body>
<h1>PHP Test</h1>
<p><b>An example of PHP in Action</b><br /></p>
<?php echo "hello world"; ?>

</body>
</html>

However, it is still not giving me anything.
Another odd thing is that I have added these lines to my httpd.conf file in the apache folder,

AddType text/html php
#AddOutputFilter INCLUDES .shtml
AddType application/x-httpd-php-source phps

I still have no error message with the un-displayable content above, and therefore cannot call the phpinfo() page.
Could this be some other problems I have during the installation?

Alice
======================================================
Alice Wei
MIS 2009
School of Library and Information Science
Indiana University Bloomington
***@indiana.edu
________________________________________
From: Max Thayer [***@hwi.buffalo.edu]
Sent: Wednesday, June 11, 2008 1:56 PM
To: Wei, Alice J.
Subject: RE: [PHP-INSTALL] PHP Page Refuse to Display PHP content

This may be totally off base... but try <?php echo "hello world"; ?>

Max H. Thayer
Software Developer
Center for High-Throughput Structural Biology

Hauptman-Woodward Medical Research Inst.
700 Ellicott St.
Buffalo, NY 14203
Phone: 716-898-8637
Fax: 716-898-8660
http://www.chtsb.org
http://www.hwi.buffalo.edu

-----Original Message-----
From: Wei, Alice J. [mailto:***@indiana.edu]
Sent: Wednesday, June 11, 2008 1:44 PM
To: php-***@lists.php.net
Subject: [PHP-INSTALL] PHP Page Refuse to Display PHP content

Hi,

I am trying to install PHP so that I can connect to MS SQL from the
PHP scripts.
I have successfully installed Apache and brings me back a good page
with no errors, and tried to create a php page in the
usr/local/apache/htdocs folder. Here is the code of what is in this
page:

<html>
<head>
<title>PHP Test</title>
</head>
<body>
<h1>PHP Test</h1>
<p><b>An example of PHP in Action</b><br /></p>
<? echo "Hello!";?>

</body>
</html>

The problem is that I do not see the execution of PHP anywhere on the
HTML. I have set the short_open_tag to off in the php.ini file, but I am
not sure what could be the problem that I could not see the execution of
the PHP page.

Can anyone please tell me what might have gone wrong?

Thanks for your help.

Alice
======================================================
Alice Wei
MIS 2009
School of Library and Information Science
Indiana University Bloomington
***@indiana.edu
kranthi
2008-06-11 18:23:50 UTC
Permalink
make sure that u have

LoadModule php5_module "path/to/dll/php5apache2.dll"
AddType application/x-httpd-php .php .php5 .php4 .php3 .phtml .phpt

in your httpd.conf file

and the name of the php file ends in
.php or .php5 or .php4 or .php3 or .phtml or .phpt(what ever u give in the
httpd.conf)
Daniel Brown
2008-06-11 19:37:03 UTC
Permalink
Alice,

Also, make sure you've restarted Apache. Every time you make
changes to httpd.conf, php.ini, or any related file, you need to
restart Apache.
--
</Daniel P. Brown>
Dedicated Servers - Intel 2.4GHz w/2TB bandwidth/mo. starting at just
$59.99/mo. with no contract!
Dedicated servers, VPS, and hosting from $2.50/mo.
Wei, Alice J.
2008-06-12 02:03:58 UTC
Permalink
Hi, Daniel:

I have restarted it several times, but it does not seem to give me a different result. What is interesting is that I can see the output of it in textual format in the terminal (I am using Linux Fedora 9.0, and my PHP is the latest version.), which means that it literally supports PHP by default according to http://www.php.net, but I cannot see it on the browser.

Do I still need to install Apache? It appears that even when I installed it does not provide me with a different error than without. Could there be other issues I am having here?

Alice
======================================================
Alice Wei
MIS 2009
School of Library and Information Science
Indiana University Bloomington
***@indiana.edu
________________________________________
From: Daniel Brown [***@gmail.com]
Sent: Wednesday, June 11, 2008 3:37 PM
To: kranthi
Cc: Wei, Alice J.; php-***@lists.php.net
Subject: Re: [PHP-INSTALL] PHP Page Refuse to Display PHP content

Alice,

Also, make sure you've restarted Apache. Every time you make
changes to httpd.conf, php.ini, or any related file, you need to
restart Apache.

--
</Daniel P. Brown>
Dedicated Servers - Intel 2.4GHz w/2TB bandwidth/mo. starting at just
$59.99/mo. with no contract!
Dedicated servers, VPS, and hosting from $2.50/mo.
kranthi
2008-06-12 02:54:20 UTC
Permalink
"t appears that even when I installed it does not provide me with a
different error than without."
after reading this statement i guess u r trying to see some thing like *
file://path/to/fhtdocs/filename.php* in your web browser u hav to see *
http://localhost/filename.php *in you url bar

Loading...