Kahuki Webmaster Forum and Discussion Community  

Go Back   Kahuki Webmaster Forum and Discussion Community > Website Development & Management > Programming > PHP



Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 01-24-2006, 11:52 PM
Member
 
Join Date: Sep 2005
Posts: 74
macca is on a distinguished road
php / apache configuration problem: apache not parsing php correctly?

I am having trouble that I believe is caused by some issue with my apache / php configuration. My environment is XAMPP on windows xp.

This issue is around passing objects. Things work find when I debug my code in my IDE (PHP Designer 2006). The problem comes when I actually invoke the pages in the browswer. What has worked correctly in the debugger then fails in the browser.

Specifically, the browser simply returns the source code of the php file instead of what that code is supposed to return. It is as if it does not recognize the php tags and then just treats it as if it were just html text to output.

The code itself is quite simple:

<?php
//include Track class
require("Track.php");

//get parameters from query string
//load into $mycri

$mycri = array('rock','party');

//create Track object and run query
$mytrack = new Track();

$myarray = $mytrack->find($mycri);

//print out results
print_r($myarray);

?>

This generally happens only with includes.

Any thoughts?

Reply With Quote
  #2 (permalink)  
Old 01-25-2006, 12:19 AM
Rookie
 
Join Date: Apr 2006
Posts: 7
Spidey is on a distinguished road
As long as the file is saved with a .php extension, it should work just fine. If it is saved as .php and only shows source, there is a problem with either apache's configuration or XAMPP. I'd recommend maybe reinstalling XAMPP in that case.

Reply With Quote
  #3 (permalink)  
Old 03-14-2006, 07:23 AM
Rookie
 
Join Date: Apr 2006
Posts: 5
a3a09277 is on a distinguished road
I hope you've got this fixed by now. But, as the above answer stated, the includes will always be parsed if you save them as .php files. If they have a different extension, they may not work with different configurations.

Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Apache server Problem??????? Richard Web Hosting 2 04-11-2007 11:19 PM
What is apache server? movingout Web Hosting 7 01-27-2007 09:14 AM
Apache problem: two .htaccess? Jem4Himesh Web Hosting 1 01-10-2007 07:22 PM
Apache Server Help!? Frenkel Web Hosting 4 01-09-2007 10:14 AM
PHP & Apache installed on Linux, but PHP is not running on Apache. Am i need to install any rpms? cutereems PHP 1 10-04-2006 05:05 AM

Databases For Websites

All times are GMT. The time now is 08:28 PM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0