Prev: Bug #52782: DOMDocument subclass forgotten using ->ownerDocumentafter closure
Next: Filesystem path creation function
From: Steve Staples on 5 Oct 2010 08:26 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(a)garydjones.name> wrote in message > news:i8f26m$j4r$2(a)dough.gmane.org... > > Col Day wrote: > >> ""Col Day"" <colinday3(a)aol.com> wrote in message > >> news:23.81.45586.2820BAC4(a)pb1.pair.com... > >>> <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. > > > >
From: chris h on 5 Oct 2010 09:13 "If I paste the script into a web page" What do you mean by "paste the script into a web page"? Can you tell us exactly what you are doing when you do that? Chris. On Tue, Oct 5, 2010 at 7:54 AM, Col Day <colinday3(a)aol.com> wrote: > Hi Shreyas, > > Ok, as far as I can tell the script should show "This is an HTML line" > reflecting that I am seeing the HTML part of the script followed by "This is > a PHP line" to show that PHP is installed and working fine. > > If I view the script directly in IE by going to > http://localhost/phptest.php I get the output: > > > This is an HTML line > > This is a PHP line > > followed by a large and detailed list of the PHP install which includes > things like compiler language etc. > > If I paste the script into a web page then all that is displayed is > > This is an HTML line. > > Nothing else whatsoever. > > I am fairly confused. I've tried a couple of different web page creators > (Webplus 10 and Web page maker) and get the same result. > > Sorry if I sound extremely naive but it's bugging me now and I want to > understand. > > Cheers > > "Shreyas Agasthya" <shreyasbr(a)gmail.com> wrote in message > news:AANLkTi=4ke1sTf8TaN7+EcJO-UX5CJ=t9-0qcTCFkx0+(a)mail.gmail.com... > > Col, >> >> Can you let us know what exactly you see when you say >> http://localhost:/phptest.php >> ? >> >> >> Regards, >> Shreyas >> >> On Tue, Oct 5, 2010 at 4:20 PM, Col Day <colinday3(a)aol.com> wrote: >> >> >>> ""Col Day"" <colinday3(a)aol.com> wrote in message >>> news:23.81.45586.2820BAC4(a)pb1.pair.com... >>> >>> Hi all, >>> >>>> >>>> After my escapades with the real basics and realizing my laptop wasn't >>>> logged on as Administrator, I now am trying to work out why this script >>>> works sometimes but not others. >>>> >>>> <html> >>>> <head> >>>> <title>PHP Test</title> >>>> </head> >>>> <body> >>>> <p>This is an HTML line >>>> <?php >>>> echo "<p>This is a PHP line</p>"; >>>> phpinfo(); >>>> ?> >>>> </body> >>>> </html> >>>> >>>> If I save this as phptest.php and open IE pointing it to >>>> localhost/phptest.php it works fine. Get both lines of text followed by >>>> the >>>> pages of gumpf about php. >>>> >>>> However if I paste this into a >>>> >>>> >>>> >>>> That was weird! >>> >>> I was saying, If I paste this into a webpage I only get the "HTML" line >>> as >>> before. >>> >>> Anyone have any ideas? >>> >>> PHP is obviously working as is apache. Just don't understand why they >>> don't >>> show up in web pages. >>> >>> Cheers again all! >>> >>> -- >>> PHP General Mailing List (http://www.php.net/) >>> To unsubscribe, visit: http://www.php.net/unsub.php >>> >>> >>> >> >> -- >> Regards, >> Shreyas Agasthya >> >> > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > >
From: "Ford, Mike" on 5 Oct 2010 10:16 > -----Original Message----- > From: Col Day [mailto:colinday3(a)aol.com] > Sent: 05 October 2010 12:55 > To: php-general(a)lists.php.net > Subject: Re: [PHP] Re: Continuance of the struggle (trying to > understand) > > Hi Shreyas, > > Ok, as far as I can tell the script should show "This is an HTML > line" > reflecting that I am seeing the HTML part of the script followed by > "This is > a PHP line" to show that PHP is installed and working fine. > > If I view the script directly in IE by going to > http://localhost/phptest.php > I get the output: > > This is an HTML line > > This is a PHP line > > followed by a large and detailed list of the PHP install which > includes > things like compiler language etc. > > If I paste the script into a web page then all that is displayed is What on earth does this mean? http://localhost/phptest.php *is* a web page -- especially as you have structured it as PHP within HTML -- so why would you want to paste the code anywhere else? I think your concepts are a little skew-whiff, and you need to explain what it is you think you're trying to do in more detail so that we can spot where it is that your understanding is wrong. Cheers! Mike -- Mike Ford, Electronic Information Developer, Libraries and Learning Innovation, Leeds Metropolitan University, C507 City Campus, Woodhouse Lane, LEEDS, LS1 3HE, United Kingdom Email: m.ford(a)leedsmet.ac.uk Tel: +44 113 812 4730 To view the terms under which this email is distributed, please go to http://disclaimer.leedsmet.ac.uk/email.htm
From: tedd on 5 Oct 2010 13:56 At 12:54 PM +0100 10/5/10, Col Day wrote: >Hi Shreyas, > >Ok, as far as I can tell the script should show "This is an HTML >line" reflecting that I am seeing the HTML part of the script >followed by "This is a PHP line" to show that PHP is installed and >working fine. Col: Do this: 1. Create a file and entitle it "index.php" (without quotes) 2. Enter "<?php phpinfo();?>" (without quotes) 3. Save the file. 4. Upload the file to your host. 5. Open a browser and enter the url (i.e., http://yourdomain.com/index.php) What do you see? Cheers, tedd -- ------- http://sperling.com/
From: tedd on 5 Oct 2010 14:32 At 1:56 PM -0400 10/5/10, tedd wrote: >At 12:54 PM +0100 10/5/10, Col Day wrote: >>Hi Shreyas, >> >>Ok, as far as I can tell the script should show "This is an HTML >>line" reflecting that I am seeing the HTML part of the script >>followed by "This is a PHP line" to show that PHP is installed and >>working fine. > >Col: > >Do this: > >1. Create a file and entitle it "index.php" (without quotes) >2. Enter "<?php phpinfo();?>" (without quotes) >3. Save the file. >4. Upload the file to your host. >5. Open a browser and enter the url (i.e., http://yourdomain.com/index.php) > >What do you see? > >Cheers, > >tedd Col: You don't have to tell what you see, but rather do you see anything? Cheers, tedd -- ------- http://sperling.com/
First
|
Prev
|
Next
|
Last
Pages: 1 2 3 Prev: Bug #52782: DOMDocument subclass forgotten using ->ownerDocumentafter closure Next: Filesystem path creation function |