Unable to run as PHP web page

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
gvnkcoolguy
Forum Newbie
Posts: 3
Joined: Fri Jul 22, 2011 4:45 am

Unable to run as PHP web page

Post by gvnkcoolguy »

Hi,

I'm new to PHP coding. As of now, I have configured Eclipse Helios 3.6 in my machine to work with PHP 5. I have configured Xend Debugger as the default debugger. When I run a simple code as shown below as a PHP web page, I get a "This program cannot display the webpage" message in the internal Eclipse browser. But I get the output when I run it as a PHP Script.

Can you suggest what changes/corrections should I make to make my PHP code run as a web page.

Sample code:

Code: Select all

<?php
echo "Welcome to ";
print("PHP Coding");
?>
User avatar
social_experiment
DevNet Master
Posts: 2793
Joined: Sun Feb 15, 2009 11:08 am
Location: .za

Re: Unable to run as PHP web page

Post by social_experiment »

gvnkcoolguy wrote:But I get the output when I run it as a PHP Script.
It works when you view the page in an external browser like firefox?
“Don’t worry if it doesn’t work right. If everything did, you’d be out of a job.” - Mosher’s Law of Software Engineering
gvnkcoolguy
Forum Newbie
Posts: 3
Joined: Fri Jul 22, 2011 4:45 am

Re: Unable to run as PHP web page

Post by gvnkcoolguy »

No, I don't get the output in an external browser also. Any suggestions to make it run in a Web page?
User avatar
social_experiment
DevNet Master
Posts: 2793
Joined: Sun Feb 15, 2009 11:08 am
Location: .za

Re: Unable to run as PHP web page

Post by social_experiment »

gvnkcoolguy wrote:No, I don't get the output in an external browser also. Any suggestions to make it run in a Web page?
Maybe the php configuration is incorrect :?: I don't know anything about the IDE that you are using so im speculating here. As for the second part of your question, webpage is a generic term for a page (regardless of extension) that can be viewed using a browser. Technically you have already created a webpage :/
“Don’t worry if it doesn’t work right. If everything did, you’d be out of a job.” - Mosher’s Law of Software Engineering
gvnkcoolguy
Forum Newbie
Posts: 3
Joined: Fri Jul 22, 2011 4:45 am

Re: Unable to run as PHP web page

Post by gvnkcoolguy »

I meant, running it as a web page. In the Eclipse IDE, I get two options - Run as a PHP script or Run as a PHP Web page. The first option gives me the output but only in the IDE Console. The second option of displaying the stuff in a Web page doesn't work. So, what configuration changes should I make to get it running as a PHP Web page? As of now, I have downloaded the Zend debugger and configured it by specifying the paths of the php.exe and .ini files in the IDE. Anything else that I should do?
User avatar
social_experiment
DevNet Master
Posts: 2793
Joined: Sun Feb 15, 2009 11:08 am
Location: .za

Re: Unable to run as PHP web page

Post by social_experiment »

social_experiment wrote:I don't know anything about the IDE that you are using so im speculating here
Download XAMPP or WAMPP and set it up on your computer, once that is done you will have a server on your computer that will enable to you to display php pages as webpages
“Don’t worry if it doesn’t work right. If everything did, you’d be out of a job.” - Mosher’s Law of Software Engineering
Post Reply