如何通过httpd.conf来激活PHP上的Apache2 [英] How to activate PHP on Apache2 by httpd.conf

查看:208
本文介绍了如何通过httpd.conf来激活PHP上的Apache2的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的Windows 7系统Utimate。结果
我有没有PHP工作的Apache2服务器激活。结果
我已经下载PHP5和文件中提取到C:\\ PHP。
我添加这些行,以激活PHP来httpd.conf文件,按照指示在PHP目录:

  ## PHP
    #对于PHP 5做这样的事情:
    的LoadModule php5_moduleC:/php/php5apache2_4.dll
    将AddType应用/ X的httpd - PHP的.php    #配置路径为php.ini
    中的PHPIniDirC:/ PHP的
    #################### PHP

现在的Apache拒绝再次启动,即使重新启动系统后。结果
如果我撤消更改到conf它开始罚款。结果
如何让PHP和服务器的工作?

error.log中的Apache说:

 [周五年04月11 10:57:43 2014年] [警告] pid文件C:/ Program Files文件(x86)的/
阿帕奇组/的Apache2 /日志/ httpd.pid覆盖 - 不正常关机
previous的Apache运行吗?


解决方案

警告错误日志是无关紧要的。它只是说,httpd.pid被覆盖,服务器应该是网上反正。

阿帕奇&放大器; PHP在Windows上要求既要在同一环境下进行编译的兼容性特别是当你下载Apache和PHP pre-编译的二进制文件,你必须确保他们正在使用相同的编译器编译。

例如:

确定


  

的Apache 2.4.9的Win32 VC11 &安培; PHP 5.5.11 VC11 86


  
  

的Apache 2.4.9的Win32 VC9 &安培; PHP 5.5.11 VC9 86


  
  

的Apache 2.2.27的Win32 VC9 &安培; PHP 27年5月4日86 VC9


NOT OK


  

的Apache 2.4.9的Win32 VC11 &安培; PHP 27年5月4日86 VC9


  
  

的Apache 2.4.9的Win32 VC9 &安培; PHP 5.5.11 VC11 86


  
  

的Apache 2.2.27的Win32 VC9 &安培; PHP 5.5.11 VC11 86


尽量确保PHP您下载是建立与相同的编译器IE浏览器。 VC11加上VC11或VC9加上VC9以及与x86和x64与x64的86。

这可能不是总是这样的,但是我按照这个的时候,它会工作。

I have Windows 7 Utimate System.
I have a working Apache2 server without PHP activated.
I have downloaded PHP5 and extracted the files to C:\php. I added these lines to activate PHP to httpd.conf file, as per instructions in PHP directory:

    ##PHP
    # For PHP 5 do something like this:
    LoadModule php5_module "C:/php/php5apache2_4.dll"
    AddType application/x-httpd-php .php

    # configure the path to php.ini
    PHPIniDir "C:/php"
    ####################PHP  

Now Apache refusing to start again, even after restarting the system.
It is starting fine if I undo changes to conf.
How to get PHP and server working?

error.log for Apache says:

"[Fri Apr 11 10:57:43 2014] [warn] pid file C:/Program Files (x86)/  
Apache Group/Apache2/logs/httpd.pid overwritten -- Unclean shutdown  
of previous Apache run?" 

解决方案

The warning error log was irrelevant. It merely says the httpd.pid is overwritten and the server should be online anyway.

Apache & PHP on Windows requires both to be compiled in the same environment for compatibility especially when you download pre-compiled binaries for Apache and PHP, you have to make sure they are being compiled using the same compiler.

Eg.

OK

Apache 2.4.9 Win32 VC11 & PHP 5.5.11 VC11 x86

Apache 2.4.9 Win32 VC9 & PHP 5.5.11 VC9 x86

Apache 2.2.27 Win32 VC9 & PHP 5.4.27 VC9 x86

NOT OK

Apache 2.4.9 Win32 VC11 & PHP 5.4.27 VC9 x86

Apache 2.4.9 Win32 VC9 & PHP 5.5.11 VC11 x86

Apache 2.2.27 Win32 VC9 & PHP 5.5.11 VC11 x86

Try making sure PHP you downloaded is built with the same compiler ie. VC11 coupled with VC11 or VC9 coupled with VC9 as well as x86 with x86 and x64 with x64.

This might not be always the case but when I follow this, it'll work.

这篇关于如何通过httpd.conf来激活PHP上的Apache2的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆