Home | Blog | Software | Reviews and Features | Forum | Help | Donate | About us
topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • December 09, 2016, 01:43:32 AM
  • Proudly celebrating 10 years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: Bumfuzzled again: PHP doesn't work on ONE (1) page <whimper /> ...  (Read 2912 times)

barney

  • Charter Member
  • Joined in 2006
  • ***
  • Posts: 1,282
    • View Profile
    • Donate to Member
I don't even know how to troubleshoot/research this one.  There's a local Apache/MySQL/PHP installation on my dev box, latest - I think? - versions of each.

PHP files load just fine from most of the subdirs of the Web root.  However, there's one HTML (index.html) file that simply does not allow PHP to be recognized.  It's driving me buggy.  I've tried reinstalling both Apache and PHP, to no avail.  Nothing I can find in the HTML and related CSS file(s) would appear to be normal.  But a simple
Code: PHP [Select]
  1. <?php include 'file.ext'; ?>
doesn't work, nor does it highlight properly in the editor (Komodo Edit).  As stated in the post title, I'm bumfuzzled :'(.

Eóin

  • Charter Member
  • Joined in 2006
  • ***
  • Posts: 1,401
    • View Profile
    • Donate to Member
Re: Bumfuzzled again: PHP doesn't work on ONE (1) page <whimper /> ...
« Reply #1 on: March 22, 2011, 07:46:13 PM »
One guess, shouldn't the extension have to be .php, i.e. index.php?

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 36,421
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: Bumfuzzled again: PHP doesn't work on ONE (1) page <whimper /> ...
« Reply #2 on: March 22, 2011, 08:14:14 PM »
umm...

the lack of syntax highlighting should be a clue.

in php you need parentheses to use parentheses with include, as its a function.  e.g. include('file.ext'), don't you?
actually i see from php help pages you don't need parentheses.. though clearly your ide syntax highlighter thinks you do.. bah stupid language kludges.
« Last Edit: March 22, 2011, 08:16:41 PM by mouser »

barney

  • Charter Member
  • Joined in 2006
  • ***
  • Posts: 1,282
    • View Profile
    • Donate to Member
Re: Bumfuzzled again: PHP doesn't work on ONE (1) page <whimper /> ...
« Reply #3 on: March 22, 2011, 10:08:47 PM »


One guess, shouldn't the extension have to be .php, i.e. index.php?

That lets PHP know it's a PHP page, but I've oft included
<?php ... ?>
in html pages w/o harm.  Although, perhaps I need to make some adjustment to httpd.conf?

<?php
    
echo "Menu";
    include (
'sidemenu.html');
  
?>
is the particular bit that's not being recognized.

Have I forgotten some httpd.conf configuration?  This is  a new installation, so I may have overlook some configuration, but I cannot see it (after many reviews of both httpd.conf and php.ini)

the lack of syntax highlighting should be a clue.

Yeah, I concur, but I cannot determine what the clue indicates.  Other pages indicate properly , some .html , some .php.

barney

  • Charter Member
  • Joined in 2006
  • ***
  • Posts: 1,282
    • View Profile
    • Donate to Member
Re: Bumfuzzled again: PHP doesn't work on ONE (1) page <whimper /> ...
« Reply #4 on: March 22, 2011, 10:27:18 PM »
 :-[ :-[ :-[ :-[ :-[ :-[ :-[
I was calling the wrong file.
 :-[ :-[ :-[ :-[ :-[ :-[ :-[

Doesn't change the rest of my confusion, though.

I was so certain of the file name that I never bothered to check that it was in place.  Damned dumb tyro error, ya know?

<sigh> Will I ever learn?</sigh>

Boydon

  • Supporting Member
  • Joined in 2010
  • **
  • default avatar
  • Posts: 24
    • View Profile
    • Donate to Member
Re: Bumfuzzled again: PHP doesn't work on ONE (1) page <whimper /> ...
« Reply #5 on: March 23, 2011, 02:40:24 AM »
Next time just put a:

Code: PHP [Select]
  1. <?php error_reporting(E_ALL | E_STRICT); ?>

at the beginning of you php file. This will enable very verbose warnings.

barney

  • Charter Member
  • Joined in 2006
  • ***
  • Posts: 1,282
    • View Profile
    • Donate to Member
Re: Bumfuzzled again: PHP doesn't work on ONE (1) page <whimper /> ...
« Reply #6 on: March 23, 2011, 09:47:19 AM »
error_reporting = E_ALL & ~E_DEPRECATED
in PHP.ini ... but the error log being updated wasn't the error log I was tracking.  I seldom set PHP to report errors on-page, as that can significantly interfere with page structure.  I just lost track of which error log was being updated because of the multiple installs - basically, I confused myself  :-[.

widgewunner

  • Member
  • Joined in 2009
  • **
  • Posts: 90
    • View Profile
    • Donate to Member
Re: Bumfuzzled again: PHP doesn't work on ONE (1) page <whimper /> ...
« Reply #7 on: March 23, 2011, 09:13:03 PM »
First thing to run/check is <?php phpinfo(); ?>

barney

  • Charter Member
  • Joined in 2006
  • ***
  • Posts: 1,282
    • View Profile
    • Donate to Member
Re: Bumfuzzled again: PHP doesn't work on ONE (1) page <whimper /> ...
« Reply #8 on: March 23, 2011, 09:17:14 PM »
First thing to run/check is <?php phpinfo(); ?>
Well ... yeah ... but running phpinfo(); doesn't correct for idiocy  :P.  'Sides, there are other issues that phpinfo(); won't correct <sigh /> :'(.

Renegade

  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 13,220
  • Tell me something you don't know...
    • View Profile
    • Renegade Minds
    • Donate to Member
Re: Bumfuzzled again: PHP doesn't work on ONE (1) page <whimper /> ...
« Reply #9 on: March 23, 2011, 09:21:13 PM »
Not sure if this is relevant, but I came across a situation where <?php vs. <? vs. <?php[major version] broke with some of those being deprecated and made obsolete. It took me a while to figure out the problem. That was a while ago though, and I don't remember the specifics.
Slow Down Music - Where I commit thought crimes...

Freedom is the right to be wrong, not the right to do wrong. - John Diefenbaker

barney

  • Charter Member
  • Joined in 2006
  • ***
  • Posts: 1,282
    • View Profile
    • Donate to Member
Re: Bumfuzzled again: PHP doesn't work on ONE (1) page <whimper /> ...
« Reply #10 on: March 23, 2011, 10:11:30 PM »
Not sure if this is relevant, but I came across a situation where <?php vs. <? vs. <?php[major version] broke with some of those being deprecated and made obsolete. It took me a while to figure out the problem. That was a while ago though, and I don't remember the specifics.

Oh, it is relevant ... fell into that trap many a time afore I disabled short keys.  Some servers just don't recognize 'em, and some servers want even more  :huh:.  Mostly a thing of the past, methinks, but definitely problematic at the time.