Installation On Windows Systems - Manual - PHP

update page now
  • Downloads
  • Documentation
  • Get Involved
  • Help
  • PHP 8.5
Search docs Getting Started Introduction A simple tutorial Language Reference Basic syntax Types Variables Constants Expressions Operators Control Structures Functions Classes and Objects Namespaces Enumerations Errors Exceptions Fibers Generators Attributes References Explained Predefined Variables Predefined Exceptions Predefined Interfaces and Classes Predefined Attributes Context options and parameters Supported Protocols and Wrappers Security Introduction General considerations Installed as CGI binary Installed as an Apache module Session Security Filesystem Security Database Security Error Reporting User Submitted Data Hiding PHP Keeping Current Features HTTP authentication with PHP Cookies Sessions Handling file uploads Using remote files Connection handling Persistent Database Connections Command line usage Garbage Collection DTrace Dynamic Tracing Function Reference Affecting PHP's Behaviour Audio Formats Manipulation Authentication Services Command Line Specific Extensions Compression and Archive Extensions Cryptography Extensions Database Extensions Date and Time Related Extensions File System Related Extensions Human Language and Character Encoding Support Image Processing and Generation Mail Related Extensions Mathematical Extensions Non-Text MIME Output Process Control Extensions Other Basic Extensions Other Services Search Engine Extensions Server Specific Extensions Session Extensions Text Processing Variable and Type Related Extensions Web Services Windows Only Extensions XML Manipulation GUI Extensions Keyboard Shortcuts? This help j Next menu item k Previous menu item g p Previous man page g n Next man page G Scroll to bottom g g Scroll to top g h Goto homepage g s Goto search(current page) / Focus search box Recommended configuration on Windows systems » « Using the bundled PHP prior to macOS Monterey
  • PHP Manual
  • Installation and Configuration
Change language: English German Spanish French Italian Japanese Brazilian Portuguese Russian Turkish Ukrainian Chinese (Simplified) Other Installation on Windows systems

Table of Contents

  • Recommended configuration on Windows systems
  • Manual installation of pre-built binaries
  • Installation for Apache 2.x on Windows systems
  • Installation with IIS for Windows
  • Third-party tools for installing PHP
  • Building from source
  • Running PHP on the command line on Windows systems

The official releases of PHP on Windows are recommended for production use, but PHP can also be built from source.

PHP can also be installed on Azure App Services (aka Microsoft Azure, Windows Azure, or (Windows) Azure Web Apps).

The Installation section of the frequently asked questions covers common installation and configuration issues that may be encountered.

Found A Problem?

Learn How To Improve This Page • Submit a Pull Request • Report a Bug +add a note

User Contributed Notes 2 notes

up down 572 SmugWimp at smugwimp dot com19 years ago If you make changes to your PHP.ini file, consider the following. (I'm running IIS5 on W2K server. I don't know about 2K3) PHP will not "take" the changes until the webserver is restarted, and that doesn't mean through the MMC. Usually folks just reboot. But you can also use the following commands, for a much faster "turnaround". At a command line prompt, type: iisreset /stop and that will stop the webserver service. Then type: net start w3svc and that will start the webserver service again. MUCH faster than a reboot, and you can check your changes faster as a result with the old: <?php> phpinfo(); ?> in your page somewhere. I wish I could remember where I read this tip; it isn't anything I came up with... up down 109 lukasz at szostak dot biz19 years ago You can have multiple versions of PHP running on the same Apache server. I have seen many different solutions pointing at achieving this, but most of them required installing additional instances of Apache, redirecting ports/hosts, etc., which was not satisfying for me. Finally, I have come up with the simplest solution I've seen so far, limited to reconfiguring Apache's httpd.conf. My goal is to have PHP5 as the default scripting language for .php files in my DocumentRoot (which is in my case d:/htdocs), and PHP4 for specified DocumentRoot subdirectories. Here it is (Apache's httpd.conf contents): --------------------------- # replace with your PHP4 directory ScriptAlias /php4/ "c:/usr/php4/" # replace with your PHP5 directory ScriptAlias /php5/ "c:/usr/php5/" AddType application/x-httpd-php .php Action application/x-httpd-php "/php5/php-cgi.exe" # populate this for every directory with PHP4 code <Directory "d:/htdocs/some_subdir"> Action application/x-httpd-php "/php4/php.exe" # directory where your PHP4 php.ini file is located at SetEnv PHPRC "c:/usr/php4" </Directory> # remember to put this section below the above <Directory "d:/htdocs"> # directory where your PHP5 php.ini file is located at SetEnv PHPRC "c:/usr/php5" </Directory> --------------------------- This solution is not limited to having only two parallel versions of PHP. You can play with httpd.conf contents to have as many PHP versions configured as you want. You can also use multiple php.ini configuration files for the same PHP version (but for different DocumentRoot subfolders), which might be useful in some cases. Remember to put your php.ini files in directories specified in lines "SetEnv PHPRC...", and make sure that there's no php.ini files in other directories (such as c:\windows in Windows). And finally, as you can see, I run PHP in CGI mode. This has its advantages and limitations. If you have to run PHP as Apache module, then... sorry - you have to use other solution (the best advice as always is: Google it!). Hope this helps someone. +add a note
  • Installation and Configuration
    • General Installation Considerations
    • Installation on Unix systems
    • Installation on macOS
    • Installation on Windows systems
    • Installation on Cloud Computing platforms
    • FastCGI Process Manager (FPM)
    • Installation of PECL extensions
    • Introduction to Composer
    • Introduction to PIE
    • Runtime Configuration
To Top ↑ and ↓ to navigate • Enter to select • Esc to close • / to open Press Enter without selection to search using Google

Từ khóa » Cài Php