在 Windows 上安装 PHP
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/5153042/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
PHP installation on windows
提问by Sanjay Jain
I want to install php in my system.For this I have downloaded the php-5.3.5.tar.bz2 (zip file). Now from this installation help link http://www.php.net/manual/en/install.windows.installer.msi.phpIt is saying "Run the MSI installer and follow the instructions provided by the installation wizard. "
我想在我的系统中安装 php。为此,我下载了 php-5.3.5.tar.bz2(zip 文件)。现在从这个安装帮助链接 http://www.php.net/manual/en/install.windows.installer.msi.php它说“运行 MSI 安装程序并按照安装向导提供的说明进行操作。”
But i am not getting from where I can get MSI installer?
但我无法从哪里获得 MSI 安装程序?
采纳答案by Awais Qarni
hello bro try this link. you dont need to install others. Just install wamp server and you will be having php,mysql and apache in your server. Download Wamp
你好兄弟试试这个链接。你不需要安装其他的。只需安装 wamp 服务器,您的服务器中就会有 php、mysql 和 apache。下载 Wamp
回答by Stefan Steiger
First: go to www.php.net and click on downloads, or go directly to http://www.php.net/downloads.php
http://windows.php.net/download
Choose the latest PHP x.y.z (Current stable)
For IIS, download the non-threadsafe zip file
第一:去www.php.net点击下载,或者直接去 http://www.php.net/downloads.php
http://windows.php.net/download
选择最新的 PHP xyz (Current stable) 对于 IIS,下载非线程安全的 zip 文件
Extract the downloaded zip file to c:\PHP
Download PHP-Manager for IIS 7 (that's an IIS-controlpanel-extension, also works for IIS 8) from https://github.com/phpmanager/phpmanager/releases? (make sure you choose the right bitness (32 vs. 64)
Open the IIS management console (inetmgr.exe)
Double-click PHP-Manager and click on "register new PHP installation"
(note to self:never remove the PHP directory, otherwise "rien ne va plus")- Choose php-cgi.exe and click ok
- Click on "Configure error reporting". Check "Development machine" and click apply, then click "back to main page"
- Go to C:\inetpub\wwwroot and create a new textfile called "phpinfo" and put this content into it :
将下载的 zip 文件解压到 c:\PHP
从https://github.com/phpmanager/phpmanager/releases下载 IIS 7 的 PHP 管理器(这是一个 IIS 控制面板扩展,也适用于 IIS 8)?(确保您选择正确的位数(32 对 64)
打开 IIS 管理控制台(inetmgr.exe)
双击 PHP-Manager 并点击“注册新的 PHP 安装”
(自我注意:永远不要删除 PHP 目录,否则“rien ne va plus”)- 选择 php-cgi.exe 并点击确定
- 单击“配置错误报告”。勾选“开发机”并点击应用,然后点击“返回主页”
- 转到 C:\inetpub\wwwroot 并创建一个名为“phpinfo”的新文本文件并将此内容放入其中:
<?php
phpinfo(); // Show all information, defaults to INFO_ALL
?>
<?php
phpinfo(); // Show all information, defaults to INFO_ALL
?>
Create a new file called hello.php in c:\inetpub\wwroot with this content
<?php echo "Hello World !" ; ?>
使用此内容在 c:\inetpub\wwroot 中创建一个名为 hello.php 的新文件
<?php echo "Hello World !" ; ?>
10. open cmd.exe and execute "iisreset"
10.打开cmd.exe,执行“iisreset”
- Use your browser of choice, and navigate to those pages:
http://localhost/phpinfo.php
http://localhost/helloworld.php
- 使用您选择的浏览器,并导航到这些页面:
http://localhost/phpinfo.php
http://localhost/helloworld.php
Now IIS is (should be) serving PHP.
现在 IIS 正在(应该)为 PHP 提供服务。
回答by oli_arborum
As far as I can see there are no MSI installers for PHP 5.4.xavailable from http://windows.php.net/
据我所知,http: //windows.php.net/上没有适用于PHP 5.4.x 的MSI 安装程序
Additionally, since PHP 5.3there are no MSI installers available that work together with the binaries from apache.org and you have to use the binaries from http://www.apachelounge.com/
此外,由于PHP 5.3没有可用的 MSI 安装程序与来自 apache.org 的二进制文件一起使用,您必须使用来自http://www.apachelounge.com/的二进制文件
回答by Marcel
Read the sidebar there to determine which one you should download. The MSI versions are the ones labelled "Installer".
阅读侧边栏以确定您应该下载哪一个。MSI 版本是标记为“安装程序”的版本。
回答by Planplan
The MSI installer and Windows binaries are located here : http://windows.php.net/download/
MSI 安装程序和 Windows 二进制文件位于此处:http: //windows.php.net/download/
Read the "Which version do I choose?" on the left of the page to choose the best version for you.
阅读“我选择哪个版本?” 在页面左侧选择最适合您的版本。
回答by alijunior
Try this direct link: http://windows.php.net/downloads/releases/
试试这个直接链接:http: //windows.php.net/downloads/releases/
You will find some old msi distributions...
你会发现一些旧的 msi 发行版......
*** Files now moved to http://windows.php.net/downloads/releases/archives/
*** 文件现在移至http://windows.php.net/downloads/releases/archives/
回答by Mike Cheel
Late to the party here but according to the readme (install.txt) that comes with php 5.5:
迟到了,但根据 php 5.5 附带的自述文件 (install.txt):
There are several all-in-one installers over the Internet, but none of those are endorsed by PHP.net, as we believe that the manual
installation is the best choice to have your system secure and
optimised.
互联网上有几个多合一的安装程序,但没有一个得到 PHP.net 的认可,因为我们相信手动
安装是让您的系统安全和
优化的最佳选择。
回答by Marty_in_a_Box
I used the Microsoft Web Platform Installer 5.0 At the time i post this (01.2016) it's up-to-Date.
我使用的是 Microsoft Web Platform Installer 5.0 在我发布这篇文章时 (01.2016),它是最新的。
回答by Mark Baker
MSI is a standard component of Windows. Download the MSI file, then just double click on that file and it will automatically run and install PHP.
MSI 是 Windows 的标准组件。下载 MSI 文件,然后双击该文件,它会自动运行并安装 PHP。
回答by Razib Al Mamun
To begin working with PHP you must first have access to either of the following:
要开始使用 PHP,您必须首先访问以下任一内容:
A web hosting account that supports the use of PHP web pages and grants you access to MySQL databases. If you do not have a host, but are interested in signing up for one.
Have PHP and MySQL installed on your own computer. Read this lesson thorougly for more information on installing PHP.
支持使用 PHP 网页并授予您对 MySQL 数据库的访问权限的网络托管帐户。如果您没有主持人,但有兴趣注册一个。
在您自己的计算机上安装 PHP 和 MySQL。仔细阅读本课程,了解有关安装 PHP 的更多信息。
Although MySQL is not absolutely necessary to use PHP, MySQL and PHP are wonderful complements to one another and some topics covered in this tutorial will require that you have MySQL access. http://tutorialsbox.net/php-installation/
尽管 MySQL 不是使用 PHP 绝对必要的,但 MySQL 和 PHP 是彼此之间的绝妙补充,本教程中涵盖的某些主题需要您具有 MySQL 访问权限。 http://tutorialsbox.net/php-installation/