Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

PHP 

How to run php localhost

Guys, how to run php in localhost without XAMP?
is there any way?
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!
[Image: O444cFs.jpg]
(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.
(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!
[Image: O444cFs.jpg]
(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 👍
(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.
(Dec 2, 2023 10:59 PM)Hackers 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!
[Image: O444cFs.jpg]
(Dec 2, 2023 10:59 PM)Hackers 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 👍
You can use the software Laragon, it has mysql, php , ruby , laragon and most thing you can name it has it
May I ask, why you don't want to use xamp? But yes, you can launch a php localhost using apache without xamp.
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.


Possibly Related Threads...
Thread / Author Replies Views Last Post
[Node.JS] by Reiss0101Nov 20, 2022 06:01 AM 1 149 Nov 20, 2022 06:01 AM
Last Post: Oxycodone
[PHP] by The One Who KnocksApr 23, 2020 10:57 PM 3 268 Apr 23, 2020 10:57 PM
Last Post: Pronouncer
[PHP] by v47093Nov 21, 2017 01:56 AM 7 267 Nov 21, 2017 01:56 AM
Last Post: v47093