+ 5
How i test PHP codes in pc ?
php is sever side programming language since how i test my codes in my pc ?
6 Answers
+ 4
Another possibility is to call PHP from the command line.
https://www.php.net/manual/en/features.commandline.php
You can do for example this (on Windows):
Download PHP from https://windows.php.net/download/
Unzip it into a folder called for example php.
Then you need to add path to this folder containing php.exe to 'Environment variable' called 'Path'.
If you do not know how to do it, you can specify full path to php.exe when executing scripts.
Create some test folder and create a new file with some php code (for example thescript.php).
Then open command line, switch to that folder (or specify full path)
Simply call the script by:
php -f thescript.php
You can even use built-in web server https://www.php.net/manual/en/features.commandline.webserver.php
+ 10
Download and install wampserver.
Create folder for storing files in C:/wamp/www/yourfoldername.
To run file :on your browser type localhost/yourfoldername/filename
+ 2
You need to install a server on your computer to test it out.
On Windows, I don't know how (but I've seen before people use XAMP or something, look it up)
But if you're on linux, then the most commonly used one is Apache2 server.
0
WAMP.
Google wampserver.
0
السلام عليكم
0
If you have already installed php, you just download Apache server and use it as localhost to test your code inside the browser.
or you can use stacks such as wamp(windows), mamp(Mac), lamp (Linux) or xampp (any os).
I prefer stack because it will come with MySQL also. So it's very useful when work with database.