php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #62636 PHP treated as HTML
Submitted: 2012-07-23 01:48 UTC Modified: 2012-07-23 02:25 UTC
From: brandonskypimenta at gmail dot com Assigned:
Status: Not a bug Package: Scripting Engine problem
PHP Version: Irrelevant OS: Mac OS X
Private report: No CVE-ID: None
 [2012-07-23 01:48 UTC] brandonskypimenta at gmail dot com
Description:
------------
When running a script that is external (including it into another PHP file) opening that file will result in that external PHP being rendered as HTML text on the screen.

Test script:
---------------
(This is not a test script. It is an attempt to make a MediaWiki extension.)

$wgExtensionCredits['validextensionclass'][] = array(
       'path' => __FILE__,
       'name' => 'Vote Pages', 
       'url' => 'https://www.mediawiki.org/wiki/Extension:VotePage', 
       'description' => 'Allows unregistered and registered users to vote pages',
       'version'  => 1.0,
);

$rate = '<iframe frameborder="0" src="rate.html" height="91">'

return $rate;

Expected result:
----------------
The external PHP script should have ran.

Actual result:
--------------
It displays the code and any HTML that has been used in the external PHP file will be displayed instead.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2012-07-23 01:56 UTC] aharvey@php.net
Thank you for this bug report. To properly diagnose the problem, we
need a short but complete example script to be able to reproduce
this bug ourselves. 

A proper reproducing script starts with <?php and ends with ?>,
is max. 10-20 lines long and does not require any external 
resources such as databases, etc. If the script requires a 
database to demonstrate the issue, please make sure it creates 
all necessary tables, stored procedures etc.

Please avoid embedding huge scripts into the report.

We actually need a self contained, small reproducable test script, not an unrelated piece of code. :)

That said, this sounds very, very unlikely to be a PHP bug based on the description.
 [2012-07-23 01:56 UTC] aharvey@php.net
-Status: Open +Status: Feedback -Package: Performance problem +Package: Scripting Engine problem
 [2012-07-23 02:12 UTC] brandonskypimenta at gmail dot com
Oops! I forgot to add <?php at the beginning and ?> at the end. Sorry, not a bug.
 [2012-07-23 02:12 UTC] brandonskypimenta at gmail dot com
-Status: Feedback +Status: Closed
 [2012-07-23 02:25 UTC] aharvey@php.net
-Status: Closed +Status: Not a bug
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Sun Jul 06 13:01:35 2025 UTC