This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes PHP and the fly likes run php page on browser Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Languages » PHP
Bookmark "run php page on browser" Watch "run php page on browser" New topic
Author

run php page on browser

sparsh khandelwal
Ranch Hand

Joined: Dec 20, 2010
Posts: 70
hello everyone,
i have installed the php , apache ,iis as well
also i am able to run my php page on command prompt
but have no idea how to run the php page on server
please help
K. Tsang
Bartender

Joined: Sep 13, 2007
Posts: 2229
    
    7

In order to get php running with Apache or IIS, you need to let the web server know about the php module.

You can google "configure php with apache" will give you the steps. Similarly for IIS.

When you do get php running, make a page like:


to see your settings.


K. Tsang JavaRanch SCJP5 SCJD/OCM-JD OCPJP7 OCPWCD5
sparsh khandelwal
Ranch Hand

Joined: Dec 20, 2010
Posts: 70
hey thanks for your reply
last night i installed the apache that time it was working good
but after ask the above question i run the same (localhost:8080)
now it ask for user name and password
up to my knowledge best i have not set any username and password
what is that , why so ?

also configure tomcat-users.xml with the above code and try to access with username = admin , password=admin
still not working
please help
K. Tsang
Bartender

Joined: Sep 13, 2007
Posts: 2229
    
    7

I don't know why suddenly we are talking about Tomcat? Apache and Tomcat are 2 different servers and Tomcat doesn't need Apache or PHP to run.

The default page of Tomcat shouldn't need a username/password. Only if you want to look at application listing then it prompts. And yes tomcat-users.xml is the place to set passwords.
sparsh khandelwal
Ranch Hand

Joined: Dec 20, 2010
Posts: 70
thanks for your reply
first i don't know that apache and tomcat are different
i have tomcat and iis on my system
but when i try to open localhost:8080 , it prompt me for username and password
but yesterday it prompt me to the webpage
Nick Charles
Ranch Hand

Joined: Oct 09, 2011
Posts: 70

Port 8080 is the typical HTTP port for Tomcat. IIS and Apache use port 80 by default (you need to change one of them to use a different port to get both to work).

If the web page on port 8080 is prompting for a password, then you configured Tomcat to require logon credentials.

I think you would be much better off installing only one server at a time on your PC and learning how to use that one correctly before attempting to install another. Having three servers installed appears to be adding to your confiusion.
sparsh khandelwal
Ranch Hand

Joined: Dec 20, 2010
Posts: 70
thanks for your reply
installed the xampp and working good now
according to that you need to make your files in htdocs folder , and then you need to give the same path in url
is it possible to double the file on the desktop and open it in web browser ?
Nick Charles
Ranch Hand

Joined: Oct 09, 2011
Posts: 70

No, you cannot double-click on a .php file and open it in a browser. Browsers do not understand PHP, you must run .php pages through a PHP engine.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: run php page on browser
 
Similar Threads
PHP
Tomcat + PHP on Mac
parent page use iframe's PHP vars
Java Applet Logon Post to PHP
Web service and JApplet