PHP Page Browser

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

Slacker
Forum Newbie
Posts: 17
Joined: Thu Aug 12, 2004 9:19 pm

Post by Slacker »

It sounds like you want something local to test your own PHP scripts before you upload them. If that's the case, you should d/l an FTP client and use it to FTP into your host. It'd be much easier and quicker and far more concrete than setting up a webserver, php, and a db program on your local machine. Specially a windows box, let alone win 98.

Even on a 33k modem, you can upload php/html files relatively fast. And you don't have to wait for the page load times of a control panels file manager.

As far as testing goes, it's much better to test code on the system the code will be processed rather than one just used for testing purposes.

Trust me, I used to run apache/php/mysql on my windows 2000 box for testing and site building purposes. Then I realized that just getting everything setup in my hosts control panel and FTP'ing in to upload files for testing was far more easier, quicker, and better.
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Post by Christopher »

You seemed to have a couple of questions: can I test my pages without a web connection? (yes) and how to make your URL more portable? (you can) Let me give it a try:

FIrst, if you install Apache on your PC and then install PHP (again on your PC, not the server) your can open a browser and type "http://localhost/index.php" and you will see the page. Further you can also install say MySQL on your PC and configure it. The trick is to set the database names and passwords the same for the connections on PC and server. I have a laptop setup this way. I copy the pages and a dump of the databse onto the laptop and then I can work on projects on the road.

Second, to make you code more portable you can reference your pages (in your PHP code) with relative URLs such as "index.php" rather than "http://mysite.com/index.php". PHP will sort out the path and display the page. Another way to do it is to define the base path and comment/uncomment depending on which server:

define('BASEURL', 'http://mysite.com/');
#define('BASEURL', 'http://localhost/');

$url = BASEURL . ''index.php';

Better yet is to put the defines in a config.php file to seperate it from the code. Hope any of this helps.
drale
Forum Newbie
Posts: 8
Joined: Fri Sep 10, 2004 2:43 am

Post by drale »

what about?
http://www.priadoblender.com/index.php? ... &cslot_1=2.

I have no experiences with doing what you want except by just running my own server. But I found this in a post somewhere on the forum.
User avatar
andre_c
Forum Contributor
Posts: 412
Joined: Sun Feb 29, 2004 6:49 pm
Location: Salt Lake City, Utah

Post by andre_c »

Benrr101 wrote:Oh, and I can't download bigapache, it's 101 megs!
Actually the apache binary is 6.4 megs.
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post by John Cartwright »

Slacker wrote:It sounds like you want something local to test your own PHP scripts before you upload them. If that's the case, you should d/l an FTP client and use it to FTP into your host. It'd be much easier and quicker and far more concrete than setting up a webserver, php, and a db program on your local machine. Specially a windows box, let alone win 98.

Even on a 33k modem, you can upload php/html files relatively fast. And you don't have to wait for the page load times of a control panels file manager.

As far as testing goes, it's much better to test code on the system the code will be processed rather than one just used for testing purposes.

Trust me, I used to run apache/php/mysql on my windows 2000 box for testing and site building purposes. Then I realized that just getting everything setup in my hosts control panel and FTP'ing in to upload files for testing was far more easier, quicker, and better.
I fully disagree. Having a local webserver in my opinion is way faster than always having to deal with uploading files to your ftp server. Plus localhost is a lot faster :P

http://www.hotscripts.com/PHP/Software_ ... index.html
User avatar
m3mn0n
PHP Evangelist
Posts: 3548
Joined: Tue Aug 13, 2002 3:35 pm
Location: Calgary, Canada

Post by m3mn0n »

I'd just redo the pages without PHP.

Simplest solution. 8)
Breckenridge
Forum Commoner
Posts: 62
Joined: Thu Sep 09, 2004 11:10 pm
Location: Breckenridge, Colorado

Post by Breckenridge »

Have a local web server is nice, make sure that your real server and development servers have similar configuration php.ini files.
AGISB
Forum Contributor
Posts: 422
Joined: Fri Jul 09, 2004 1:23 am

Post by AGISB »

Phenom wrote:
I fully disagree. Having a local webserver in my opinion is way faster than always having to deal with uploading files to your ftp server. Plus localhost is a lot faster :P

http://www.hotscripts.com/PHP/Software_ ... index.html
I disagree with the 'fully disagree' as it can be very disturbing to test your pages on localhost and if uploaded they are to slow.

I always prefer to test my pages with a 56k modem. Many times programmers and designers with a cable modem or DSL test their pages and wonder why 56k users simply don't surf the sites due to load times beyond acceptance.

Guess it all depends what you are testing for.
Slacker
Forum Newbie
Posts: 17
Joined: Thu Aug 12, 2004 9:19 pm

Post by Slacker »

Guess it depends on your preferences. I just prefer to test mine on my host, that way, when they make changes to their configuration of the webserver, mysql, php, and whatever else, I don't have to mirror it on my machine.

For me, it's more convenient this way. For others it might not be.
User avatar
dull1554
Forum Regular
Posts: 680
Joined: Sat Nov 22, 2003 11:26 am
Location: 42:21:35.359N, 76:02:20.688W

Post by dull1554 »

if you dont want to set up a web server to test your php scritpts locally i'd suggest getting zend studio, i believe you can download a trial like 20 megs and if you on dialup it will take like 3 or 4 hours, it lets you edit and run php scripts as well as edit pretty much any other web based script file(html JS ASP cfm and many more)

yet again my 2 cents
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post by John Cartwright »

AGISB wrote:
Phenom wrote:
I fully disagree. Having a local webserver in my opinion is way faster than always having to deal with uploading files to your ftp server. Plus localhost is a lot faster :P

http://www.hotscripts.com/PHP/Software_ ... index.html
I disagree with the 'fully disagree' as it can be very disturbing to test your pages on localhost and if uploaded they are to slow.

I always prefer to test my pages with a 56k modem. Many times programmers and designers with a cable modem or DSL test their pages and wonder why 56k users simply don't surf the sites due to load times beyond acceptance.

Guess it all depends what you are testing for.
That's the only bad thing about localhost, because it parses things way too fast, and sometimes can cause problems later on, but it is not a common problem.. localhost drastically speeds up developping times though ;)
Post Reply