0

I'm having the same issue as here: PHP code is not being executed, instead code shows on the page

That thread lists lots of useful tips, all of which I've followed but to no avail. Details:

  • Brand new machine running Windows8
  • Browsing with Chrome
  • Using Apache 2.2 (and therefore selected VC6 for PHP, rather than something more recent) PHP is installed
  • I manually edited the config files following this tutorial: http://www.youtube.com/watch?v=JJkAr_xyHWg (found the same advice elsewhere, too, and everything is appropriately (un)commented).
  • I'm serving from localhost (and for my purposes, I only ever want to use localhost)
  • Not using short tags
  • Saved the config file in UTF8 encoding.
  • My code executes just fine on my Mac, from which I've been running a local server for a while now.
  • Mysterious but probably unrelated error: this machine has intermittent difficulty maintaining a wifi connection, especially when switching back & forth between local and remote servers.
  • a simple .php file that calls phpinfo() returns all the appropriate info, nicely formatted

Remaining possibilities:

  • My version(s) of Apache and/or PHP are bad or incompatible with each other or with Windows 8. (WAMP and EasyPHP gave me different problems, but that's another story!)
  • There's some other random trick out there that no one has mentioned yet, like the text encoding thing. Who knew!?
  • I've made some error in editing the config files.

I'm at my wits' end now, and reading all the existing answers here wasn't leading me anywhere new. Does anyone have more ideas?

Community
  • 1
  • 1
user2411121
  • 41
  • 1
  • 10
  • the phpinfo() using file same name\directory as the non working test? –  Jan 16 '14 at 02:10
  • I use XAMPP. Put it directly in your C drive. – StackSlave Jan 16 '14 at 02:28
  • Same directory, yes- haven't put the call in the same file yet; should have thought of that. I'll try it first thing tomorrow and report back. Failing that, I guess I'll give XAMPP a go. I'm a little concerned, though, that the php.ini file will still bear traces of the tweaks I made for Apache. Will I need to re-do all those again? (This is the first time I've set up a server on a PC; the MAMP install for my Mac was a piece of cake.) – user2411121 Jan 16 '14 at 04:40
  • Update for @Dagon: phpinfo() returns the appropriate result on the first page that I load. From there, there's a function that calls a new URL, which is just the same URL with a ?Page= argument appended to it. I have a feeling that the error is in how I'm defining my new URL, but there's not enough space in the comment field for me to explain all that. Is there some special way I need to format URLs for them to work on a PC?? – user2411121 Jan 16 '14 at 15:05
  • I'm stepping back to an earlier problem I thought I fixed, but maybe my "solution" is what's causing the above problem. I define the new URL I want to load with a function called CurrentFile, which explodes the current URL into component parts based on the "/" character. When I echo the new URL I'm trying to load, it returns C:\Apache2.2\htdocs\myfolder\myfile.php?Page=2 That looks exactly right. But when I try loading that, js console gives the following error: Not allowed to load local resource: file///C:/Apache2.2/htdocs/myfolder/myfile.php?Page=2 Is the issue about '\' vs. '/'? – user2411121 Jan 16 '14 at 15:29

0 Answers0