Hack Forums
[PHP] How to run php localhost - Printable Version

+- Hack Forums (https://hackforums.net)
+-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444)
+--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151)
+---- Forum: Web Development (https://hackforums.net/forumdisplay.php?fid=183)
+---- Thread: [PHP] How to run php localhost (/showthread.php?tid=6257547)



How to run php localhost - NickyDev - Dec 1, 2023

Guys, how to run php in localhost without XAMP?
is there any way?



RE: How to run php localhost - DashPHP - Dec 1, 2023

PHP itself can be served as a local web server to perform your tests.

type in “php -S localhost:8000” command from the working directory and it’ll serve as a website!


RE: How to run php localhost - NickyDev - Dec 1, 2023

(Dec 1, 2023 08:16 AM)DashPHP Wrote:  PHP itself can be served as a local web server to perform your tests.

type in “php -S localhost:8000” command from the working directory and it’ll serve as a website!

i thought i should to install xamp to do that.


RE: How to run php localhost - DashPHP - Dec 1, 2023

(Dec 1, 2023 08:29 AM)NickyDev Wrote:  i thought you had to install xamp to do that.

Back in the day you did.

PHP has evolved significantly. You don’t need XAMMP, just install PHP, Apache and a database as standalone applications and they will seamlessly work together!

I would recommend you researching what’s up in PHP 8.

Crazy things happening in this space!


RE: How to run php localhost - NickyDev - Dec 1, 2023

(Dec 1, 2023 08:31 AM)DashPHP Wrote:  Back in the day you did.

PHP has evolved significantly. You don’t need XAMMP, just install PHP, Apache and a database as standalone applications and they will seamlessly work together!

I would recommend you researching what’s up in PHP 8.

Crazy things happening in this space!

thanks buddy 👍


RE: How to run php localhost - Hackers - Dec 2, 2023

(Dec 1, 2023 08:31 AM)DashPHP Wrote:  Back in the day you did.

PHP has evolved significantly. You don’t need XAMMP, just install PHP, Apache and a database as standalone applications and they will seamlessly work together!

I would recommend you researching what’s up in PHP 8.

Crazy things happening in this space!
Definitely lots of cool things happening. Happy to see the language progressing and excited to see how it evolves.

You don't need a database to get started with PHP and technically you can run PHP without Apache or similar if you don't need a web server. However, for the average user it's probably easier to install it with Apache to test in local browser than it is to use php cli or just running files.

Apache, nginx, databases are all great to know, but technically they're not required. And if you do learn Apache, you can route web requests to any backend you wish, so it is worth learning.

OP, not sure why you are trying to do this, but just get php from a package repository and install it on your local machine. I recommend version 8+ to stay current. Definitely don't waste time on a 5x, but there are a lot of good softwares to play with on php7x too.


RE: How to run php localhost - DashPHP - Dec 3, 2023

(Dec 2, 2023 10:59 PM)nodes Wrote:  Definitely lots of cool things happening. Happy to see the language progressing and excited to see how it evolves.

You don't need a database to get started with PHP and technically you can run PHP without Apache or similar if you don't need a web server. However, for the average user it's probably easier to install it with Apache to test in local browser than it is to use php cli or just running files.

Apache, nginx, databases are all great to know, but technically they're not required. And if you do learn Apache, you can route web requests to any backend you wish, so it is worth learning.

OP, not sure why you are trying to do this, but just get php from a package repository and install it on your local machine. I recommend version 8+ to stay current. Definitely don't waste time on a 5x, but there are a lot of good softwares to play with on php7x too.

Couldn’t have said it better Nodes!


RE: How to run php localhost - NickyDev - Dec 3, 2023

(Dec 2, 2023 10:59 PM)nodes Wrote:  Definitely lots of cool things happening. Happy to see the language progressing and excited to see how it evolves.

You don't need a database to get started with PHP and technically you can run PHP without Apache or similar if you don't need a web server. However, for the average user it's probably easier to install it with Apache to test in local browser than it is to use php cli or just running files.

Apache, nginx, databases are all great to know, but technically they're not required. And if you do learn Apache, you can route web requests to any backend you wish, so it is worth learning.

OP, not sure why you are trying to do this, but just get php from a package repository and install it on your local machine. I recommend version 8+ to stay current. Definitely don't waste time on a 5x, but there are a lot of good softwares to play with on php7x too.

thanks for advice 👍


RE: How to run php localhost - t0ks1ck™ - Jan 22, 2024

You can use the software Laragon, it has mysql, php , ruby , laragon and most thing you can name it has it


RE: How to run php localhost - Horribleaim - Feb 10, 2024

May I ask, why you don't want to use xamp? But yes, you can launch a php localhost using apache without xamp.


RE: How to run php localhost - DynamicW - Apr 16, 2024

Yes, there are several ways to run PHP in localhost without using XAMPP. One of the most common ways is to use the built-in web server that comes with PHP since version 5.4. You can run the following command in your terminal in the root directory of your PHP project:

php -S localhost:8000

This will start a PHP server on localhost at port 8000. You can then access your PHP files by navigating to http://localhost:8000 in your web browser.

Another way is to use WampServer or MAMP, which are lightweight alternatives to XAMPP. WampServer is for Windows users, while MAMP is for macOS users. Both of these tools will set up a local server environment for you to run PHP.

You can also manually configure a web server like Apache or Nginx to run PHP on your localhost. This may require more technical knowledge, but there are plenty of tutorials available online to guide you through the process.

Overall, there are many options available for running PHP in localhost without using XAMPP. Choose the method that works best for your needs and technical abilities.