PHP Page Browser
Moderator: General Moderators
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.
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.
- Christopher
- Site Administrator
- Posts: 13596
- Joined: Wed Aug 25, 2004 7:54 pm
- Location: New York, NY, US
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.
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.
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.
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.
- John Cartwright
- Site Admin
- Posts: 11470
- Joined: Tue Dec 23, 2003 2:10 am
- Location: Toronto
- Contact:
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 fasterSlacker 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.
http://www.hotscripts.com/PHP/Software_ ... index.html
-
Breckenridge
- Forum Commoner
- Posts: 62
- Joined: Thu Sep 09, 2004 11:10 pm
- Location: Breckenridge, Colorado
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.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
http://www.hotscripts.com/PHP/Software_ ... index.html
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.
- dull1554
- Forum Regular
- Posts: 680
- Joined: Sat Nov 22, 2003 11:26 am
- Location: 42:21:35.359N, 76:02:20.688W
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
yet again my 2 cents
- John Cartwright
- Site Admin
- Posts: 11470
- Joined: Tue Dec 23, 2003 2:10 am
- Location: Toronto
- Contact:
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 thoughAGISB wrote: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.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
http://www.hotscripts.com/PHP/Software_ ... index.html
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.