473,854 Members | 1,836 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

PHP Script not execute but displayed as regular HTML documents

Jimmy Liew
8 New Member
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 6286
coolsti
310 Contributor
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
Jimmy Liew
8 New Member
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 Contributor
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 Recognized Expert Expert
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 Recognized Expert Specialist
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
12991
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 scripts. Being a javascript newbie and after significant testing, I suspect that the document.write fails after finding a </script> within pageVar. Does a trick exist that enables one to slightly alter pageVar whereby enabling...
13
7793
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 within that directory OR 2) Within a specific page, set the timeout as per http://www.microsoft.com/windows2000/en/server/iis/default.asp?url=/windows2000/en/server/iis/htm/asp/vbob246s.htm e.g. <% Server.ScriptTimeout = 1 %> and that the value in...
8
1681
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 interact with the vb program. Every kind of help is well accepted. Thank you .
20
3434
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
3468
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 knowledge document of that application resides. App1 \\server\documents\App1.doc
2
3095
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 childNodes. It seems that Firefox does not recognize this line of code >> xmlDoc.getElementsByTagName("urlValue").childNodes.nodeValue I'm not sure if this is the line that is not working, or the lines before it. I'm looping to the childNodes to compare to...
1
2667
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 to also save all this data to an Access db and have created one that has all the same field names. I have copied my working SQL statement, modified with correct fields for new db and appended it to the bottom of my existing ASP email script. Good...
9
2500
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 class=\"notice_tan\">(.| \s)*</div>/", "", $site); I'm trying to remove from the very top to a specific div Top of file:
1
47515
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 on a link and after a moment or two a file download dialog box pops-up in your web browser and prompts you for some instructions, such as “open” or “save“. I’m going to show you how to do that using a perl script. What You Need Any recent...
0
9901
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9752
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10371
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9517
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7918
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
7082
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5744
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5942
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4563
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.