Author Topic: [SOLVED] Problem in PHP  (Read 467 times)

0 Members and 1 Guest are viewing this topic.

Offline ~n[EO]n~Topic starter

  • Devotee
  • Posts: 725
    • View Profile
[SOLVED] Problem in PHP
« on: October 01, 2007, 03:22:23 AM »
hi all,

I just updated my PHP, Apache and MY SQL to this version
Apache version :
Apache/2.2.4 (Win32)

PHP version :
5.2.4
 
MySQL version :
5.0.45-community-nt

and previous I had

php 5.0.3
apache 1.3.33
MySQL version :  4.1.8-nt-log - extension : mysqli

Now the problem is all my sites which are in localhost are not working, all the pages displays the PHP code itself. No error is given only i see some images and all the PHP codes coming

Code: [Select]
_table_name=CMS_TABLE; $sSqlQuery=" where cms_id=?" ; $row = $tbl->find($sSqlQuery,array($id)); $count=$tbl->_row_count; if($count>0) { $desc=$row->cms_desc; } $desc1=""; $id1=2; $tbl1=new Model; $tbl1->_table_name=CMS_TABLE; $sSqlQuery1=" where cms_id=?" ; $row1 = $tbl1->find($sSqlQuery1,array($id1)); $count1=$tbl1->_row_count; if($count1>0) { $desc1=$row1->cms_desc; } $sSqlQuery2="select * from ".MOVIES_TABLE." WHERE movies_home=1"; $res2 = $tbl1->find_query_all($sSqlQuery2); $count2=count($res2); ?>
Anyone knows why this is happening ???

Thanks in advance...


Offline xylex

  • Enthusiast
  • Posts: 256
    • View Profile
Re: Problem in PHP
« Reply #1 on: October 01, 2007, 03:26:04 AM »
You need to specify a handler (preferably PHP) for files with a .php extension in your httpd.conf file.  Make sure you restart apache after you do that.
The greatest inefficiencies come from solving problems you will never have.  -Rasmus

PHP Development Blog

Offline ~n[EO]n~Topic starter

  • Devotee
  • Posts: 725
    • View Profile
Re: Problem in PHP
« Reply #2 on: October 01, 2007, 03:30:07 AM »
I don't think so, cause I had removed the older version of WAMP and installed the latest version. First time also i hadn't done anything in the httpd.conf file i think WAMP does that automatically. I maybe wrong but i am searching for that "handler" in httpd.conf ;)

Offline thorpe

  • Administrator
  • 'Mind Boggling!'
  • *
  • Posts: 29,255
    • View Profile
Re: Problem in PHP
« Reply #3 on: October 01, 2007, 04:30:24 AM »
Quote
Anyone knows why this is happening

Your apache server has not been properly configured to run php. Are you using the full <?php tags?

Offline ~n[EO]n~Topic starter

  • Devotee
  • Posts: 725
    • View Profile
Re: Problem in PHP
« Reply #4 on: October 01, 2007, 05:16:23 AM »
Your apache server has not been properly configured to run php. Are you using the full <?php tags?

Thanks Thorpe, I hadn't used <?php in my code, when i used it it works fine but still in some part the code comes..  ??? confused

my structure is like this

Code: [Select]
<?php
// here i have used the query to fetch data 

?>

HTML stuff is here

and again
<?php echo "rs['image']; 
/* this part shows the code itself does not shows the image, do we have to use <?php everywhere we open the php tag or <? will work in other part, while using <? echo only, it shows error, something like brace is not closed but using <?php it shows the code itself*/

// but it was working perfectly in previous version....
?>




Any idea...

Offline Orio

  • Staff Alumni
  • Addict
  • *
  • Posts: 2,496
  • Gender: Male
    • View Profile
    • OriosRiddle
Re: Problem in PHP
« Reply #5 on: October 01, 2007, 05:20:47 AM »
If you want to use <? too, simply set the short_open_tag directive in your ini file to true.
Btw, you haven't closed the quote in the echo, is that causing the error?

Orio.
Think you're smarty?

(Gone until 20 to November)