Skip to content Skip to sidebar Skip to footer

How Can I Try My Php Code To See Whether It Works?

I'm trying to make a basic contact form (using HTML and PHP). I usually host my websites as gh-pages on GitHub. However, the form won't work on GitHub as GitHub doesn't allow PHP b

Solution 1:

You can install XAMPP and run your pages locally. This package has PHP, Sendmail and Apache server in it. As well as MySQL if you need it.

XAMPP Installer

Solution 2:

You need to install a web server and PHP to test it locally. You can install PHP since it comes with a simple web server. If instead you want more power over it you could easily install XAMPP.

If you don't want to install anything, the easiest thing is to use a web hosting where you can upload your code and test it there, but you won't have too much flexibility over it.

Solution 3:

You can try Wamp service!

Have a look: Wamp

Solution 4:

On Mac you can use MAMP for local On WINDOWS you can use WAMP for local

If you have a domain and hosting you can upload to the domain and access the PHP directly with a browser to debug.

Browsers output the errors of PHP also you can check your log of your server

Solution 5:

The easiest way out to your problem is downloading a package. There are a few packages that consist of all the components you will need to run your PHP files.

If you're a Windows user, you can either download XAMPP here https://www.apachefriends.org/download.html

or

WAMP here http://www.wampserver.com/en/

I personally prefer XAMPP over WAMP due to easier user interface. But both of them are equally good for your purpose.

Otherwise, if you're a MAC user, you can go with downloading MAMP https://www.mamp.info/en/downloads/

Installation is pretty straight forward, then you can run the XAMPP/WAMP/MAMP control panel which will start PHP/Apache/mySQL.. for you. You can type in localhost in your browser and if you've installed everything correctly it will show you a related XAMPP/WAMP/MAMP page.

From there onward, you can setup and test your code. If you go with XAMPP/MAMP, you will place your code inside htdocs folder and type in localhost/foldername to access your code. So if you've installed XAMPP in C: drive, you will find htdocs inside your XAMPP folder in C.

For WAMP, you will have to find www folder inside WAMP folder.

Hope that helps.

Post a Comment for "How Can I Try My Php Code To See Whether It Works?"