Jump to content
xisto Community
Xenon

How do you test your php code

Recommended Posts

Dear friend I generally after creating a php page test it with my web hosting service provider I don't know but I think its a difficult one to make your own server to just test your php pages.?

Its not difficult to install your local server contactskn. Its very easy. I'll tell you a simplest method. Just download WAMP Server. Install it in your computer. Then put your php files in the WWW folder. Start the WAMP Server. Then open your browser and type LOCALHOST/yourfilename.php . Thats it. Very easy.

Try it once and you'll understand that it is pretty easy than uploading and testing on remote server. I'll help you if you need any further help :)

Share this post


Link to post
Share on other sites

I have a testing server which is run by EasyPHP. It is simple and very easy to use. All I need to do is put my files in a folder called "www" and open up the files on the EasyPHP application... Simple:)

Share this post


Link to post
Share on other sites

I just do all the PHP programming on localhost, on Windows I just have installed Wampserver and it all works, phpmyadmin, mysql and php, apache and the settings is easy to change and the default is very well set, I like Wampserver that it's easy to change between PHP4 and PHP5, even though for half of year now I don't make PHP4 compatible code anymore, even though I had a client which wanted it to work on PHP4, it took a bit to change that and that or add a function which does almost the same thing..I always use an PHP IDE and execute the PHP code through a browser, just by changing between windows, I don't use the debug mode in the IDE, even though my IDE has real time php checking for syntax errors and such :D

Share this post


Link to post
Share on other sites

I was so much worried before, thinking, i need a website and a webhost in order to test my php programs and my search through internet gave me a nice suggestion, and i got my dream program easyPHP. its the best for the beginner. It has everything that a beginner and an advanced programmer needs. Its very easy to run. After having installed, I checked whether the easyPHP is running or not by opening up the browser and entering LOCALHOST; the default page of easyPHP loads. All the php programs need to be placed inside "www" folder of easyPHP. It can be tested by using the following url LOCALHOST/example.php
please note : its just an example of the code to execute.

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)


If you are laxy enough and are very familiar in HTML, you may run PHP scripts from the command line.
http://us3.php.net/manual/en/features.commandline.php

However, I instead test PHP application in a free hosting space.

Share this post


Link to post
Share on other sites

First i test scripts on my local server and if it works and if it is good,with good design and it is not damaging my website,i am uploading it on my server.The funny thing is, that some funny scripts which i want to be published to the internet,i am uploading them but with very complicate name.So if i go in someones home,i want to show him what script i did and i open it on his computer.Sometimes i give simple names so am sending links of my script.But always that funny scripts are without design and only stupid things.Example

Test:Like what animal you are looking like

My local server sometimes doesn't work so i need to restart my computer...Thing i want to do is to make scripts for others,for example someone doesn't know how to create image, and i want to help him,and on that way i learn more.

Share this post


Link to post
Share on other sites

On some old day I test my php code by simply echo 'something` to the web page or screen.Now I use unit testing for testing the code on localhost.This ensure that at least all my functions or classes work as expected.Then, moving on to hosting to test the rest of code.

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.