0

I'm actively looking to make a website and I have a lot done so far but I want to make sure my PHP programs work but can't afford to buy a web server, is there any way I can test my PHP files without having an actual web server

  • Run on your local computer! Just have to install the app server on it. – bpanatta Dec 15 '20 at 17:25
  • For development yes https://stackoverflow.com/q/49891637/4178487 not for production. What is it you are trying to do? – Jason K Dec 15 '20 at 17:27
  • Checkout Heroku for putting sites on the web with no charges https://devcenter.heroku.com/articles/getting-started-with-php – Prikesh Savla Dec 15 '20 at 17:27
  • 1
    Hm, I think that you are confusing the term _"web server"_ defining the **MACHINE (e.g. the computer)** on which your application should be executed with the term _"web server"_ defining the **SOFTWARE** with which your application can be executed. In your question, you're probably referring yourself to the machine. Instead your question should be: _"Is there a free/open source _web server_ (a software, not a machine) which I can use to test my PHP application?"_. My answer would be: "Apache, Nginx, etc". My recommendation: Apache. – PajuranCodes Dec 15 '20 at 18:02
  • Note that XAMPP and WAMP are software solutions involving (each of them) a web server (Apache) along with a PHP engine and a DB server (MySQL or MariaDB). They are easier to customize then separately installing each of the components. But, for advanced development, I would personally recommend to separately install and customize the components. – PajuranCodes Dec 15 '20 at 18:08

2 Answers2

0

Unless you plan to email people a zip file containing all the pages that make up the website: You need a web server. It is is the software that responds to a request for http://example.com/ with a webpage.

If you want to run a PHP program in response to a request (which is essential if you want to use PHP to do something with user input) then you need a web server which supports PHP.

If you want to write PHP software to run on the command line (which is unlikely in the context of a website, but you might be trying to write a static site generator in PHP) then you don't need a web server that supports PHP. You'll still need a way to get the generated webpages to the users through.

Quentin
  • 914,110
  • 126
  • 1,211
  • 1,335
0

You can install XAMPP or WAMPP on Windows. If using linux based distribution check for apache or ngnix . You can put you PHP files in server root and execute on your local system.