Re: Re: Continuance of the struggle (trying to understand)

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

 



Col:

If i am reading this correctly, then i think you're looking at this all
wrong.

If you're working within some kind of page, stored outside of the
http://localhost served by apache, like say the .php file is on the
desktop... then yeah, you're not going to get the PHP information
displayed.

(tech people bare with me here...)
PHP pages, are "compiled" when called... so you need apache to call php
and translate the PHP code so that if there is any output, it will
display that output.

If you're trying to show a .php file from teh desktop, then apache isn't
handeling this request, and therefor has no idea that there is php code
that has to be compiled, and therefore it will just ignore it.

I am sure that I am goign to get flamed for that, but i think that it
kinda simplifies what apache does for php.

NOW... you can run a php file from the command line, but you're not
going to get the HTML results as you would had you ran if from the
localhost where apache knows what to do with a .php file.

So... long story short, if you want PHP to display the PHP stuff, then
you will need to have it interpreted by apache (or IIS, or whatever your
web server software is) to have it spit back to a web browser client.

Hopefully this makes sense, it is early here, i am just getting into
work :(, and it made sense while i was typing it... but my coffee intake
has not had time to work it's wonderful magic with me yet, so my
thoughts may be scattered.

Steve



On Tue, 2010-10-05 at 12:57 +0100, Col Day wrote:
> LOL!
> 
> This is WITH xammp!!
> 
> 
> 
> "Gary" <php-general@xxxxxxxxxxxxxxx> wrote in message 
> news:i8f26m$j4r$2@xxxxxxxxxxxxxxxxxx
> > Col Day wrote:
> >> ""Col Day"" <colinday3@xxxxxxx> wrote in message
> >> news:23.81.45586.2820BAC4@xxxxxxxxxxxxxxx
> >>>    <html>
> >>>    <head>
> >>>    <title>PHP Test</title>
> >>>    </head>
> >>>    <body>
> >>>    <p>This is an HTML line
> >      </p> <!-- close your tag, you evil man! :-) -->
> >>>    <?php
> >>>       echo "<p>This is a PHP line</p>";
> >>>       phpinfo();
> >>>    ?>
> >>>    </body>
> >>>    </html>
> >
> >> If I paste this into a webpage I only get the "HTML" line as before.
> >
> > What do you mean, "webpage"? foo.php, for example, or foo.html? If the
> > latter then I am guessing your Apache will serve the page purely as
> > html, and it will never be processed by php. If the former then check
> > that Apache is configured to run php files through php before serving
> > them (must admit, I'm not sure how to do that, it depends on your Apache
> > and PHP). Or, really, just install xampp, it's by far the easiest way
> > and will avoid all the problems associated with configuring two rather
> > complex pieces of software.
> > 
> 
> 



-- 
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