简体   繁体   English

Apache错误-在Windows 2008 R2 Server上的Apache 2.2中安装PHP 5.5.7

[英]Apache Error - Installing PHP 5.5.7 in Apache 2.2 on Windows 2008 R2 Server

I've downloaded and installed PHP 5.5.7 (VC11 x86 Thread Safe) from http://windows.php.net/download/ . 我已经从http://windows.php.net/download/下载并安装了PHP 5.5.7(VC11 x86线程安全)。

Followed instructions from http://www.php.net/manual/en/install.windows.apache2.php & http://www.reaper-x.com/2007/09/24/installing-and-setting-up-apache-22-series-with-php-5-on-windows/ to no avail. 按照http://www.php.net/manual/zh-CN/install.windows.apache2.phphttp://www.reaper-x.com/2007/09/24/installing-and-setting-up中的说明进行操作-apache-22-series-with-php-5-on-windows /无济于事。

Apache simply will not start with the added PHP configuration in httpd.conf...if I comment out all PHP configuration Apache starts with no issues. 如果我注释掉所有PHP配置,Apache根本不会以httpd.conf中添加的PHP配置开头。

Apache和PHP配置

EDIT 编辑

更新了php.ini以正斜杠

Updated php.ini to forward slashes 更新了php.ini以正斜杠

Delete and uninstall everything you have done so far. 删除并卸载到目前为止已完成的所有操作。

Download apache from apache longue http://www.apachelounge.com/download/VC11/binaries/httpd-2.4.7-win64-VC11.zip Ectract to c:/apache24 从apache longue下载apache http://www.apachelounge.com/download/VC11/binaries/httpd-2.4.7-win64-VC11.zip提取到c:/ apache24

Download module modules-2.4-win64-VC11.zip http://www.apachelounge.com/download/VC11/modules/modules-2.4-win64-VC11.zip 下载模块modules-2.4-win64-VC11.zip http://www.apachelounge.com/download/VC11/modules/modules-2.4-win64-VC11.zip

Extrct and copy mod_fcgid.so into apache24\\modules 提取并复制mod_fcgid.soapache24\\modules

Open command prompt AS ADMINISTRATOR 以管理员身份打开命令提示符

cd\\ c:\\Apache24\\bin to the folder with the httpd.exe file in it cd\\ c:\\Apache24\\bin到其中带有httpd.exe文件的文件夹

type: httpd -k install type: net start apache2.4 类型: httpd -k install类型: net start apache2.4

Should be running provided no errors. 如果没有错误,则应该正在运行。

Download php from windows.php.net extract files to Apache24\\php Apache24\\php下载文件提取到Apache24\\php

Delete php.ini-production Rename php.ini-development to php.ini 删除php.ini-productionphp.ini-development重命名为php.ini

In php.ini : php.ini

Uncomment line 731: extension_dir = "ext" 取消注释行731: extension_dir = "ext"

Uncomment the follownig lines: (873 ...): 取消注释以下行:(873 ...):

extension=php_curl.dll
extension=php_gd2.dll
extension=php_mbstring.dll
extension=php_mysql.dll
extension=php_mysqli.dll
extension=php_pdo_mysql.dll

In httpd.conf in line 218 uncomment the following line and edit to : ServerName localhost 在第218行的httpd.conf中,取消注释以下行并编辑为: ServerName localhost

Change line 58 Listen 80 to change server port 更改第58行, Listen 80以更改服务器端口

In httpd.conf include this line.: httpd.conf包括以下行:

LoadModule fcgid_module modules/mod_fcgid.so

in the end of httpd.conf add the following lines: 在httpd.conf的末尾添加以下行:

<IfModule fcgid_module> 
   FcgidInitialEnv PHPRC "C:\\Apache24\\php" 
   FcgidInitialEnv PATH "C:\\Apache24\\php;C:\\WINDOWS\\system32;C:\\WINDOWS;C:\\WINDOWS\\System32\\Wbem;" 
   FcgidInitialEnv SystemRoot "C:\\Windows" 
   FcgidInitialEnv SystemDrive "C:" 
   FcgidInitialEnv TEMP "C:\\WINDOWS\\TEMP" 
   FcgidInitialEnv TMP "C:\\WINDOWS\\TEMP" 
   FcgidInitialEnv windir "C:\\WINDOWS" 
   FcgidIOTimeout 40 
   FcgidConnectTimeout 10 
   FcgidMaxProcesses 8 
   FcgidOutputBufferSize 64 
   ProcessLifeTime 0 
   FcgidMaxRequestsPerProcess 0 
   FcgidMinProcessesPerClass 0 
   FcgidMaxProcesses 50 
   FcgidFixPathinfo 1 
   FcgidZombieScanInterval 20 
   FcgidMaxRequestLen 536870912 
   FcgidIOTimeout 120 

  <Files ~ "\.php$"> 
    Options Indexes FollowSymLinks ExecCGI 
    AddHandler fcgid-script .php 
    FcgidWrapper "C:/Apache24/php/php-cgi.exe" .php 
  </Files>

  <IfModule dir_module>
DirectoryIndex index.html index.php
</IfModule>

In line 276 add index.php near index.html 在第276行中,在index.html附近添加index.php

Enable htacess 启用htacess

un-comment: LoadModule rewrite_module modules/mod_rewrite.so Replace all "AllowOverride None" to "AllowOverride All". 取消注释: LoadModule rewrite_module modules/mod_rewrite.so将所有“ AllowOverride None”替换为“ AllowOverride All”。 (find and replace all) (找到并替换所有)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM