Heim  >  Artikel  >  Backend-Entwicklung  >  PHP 开发第一章之环境调度PHP引擎

PHP 开发第一章之环境调度PHP引擎

WBOY
WBOYOriginal
2016-06-13 13:06:40679Durchsuche

PHP 开发第一章之环境部署PHP引擎

转帖自:http://netbeans.org/kb/docs/php/configure-php-environment-windows_zh_CN.html

  1. 下载 PHP5 引擎。 windows:http://windows.php.net/download/???:php-5.4.0-Win32-VC9-x86.zip注:php-5.3.5-nts-Win32-VC6-x86版本,更不要下载VC9版本的,因为VC9是专门为IIS定制的,VC6 是为了其他WEB服务软件提供的,如 Apache。Apache服务器又有openssl和no_ssl之分,openssl表示带有openssl模块,利用openssl可给Apache配置SSL安全链接。
  2. 5.3.10下载完成后,运行 php-5.3.10-nts-Win32-VC9-x86.msi 安装文件。此时将启动安装向导。在“Apache 配置目录”面板上,指定 httpd.conf 文件所在的目录,缺省设置是 C:\Program Files\Apache Software Foundation\Apache\conf\。PHP 处理将自动启用。
  3. 如果您要使用 MySQL 数据库服务器,请选择“完全”安装选项,或在“扩展”列表中选择 "MySQL" 和 "MySQLi" 项。
  4. 安装完成后,请重新启动 Apache 服务器。
    1. 要检查 PHP 引擎是否已成功安装,以及是否在 Apache 配置中启用了 PHP 处理,请:
    2. 在记事本中,创建一个文件并键入以下文本:
      <?php 
           echo "PHP has been installed successfully!";
      ?>
    • 将此文件保存在 "htdocs" 文件夹中:C:\Program Files\Apache Software Foundation\Apache\htdocs\test.php
    • 运行浏览器,然后输入以下 URL:http://localhost:/test.php。以下页面打开:
      php
  • 疑难解答

    如果页面未打开:

    1. 重新启动 Apache 服务器。
    2. 检查 Apache 服务器配置文件 httpd.conf 是否包含以下几行:
        AddType Application/x-httpd-php .php 
        LoadModule php5_module "c:/php/sapi/php5apache2_2.dll"
    3. 如果缺少以上几行,请添加它们,并保存 httpd.conf,然后重新启动 Apache。
    4. 刷新 http://localhost:/test.php 页面。

    ?

    Stellungnahme:
    Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn