php stops executing scripts!?!?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
dastudios
Forum Newbie
Posts: 5
Joined: Tue Aug 29, 2006 8:28 am

php stops executing scripts!?!?

Post by dastudios »

I'm not sure whats going wrong here.
My friend downloaded and installed XAMPP - works fine. No problems at all. But as soon as a certain number of php files exist in a directory, they refuse to execute.

No errors, just they don't get parsed by php, all it outputs is the source code of the php file.

Anyone had this problem before, or have some idea whats going wrong? Anything at all would be appreciated.
User avatar
Obadiah
Forum Regular
Posts: 580
Joined: Mon Jul 31, 2006 9:13 am
Location: Ashland, KY
Contact:

Post by Obadiah »

what folder do you have your files in? i placed all my content in the htdocs folder....that should work fine....how many files arte in the folder thats not executing...are you just linking from page to page?
dastudios
Forum Newbie
Posts: 5
Joined: Tue Aug 29, 2006 8:28 am

Post by dastudios »

Yes they are in htdocs. There are currently 19 files in the directory and at least 2 files that dont get executed by php. I am just linking from page to page.

Thanks for your fast response though.

EDIT: some files get sent postdata as well. I did once experience this before, which back then the project was small enough for me to compile it all into one single php file.. but this one is much to big to do that kind of thing.
User avatar
Obadiah
Forum Regular
Posts: 580
Joined: Mon Jul 31, 2006 9:13 am
Location: Ashland, KY
Contact:

Post by Obadiah »

ok...what do you mean by not executing...do you get a page cannot be displayed...do you see the code in the window....what happens when you follow the link?
dastudios
Forum Newbie
Posts: 5
Joined: Tue Aug 29, 2006 8:28 am

Post by dastudios »

I get sent the source code of the php script - either the page is blank or the browser makes out what it can of the static html inside the php. When I "view source" of the page I can see the raw php script. Not only is it annoying its also a security risk.
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

So at what number of files does apache stop processing PHP scripts?
User avatar
Obadiah
Forum Regular
Posts: 580
Joined: Mon Jul 31, 2006 9:13 am
Location: Ashland, KY
Contact:

Post by Obadiah »

try this....try going on another computer and seeing if the same thing happens...if it does....i would move all my stuff outside of the htdocs folder then uninstall and reinstall then restart your server and/or pc....ill look into this a little more for you...i have xampp but i never ran into this problem myself but...ill definately look into it for ya
dastudios
Forum Newbie
Posts: 5
Joined: Tue Aug 29, 2006 8:28 am

Post by dastudios »

Ok, I just downloaded xampp, installed it on my computer. EXACTLY the same problem.... same files causing the problem too.

This is crazy!
dastudios
Forum Newbie
Posts: 5
Joined: Tue Aug 29, 2006 8:28 am

Post by dastudios »

AH! I THINK I MAY HAVE IT!

Does the encoding of the file make a difference? I re-saved one of the files that was causing trouble using notepad, selected ANSI encoding instead of UTF-8... and now it seems to work.

thanks so far!
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

As long as there's no BOM injected by the UTF-8 encoding, PHP can handle it fine, that I recall. However with the BOM, you will run into issues with headers, cookies and the like.
Post Reply