Jump to content
xisto Community
Xenon

How do you test your php code

Recommended Posts

I have now got a new pc and have networked my old pc and my new one together...My old pc is acting as a server, it has PHP and mySQL on it, I just save the files in the folder on my old pc (over the network) and type in the IP of my old pc to view it... ;)

Share this post


Link to post
Share on other sites

We know that php is a server side scripting language. So we will need a server with the php parser to parse/test our code.

How are you doing that. Do you upload it to a server for testing or did you instal php and the server (apache) on your computer (localhost)

<{POST_SNAPBACK}>


Test it localy, i use easyserv on windows...php, mysql and apache.

easyserv is good because u run server apache, mysql when u whant to test something, and when u don't want anymore easyserv has a option to kill processes (server deamons of mysql and apache), so u can normaly use ur computer without slowing down it from running webserver ;)

Share this post


Link to post
Share on other sites

I wish I could run php on my computer. I installed a server, but it doesn't seem to like my PC. If I run a page from a URL it will work, if I run a page from a link, it will crash. 70% of the time even the url doesn't work. This is one of the reasons I need a webhost. I just suck at setting really complex things up.

Share this post


Link to post
Share on other sites

If you don't want to configurate the server your self download easyphp it setup php, apache and mysql automatically. Just uploading files to your host after every changes is just a waste off time.

 

Yet another copied post: http://forums.xisto.com/topic/686-how-do-you-test-your-php-code/page-2#entry12842

Edited by cragllo (see edit history)

Share this post


Link to post
Share on other sites

Hi we are script makers :lol:so at first write the script in local and then test in localat second we upload script in test folder and testing the scriptwe must upload test script becuase some servers has limit and if we want make good script we must test script at 1 or 2 hostingthx

Share this post


Link to post
Share on other sites

How to test PHP scripts on your computer:

*Download Easy PHP
*Install this application
*Open application (Must be: Apache-Started and MySQL-Started)
*Put scripts to example (C:\Program Files\EasyPHP1-8\www\mysite)
*Open browser put in "Addres" LOCALHOST/mysite/scriptname.php
*If you follow, and finished all steps of tutorial, everything must be alright.

Share this post


Link to post
Share on other sites

Usually I test with one of my hosting accounts, though I used to have an Apache 2 environment with PHP 5 on my computer I ran locally. I have a router so I don't really have to worry about anything else...

Edited by Tetraca (see edit history)

Share this post


Link to post
Share on other sites

I test my script on my own server. It was really easy to set up since i used XAMPP by ApacheFriends. Its a free php, apache, mysql, filezilla server. All you do is install the package, set some passwords and unblock it from the firewall. It makes testing extremely easy especially if you set up a few virtual hosts if test multiple sites. Both of these have tutorials here at Xisto and are very useful if you need help to set these up.

Share this post


Link to post
Share on other sites

I really like testing my php code on my Trap 17 web host. I use netdrive to upload the files, it maps a drive on your computer to the webhost. I highly recommend this program. It is really fast and easy to use, such that I am too lazy to work locally and then upload. I use phpdesigner as my php editor. Thankyou Xisto for the great hosting.

Share this post


Link to post
Share on other sites

I use Xampp from apache friends its a complete package with apache,php,mysql filzila and other tools installed its easy to use and its free,it comes for all operating systems including linux and windows.it is best solution for php code test

Share this post


Link to post
Share on other sites

Greetingsi have ussed Apech, but i had a problemeverytme i aded a <? in my script it dit not showed notting, i had to replace every <? to <?php :Sbut that was the only problem i had,but its a nice program to use and easy to work with.have a nice day.. :lol:

Share this post


Link to post
Share on other sites

People, use Denver, it is the most usefull tool for checking your php and perl scripts on local machine. It includes Apache+mod_rewrite+SSI+Perl+PHP(GD included)+MySQL(transaction support included)+Sendmail and all in 1 small file - only 2MB. You can simply install it on your local machine and it is all. You can made any count of domains, subdomains etc.
Download denver you can here.

I also use Denver for local testing. It is really good tool. Just download installer, intall it and enjoy by testing your php+ mysql+perl scripts. Denver is downloadable with both php4 and 5 versions. Additional libraries are also available.
For full info go to site http://en.dklab.ru/
Good luck!!!

Share this post


Link to post
Share on other sites

Greetings
i have ussed Apech, but i had a problem
everytme i aded a <? in my script it dit not showed notting, i had to replace every <? to <?php :S

but that was the only problem i had,
but its a nice program to use and easy to work with.

have a nice day.. :lol:


Modify your php.ini file to allow for shorttags "on" to overcome this problem, but forcing the use of the full "<?php" is better coding practice, so if you can force yourself to continue using the full tag, it would be better code.

Share this post


Link to post
Share on other sites

I just use two accounts on the same server. This way I have identical conditions as far as php, mysql, and OS versions and settings, etc. Usually I have two whole sites set up with the same everything. I usually just get rid of the testing site after I'm done "testing".

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.