473,324 Members | 2,179 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

PHP Script not execute but displayed as regular HTML documents

Jimmy Liew
I have a problem executing my php scripts. The scripts displayed as regular HTML documet and not execute. When I view source, it display the full complete php source code I have in the server. I don't really sure whether the bugs is from IIS or php. So far, I have done all necessary steps in setting up php, and phpinfo() executed with no error found.

Kindly advice. Thank You.
Aug 8 '08 #1
5 6275
coolsti
310 100+
Do you have the php start and stop tags in place? <?php and ?>

Or it might be a server configuration problem, maybe your php engine isn't running.

By the way, it is a good idea from a security point of view to move most of your PHP code away from the html document tree, so something like this cannot happen. Given the right permissions on the directory folder, your PHP engine can read a file in from another location using "include" or "require" commands which the html server does not have access to. Just put code stubs in your document tree which "include" or "require" the actual script code from another location.
Aug 8 '08 #2
Do you have the php start and stop tags in place? <?php and ?>

Or it might be a server configuration problem, maybe your php engine isn't running.

By the way, it is a good idea from a security point of view to move most of your PHP code away from the html document tree, so something like this cannot happen. Given the right permissions on the directory folder, your PHP engine can read a file in from another location using "include" or "require" commands which the html server does not have access to. Just put code stubs in your document tree which "include" or "require" the actual script code from another location.
Thanks for your help on this.

Yes, I have the php start and stop tags in place. The full source codes work fine on another web server. Is that anything I need to configure on IIS, since the IIS has some difficulty to compile the php scripts?

I have no problem to load the phpinfo(), does it mean that my php is working fine?
Aug 8 '08 #3
coolsti
310 100+
I cannot help with IIS, I am using Linux, so I hope another forum reader can give you some advice here.
Aug 8 '08 #4
Atli
5,058 Expert 4TB
Hi.

Do you use the <?php ?> tags, or the shorter <? ?> version?
If you use the short-tag version, try the former.

You say phpinfo() works? If that is the case, your server does seem to have PHP loaded correctly. Which means this has to be a problem with your code.

Try putting a phpinfo() file in the same directory as your other code. See if that works.
Aug 8 '08 #5
kenobewan
4,871 Expert 4TB
Could be as simple as allowing the php we extension in IIS, but I'm not a php user. Try here:
PHP on IIS
Aug 9 '08 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: Mike Daniel | last post by:
I am attempting to use document.write(pageVar) that displays a new html page within a pop-up window and the popup is failing. Also note that pageVar is a complete HTML page containing other java...
13
by: Patrick | last post by:
I understand that with IIS5.1 on Windows XP Professional SP1, I can 1) Either set under IIS Manager-> Any specific Virtual Directory-> Configuration->Options->ASP Script timeout for all pages...
8
by: Fabrizio Cyber | last post by:
Hi all, I want to use a .js into a visual basic project. How can I do it ? I've tried to open the script code into my project....and then ??? I see the code but I don't jnow how to make it...
20
by: Geoff Hill | last post by:
What's the way to go about learning Python's regular expressions? I feel like such an idiot - being so strong in a programming language but knowing nothing about RE.
3
by: balazee | last post by:
Hi, I’ve some data in an excel sheet which needs to be displayed in an html page as lists. For example, In the excel I’ve the below details like, the application name and the path where the...
2
by: willyWEB66 | last post by:
Hi everyone, I have this code in javascript where the XML file is loaded and displayed to an html using XSLT. It works fine in IE but not in Firefox. My problem is in the looping to the...
1
by: somnamblst | last post by:
I have a Flash form that uses ASP to write to Access db. I have an HTML form that uses ASP to upload files and email those files and sends copies to recipients based on the form fields. I would like...
9
by: Rene | last post by:
I'm trying to basically remove chunks of html from a page but I must not be doing my regular expression correctly. What i'm trying with no avail. $site = preg_replace("/<!DOCTYPE(.|\s)*<div...
1
KevinADC
by: KevinADC | last post by:
Note: You may skip to the end of the article if all you want is the perl code. Introduction Many websites have a form or a link you can use to download a file. You click a form button or click...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.