如何通过httpd.conf来激活PHP上的Apache2

编程入门 行业动态 更新时间:2024-10-27 08:24:28
本文介绍了如何通过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

本文发布于:2023-07-16 04:06:19,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1117674.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:conf   httpd   PHP

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!