Author Topic: How to view PHP pages offline  (Read 20271 times)

Offline Mark Austin

  • Admin
  • Posts: 7,961
  • Life is like photography. Use negatives to develop
    • View Profile
    • Resell Rights Weekly
How to view PHP pages offline
« on: October 22, 2008, 10:06:21 AM »
Hi Guys,

Recently I had a member email asking how to view PHP pages offline. Seemed like a good question, so I thought I would share that here.

The member was referring to the 31 monthly custom niche sites in the Gold Members area. Those sites are composed of php pages, and he wanted to be able to view the php pages on his PC before he uploaded them to his server. As you know you can click on a html page on your pc (before it's uploaded) and it will load in your browser. Not so with a php page -- click on it and all you get is a page full of code!  ;;:B

To view PHP pages on your PC locally, you need to have apache, php, and mysql installed on your PC.  There are several good tutorials online that describe how to do this. Here's a couple:

http://www.wikihow.com/Install-Apache,-MySQL,-PHP,-and-phpMyAdmin-on-a-Windows-PC
http://blogcms.com/?item=install-apache-mysql-and-php-on-windows

Downloads:
PHP from http://www.php.net
Apache from http://www.apache.org
MYSQL from http://dev.mysql.com/downloads/mysql/4.1.html
phpMyAdmin from http://www.phpmyadmin.net/home_page/downloads.php

But, the easiest way ;D would be to use an application that sets up a simulated server on your PC. Here are 3 applications:

XAMPP from http://www.apachefriends.org/
WAMPserver at http://www.wampserver.com/
AppServ at http://www.appservnetwork.com/

Just download one of the above applications and install it on your PC. They basically set up a simulated server on your computer ... which allows you to view php pages without being online.

Mark


“Keep away from people who try to belittle your ambitions. Small people always do that,
but the really great makes you feel that you, too, can become great.”
~ Mark Twain

Offline Jim Burney

  • Moderator
  • Posts: 7,091
  • The Lord is my Shepherd-I Shall not Want
    • View Profile
    • Beginners Guide To Internet Marketing
Re: How to view PHP pages offline
« Reply #1 on: October 24, 2008, 04:55:15 AM »
Mark

I never even thought about doing this.

That is until now.

On my to do list.

Thanks for sharing this great instructional information. ;C

Best

Jim

Offline Mark Austin

  • Admin
  • Posts: 7,961
  • Life is like photography. Use negatives to develop
    • View Profile
    • Resell Rights Weekly
Re: How to view PHP pages offline
« Reply #2 on: October 24, 2008, 09:05:20 AM »
No problem Jim!

Mark
“Keep away from people who try to belittle your ambitions. Small people always do that,
but the really great makes you feel that you, too, can become great.”
~ Mark Twain

Frankie

  • Guest
Re: How to view PHP pages offline
« Reply #3 on: October 29, 2008, 09:55:52 AM »
Mark

Great share, must get my teeth into this!

Frank

mj

  • Guest
Re: How to view PHP pages offline
« Reply #4 on: November 07, 2008, 08:05:39 AM »
Hi Guys,

Recently I had a member email asking how to view PHP pages offline. Seemed like a good question, so I thought I would share that here.

The member was referring to the 31 monthly custom niche sites in the Gold Members area. Those sites are composed of php pages, and he wanted to be able to view the php pages on his PC before he uploaded them to his server. As you know you can click on a html page on your pc (before it's uploaded) and it will load in your browser. Not so with a php page -- click on it and all you get is a page full of code!  ;;:B

To view PHP pages on your PC locally, you need to have apache, php, and mysql installed on your PC.  There are several good tutorials online that describe how to do this. Here's a couple:

http://www.wikihow.com/Install-Apache,-MySQL,-PHP,-and-phpMyAdmin-on-a-Windows-PC
http://blogcms.com/?item=install-apache-mysql-and-php-on-windows

Downloads:
PHP from http://www.php.net
Apache from http://www.apache.org
MYSQL from http://dev.mysql.com/downloads/mysql/4.1.html
phpMyAdmin from http://www.phpmyadmin.net/home_page/downloads.php

But, the easiest way ;D would be to use an application that sets up a simulated server on your PC. Here are 3 applications:

XAMPP from http://www.apachefriends.org/
WAMPserver at http://www.wampserver.com/
AppServ at http://www.appservnetwork.com/

Just download one of the above applications and install it on your PC. They basically set up a simulated server on your computer ... which allows you to view php pages without being online.

Mark

Mark

This is good information.

Much appreciated. ;C

Mark

dsmith21212

  • Guest
Re: How to view PHP pages offline
« Reply #5 on: April 28, 2009, 10:34:27 AM »
Thanks Mark!

Here's some info on XAMPP, for the "less-technically-inclined"  ;)

(will work on Windows, Linux, whatever...)

http://www.apachefriends.org/en/xampp.html

It should be installed at the top level of any drive. 
I.e.  put it on D:\xampp
Not on D:\MyServer\xampp

WARNING:  This is a 'test' server.  By default, it has only basic security configuration.  It is NOT advised that you run it as a production server (i.e. don't build your website on it and promote it to the public.  You WILL be sorry, if you do!).


TIPS:

"htdocs" is your "root" directory.  Any pages that you want to view 'live' in your browser, put them under htdocs.

You still cannot double-click to open a PHP file  ;)  Open it up in your browser (http://127.0.0.1/)

Create a robots.txt file disallowing all.
http://www.robotstxt.org/robotstxt.html

Create an index.php file and an index.html file with the robots meta tag set to: noindex, nofollow. (these go in root)
http://www.robotstxt.org/meta.html

Create an .htaccess file with the following line: DirectoryRoot index.php index.html
• This will effect every folder under wherever the .htaccess file is.  Put it in root (htdocs).
• Windows does not like files with no file names and, therefore, might not let you create this file with Notepad.  Use NoteTab (http://www.notetab.com/download.php)

Place each website in a seperate folder.
• D:\xampp\htdocs\web1
• D:\xampp\htdocs\web2

For a free domain, go to http://www.dyndns.com/
• You will need to update once a month.  So don't lose your Log-In details. (They send e-mail notifications)
• You do not have to have a domain.  You computer is at http://127.0.0.1/


 —Dave
   Grey Storm Media

Offline Mark Austin

  • Admin
  • Posts: 7,961
  • Life is like photography. Use negatives to develop
    • View Profile
    • Resell Rights Weekly
Re: How to view PHP pages offline
« Reply #6 on: April 28, 2009, 12:11:33 PM »
Hi Dave,

Thanks for the very helpful & informative post!
And welcome to the forum!  :-)

Mark
“Keep away from people who try to belittle your ambitions. Small people always do that,
but the really great makes you feel that you, too, can become great.”
~ Mark Twain

multihb

  • Guest
Re: How to view PHP pages offline
« Reply #7 on: April 28, 2009, 12:44:27 PM »
Hi Dave,

Thanks for the very helpful & informative post!
And welcome to the forum!  :-)

Mark

Thanks Mark and Dave for the great info.. :D

Best regards!

Aatos

Offline Jim Burney

  • Moderator
  • Posts: 7,091
  • The Lord is my Shepherd-I Shall not Want
    • View Profile
    • Beginners Guide To Internet Marketing
Re: How to view PHP pages offline
« Reply #8 on: April 29, 2009, 05:00:14 AM »
Dave

That is some very useful information you have shared with the RRW forum members.

Thank you.

Jim

ps Welcome to the forum

Offline KarenMcG

  • Sr Member
  • Posts: 3,751
    • View Profile
Re: How to view PHP pages offline
« Reply #9 on: April 29, 2009, 09:35:12 PM »
Hi Dave,   ::P

Welcome to RRW.

You must have sneaked in when I wasn't looking.  ;D

That's some great input for one of your first posts. Thank you very much.

Now my question for you is this...if I try these and I mess up how much trouble will I be in with my computer? Like is it some mess I can get myself out of?  :-)

I look forward to seeing you around here.

Karen

dsmith21212

  • Guest
Re: How to view PHP pages offline
« Reply #10 on: May 20, 2009, 01:17:17 AM »
Thank you every one for the friendly welcome!

--

Hi Karen,

Sorry to only get back to you now...

Harming your computer is extremely unlikely.  Not impossible.  But unlikely.
Just be sure to follow instructions closely when you configure the server.


 —Dave
 

Offline Jim Burney

  • Moderator
  • Posts: 7,091
  • The Lord is my Shepherd-I Shall not Want
    • View Profile
    • Beginners Guide To Internet Marketing
Re: How to view PHP pages offline
« Reply #11 on: May 20, 2009, 10:26:17 AM »
Thank you every one for the friendly welcome!

--

Hi Karen,

Sorry to only get back to you now...

Harming your computer is extremely unlikely.  Not impossible.  But unlikely.
Just be sure to follow instructions closely when you configure the server.


 —Dave
 

Hi Dave

Thanks for clearing that issue up.

Jim

Offline KarenMcG

  • Sr Member
  • Posts: 3,751
    • View Profile
Re: How to view PHP pages offline
« Reply #12 on: June 03, 2009, 03:22:30 PM »
Thank you every one for the friendly welcome!

--

Hi Karen,

Sorry to only get back to you now...

Harming your computer is extremely unlikely.  Not impossible.  But unlikely.
Just be sure to follow instructions closely when you configure the server.


 —Dave
 

Hi Dave

Thanks for clearing that issue up.

Jim

Hi Dave,

Thanks for the extra information re: computer and safeness.


Karen

phranc

  • Guest
Re: How to view PHP pages offline
« Reply #13 on: June 03, 2009, 06:32:10 PM »
Hey Karen thanks for making a post here today I hadnt found it yet.

I was just changing the .php to .htm to get a look at the pages and make changes however it doesnt acyully give you a true look at what your pages will look like as I discovered.

Frank

Offline eagles12

  • Sr. Member
  • Posts: 1,009
  • Honor God and He will honor you.
    • View Profile
    • Mark Butts Rocks!
Re: How to view PHP pages offline
« Reply #14 on: June 26, 2009, 09:41:19 PM »
Thanks, everyone!  I have been trying to view .php pages for some time.  This post was much appreciated.

God bless y'all,
Mark
Isiah 40:31