Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
successfully parse php pages with browser on local xampp
Old 02-20-2009, 11:49 AM successfully parse php pages with browser on local xampp
matt w's Avatar
Super Talker

Posts: 136
Location: kalamazoo
Trades: 0
How can I have my browser successfully load php pages that I'm testing in my local XAMPP? If I use the Firefox File-> Open File -> ***.php it doesn't function, which is to say the script will throw out a lot of gibberish (php code) when I try to execute the page. I get it to work now by carefully typing the complete pathname of the file in the address bar and pressing go or reload. There has to be a better way.
Thanks
Matt
matt w is offline
Reply With Quote
View Public Profile Visit matt w's homepage!
 
 
Register now for full access!
Old 02-20-2009, 03:07 PM Re: successfully parse php pages with browser on local xampp
tripy's Avatar
Do not try this at home!

Posts: 3,621
Name: Thierry
Location: I'm the uber Spaminator !
Trades: 0
It's because PHP is launched from the web server to replace the code by html.
To do that, you need to open the file through the web server.

You have 4 way of doing this.
2 are restricted to the same computer your files are on, and the others allows you to access this server from another computer (like a web site)

1) Local loop by ip address:
http://127.0.0.1/mypage.php

2) Local loop by hostname:
http://localhost/mypage.php

Both 127.0.0.1 and localhost are hardcoded constant in every systems that access TCP/IP networks.
It always point to itself.

3) remote connection by ip address:
http://192.168.0.1/mypage

Here, 192.168.0.1 could be the TCP/IP address that a wireless router gave you when you connected.
This is not a local address, and can be acessed by other computer on the same physical network than you (IE: connected to the same router, switch, hub or access point)

4) A public host name with a dynamic IP address like http://dyndns.org provides:
http://myChoosenName.dyndns.org

This means that your computer stays on, and have a little program that updates the dyndns server telling them "hey, my address on internet is now 197.85.47.13" (for the example) at each IP changes.
Dyndns.org will record this, and every person trying to reach http://myChoosenName.dyndns.org will be redirected to this adresse, thus your computer.
You could use the ip address directly too, but your ISP might change it every few hours, and in this case, you will not be able to access your server anymore.
__________________
Only a biker knows why a dog sticks his head out the window.

Last edited by tripy; 02-20-2009 at 03:08 PM..
tripy is offline
Reply With Quote
View Public Profile Visit tripy's homepage!
 
Old 02-20-2009, 05:09 PM Re: successfully parse php pages with browser on local xampp
matt w's Avatar
Super Talker

Posts: 136
Location: kalamazoo
Trades: 0
So, I have to phrase the request so that it is handled by Apache or a similar web server, not just my browser, as would be the case if I told FireFox to open the local file.
Tell me, do I have that right?
But my focus is on ease of access. Is there an easier way than typing pathnames or copying and pasting them into the address bar? Is there anything like point and click (for testing all my php files on my local machine)?
Thanks
matt w is offline
Reply With Quote
View Public Profile Visit matt w's homepage!
 
Old 02-20-2009, 07:28 PM Re: successfully parse php pages with browser on local xampp
tripy's Avatar
Do not try this at home!

Posts: 3,621
Name: Thierry
Location: I'm the uber Spaminator !
Trades: 0
Quote:
So, I have to phrase the request so that it is handled by Apache or a similar web server, not just my browser
Yep.

Quote:
Tell me, do I have that right?
Why wouldn't you ?
As long as the web server is running, there is nothing preventing you to.

Quote:
But my focus is on ease of access. Is there an easier way than typing pathnames or copying and pasting them into the address bar?
You consider that complicated ?
The only way you could ever go around that would be that you design a custom home page, which would already contain all the links.

But tell me, what do you do when you open your browser for the first time?
You type an url in the address bar, or you go on the site you want via a search engine?
__________________
Only a biker knows why a dog sticks his head out the window.
tripy is offline
Reply With Quote
View Public Profile Visit tripy's homepage!
 
Old 02-20-2009, 11:11 PM Re: successfully parse php pages with browser on local xampp
matt w's Avatar
Super Talker

Posts: 136
Location: kalamazoo
Trades: 0
By
Quote:
Tell me, do I have that right?
I meant "Am I correct?".
As for ease of loading the pages, with almost any type of file I use I can usually right click and open it with some application. I can't seem to do that with php files.
Thanks for your patience
matt w is offline
Reply With Quote
View Public Profile Visit matt w's homepage!
 
Old 02-21-2009, 06:35 AM Re: successfully parse php pages with browser on local xampp
tripy's Avatar
Do not try this at home!

Posts: 3,621
Name: Thierry
Location: I'm the uber Spaminator !
Trades: 0
Quote:
I meant "Am I correct?".
Yes, you where correct.
:-)

Quote:
I can usually right click and open it with some application. I can't seem to do that with php files.
Yes you can, but it won't be opened through the web server.
So, you will only see the sources, as you already have noticed.

In that sense, no, you cannot associate the php files to be opened in a browser on a given server automatically
__________________
Only a biker knows why a dog sticks his head out the window.
tripy is offline
Reply With Quote
View Public Profile Visit tripy's homepage!
 
Old 02-21-2009, 12:26 PM Re: successfully parse php pages with browser on local xampp
Red_X_'s Avatar
Extreme Talker

Posts: 158
Location: Houston
Trades: 0
I use XAMPP for my testing server.

Just use the control pannel make sure Apache is running. Then open your browswer type in: http://localhost/ or http://127.0.01/
__________________
"Good News Everyone, by reading this your hearing my voice."
Red_X_ is offline
Reply With Quote
View Public Profile Visit Red_X_'s homepage!
 
Reply     « Reply to successfully parse php pages with browser on local xampp
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.43688 seconds with 12 queries