RE: PHP Runs But Does Not Display on Linux

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> -----Original Message-----
> From: Wei, Alice J. [mailto:ajwei@xxxxxxxxxxx]
> Sent: Thursday, June 12, 2008 9:02 AM
> To: deadtom@xxxxxxxxxxxx
> Cc: php-general@xxxxxxxxxxxxx
> Subject: RE:  PHP Runs But Does Not Display on Linux
> 
> Hello,
> 
>   I have reinstalled Apache back into my Linux machine, and placed the
> code
> 
> 
>   <html>
>    <head><title>Test</title>
>   <body>
>   <p>This is test</p>
>    <?php echo "Hello!"; ?>
>   </body>
>    </html>
> 
> into the apache/htdocs folder titled hello.php
> 
>   When I execute it from the browser using an http:// address followed
> by the IP address and hello.php, I get this pop up message that asks
me
> if I wanted to open up my file and what I want to do with it.
>   Is it necessary for me to install anything else? I have added the
> AddType application/x-httpd-php .php into the httpd.conf file, so now
> it is not giving me "file does not exist" error anymore, but how do I
> get thie accurate output to show up from the browser?

Alice,

As others have mentioned thus far, having Apache is simply not enough.
You can even try and configure it yourself via the .conf files, but it
still won't properly process <?php ?> tags. In fact, the reason you see
absolutely nothing in their place is that <?php ?> is a complete
tag--though unrecognized--and Apache treats it as such. Since it doesn't
know what to do with a <?php ?> tag, it simply doesn't display anything
when rendering the tag.

Apache needs a module installed, such as libapache2-mod-php5 (in Debian,
I believe) in order to parse PHP files and tags properly. There are .deb
(Debian pacakage), .rpm (RedHat package), and plain ol' .tgz (GZipped
Tar-ball) distributions of the PHP5 Apache2 module. Without this, there
will be no bridge between Apache(2) and your PHP interpreter.

HTH,


Todd Boyd
Web Programmer




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



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux