Reputation: 74550
I have some PHP script that I would like to test but my server is down. The script is nothing major and it doesn't even have to access any databases or anything of that sort. Is there a way I can test it?
Upvotes: 0
Views: 571
Reputation: 7833
An easy way would be to install EasyPHP, which contains Apache, PHP, and MySQL (with PHPMyAdmin) for Windows all in one package. Its very easy to setup and use (most functions are accessible from the task bar icon, such as "View Local Web" and "Administration"). Then simply right click the EasyPHP taskbar icon, select "Explore", copy your files into the folder that appears, then right click the EasyPHP taskbar icon and select "Local Web", and select your file.
Upvotes: 0
Reputation: 5695
The best thing you can do is set up a test server inside a virtual machine - an entire computer system that runs inside your current operating system! It's actually surprisingly easy to set up, and there are a lot of easily-googleable answers out there. Here's one for a PHP test/dev environment specifically:
http://www.serversidemagazine.com/php/creating-a-php-5-3-virtual-development-environment/
Upvotes: 2
Reputation: 23316
You can use PHP from the command line. SSH to the server and execute the PHP file through the CLI and you'll see the output (or any errors).
Upvotes: 1
Reputation: 16829
You can use a locally based web server such as WAMP for Windows or LAMP/MAMP for Linux/Mac OS.
Upvotes: 2
Reputation: 30555
You need a PHP interpreter somehow. That almost always means a functioning web server.
That said, some scripts intended for the web page can run okay from the PHP CLI interpreter. It depends on what it needs to and what you need it to do.
Upvotes: 1
Reputation: 798676
Install PHP and a web server on your local machine, or use an embedded web server.
Upvotes: 2
Reputation: 1844
Is it simple enough to use in a simple browser window? There's... http://writecodeonline.com/php/
Upvotes: 4