简体   繁体   中英

How to serve a PHP file in Windows without XAMPP?

The situation is simple: I have a PHP file and I want to serve it on my localhost. I already have MySQL set up and don't want to install XAMPP or other bulky packages which come with their own MySQL or any other thing such as that.

I tried many Node.js ways to serve a PHP file but none worked for me.

Please, I just have a file and want to "run" it. How can I do that?

First of all nodeJS means nodeJavaScript. So it will not support php with mystery magical things.

You could only install Apache server and mySQL. Then you don´t need any XAMPP and the tools it brings with it. Try to install Apache standalone.

Not sure if this works but should be no problem.

But all in all i would recommend you to use XAMPP

Unfortunately, if you want to run a "server-side" code (in your case PHP ) in your Windows computer, you have to use a web server that simulate for you it.

XAMPP (or WAMP ) enables localhost port to receive connections from yourself and it is a smart way to try in "local" your code. If you want to run PHP but you don't want to install XAMPP, then you can install a linux distribution and run " apache HTTP server " that is already installed in most distributions. But in every case you need a tool to simulate the " server-side " part.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM