How do i download php software on windows 10?
This article explains how to install PHP 8 and Apache 2.4 on Windows 10 (64-bit). Show
Linux and macOS users often have Apache and PHP pre-installed or available via package managers. Windows 10 requires a little more effort. The steps below may work with other editions of Windows, PHP, and Apache, but check the documentation of each dependency for specific instructions. Why PHP?PHP remains the most widespread and popular server-side scripting language in web development. It’s installed by most web hosts, and has a simple learning curve, close ties with the MySQL database, superb documentation, and an excellent collection of libraries to cut your development time. PHP may not be perfect, but it should be considered as an option for your next web application. It’s the language of choice for Facebook, Slack, Wikipedia, MailChimp, Etsy, and WordPress — the Content Management System which powers 40% of the web. Why Install PHP Locally?Installing PHP on your development PC allows you to safely create and test websites and applications without affecting the data or systems on your live server. Alternative Installation OptionsBefore you jump in, there may be a simpler installation options… Use an All-in-One packageAll-in-one packages are available for Windows which contain Apache, PHP, MySQL, and many other dependencies in a single installation file — such as XAMPP, WampServer and Web.Developer. These packages are easy to use, but they may not exactly match your live server. Installing Apache and PHP manually will help you learn more about the system and configuration options. Use a Linux Virtual MachineMicrosoft Hyper-V (provided in Windows 10 Professional) and VirtualBox are free hypervisors which emulate a PC so you can install another operating system. You can install any version of Linux, then follow its Apache and PHP installation instructions. Alternatively, distros such as Ubuntu Server provide them as standard (although they’re rarely the latest editions). Use Windows Subsystem for Linux 2WSL2 is also a virtual machine, but it’s tightly integrated into Windows so activities such as file sharing and Use DockerDocker creates a wrapper (known as a container) around pre-configured application dependencies such as Apache, PHP, MySQL, MongoDB, and most other web software. Containers look like full Linux Virtual Machines but are considerably more lightweight. Once you’ve installed Docker Desktop on Windows 10, it’s easy to download, configure, and run Apache and PHP. Docker is currently considered the best option for setting up a PHP development environment. Read our complete guide to setting up a PHP development environment with Docker. Install Apache (optional)If you’re still reading, the following sections describe how to install Apache and PHP directly on Windows. PHP provides a built-in web server which can be launched by
navigating to a folder and running the PHP executable with an
PHP pages can then be viewed in a browser at http://localhost:8000. This may be adequate for quick tests, but your live server will use Apache or similar web server software. Emulating that environment as closely as possible will prevent development errors. To install Apache, download the latest Win64
ZIP file from https://www.apachelounge.com/download/ and extract its Open a
You may need to accept a firewall exception before the server starts to run. Open http://localhost in a browser and an “It works!” message should appear. Note:
Also not that, if Apache won’t start, it’s likely another application is hogging port 80. (Skype is the
prime candidate and the Windows 10 app won’t let you disable it!) If this occurs, edit The server can be stopped with Ctrl + C. The How to Install PHPInstall PHP by following the steps below. Note that there are several ways to configure Apache and PHP, but this is possibly the quickest method. Step 1: Download the PHP filesYou’ll need the PHP Windows installer. There are a number of versions of PHP available. Make sure you get the latest PHP 8 x64 Thread Safe ZIP package from https://www.php.net/downloads.php. Create a new PHP can be installed anywhere on your system, but you’ll need to change the paths referenced below if Step 3: Configure php.iniPHP’s configuration file is named There
are several lines you may need to change in a text editor (use search to find the current value). In most cases, you’ll need to remove a leading semicolon ( First, enable any required extensions. This will depend on the libraries you want to use, but the following extensions should be suitable for most applications:
If you want to send emails using PHP’s
Step 4: Add C:\php to the path environment variableTo ensure Windows can find the PHP executable, you need to change the Scroll
down the System variables list and click Path followed by the Edit button. Click New and add Note that older editions of Windows have a single text box where each path is separated by a semi-colon ( Click OK until you’re out. You shouldn’t need
to reboot, but you may need to close and restart any Step 5: Configure PHP as an Apache moduleEnsure Apache isn’t running and open its
Optionally, change the
Change it to:
Save
If all went well, restart Apache with Step 6: Test a PHP fileCreate a new file named
Open a web browser and enter your server address: http://localhost/. A “PHP version” page will appear showing the various PHP and Apache configuration settings. You can now create PHP sites and applications in any sub-folder of Further information:
If you’re more comfortable with Linux, you might prefer to set up your PHP environment under Windows Subsystem for Linux 2. Check out our WSL2 guide and in-depth Windows Terminal tutorial for more. Can I install PHP on my computer?You can install php on windows manually. You can run the . msi package, i.e. windows installer for php to install php. Besides full installation, you can install php extensions on an existing installation of PHP.
How do I know if PHP is installed on Windows?1. Type the following command, replacing [location] with the path to your PHP installation. 2. Typing php -v now shows the PHP version installed on your Windows system.
What do I need to run PHP on my PC?If you want to run a PHP file in the browser on your own computer, you'll need to set up a PHP development stack. You'll need at least PHP, MySQL, and a server like Apache or Nginx. MySQL is used to set up databases your PHP applications can work with.
|