阿帕奇处理`吨上的.php文件的Windows7 [英] Apache doesn`t handle .php files on Windows7

查看:260
本文介绍了阿帕奇处理`吨上的.php文件的Windows7的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在随后的一天才去安装喜欢的事XAMP我不知道为什么以下hasn`t制定了我,万一有人已经搜查,tryed后知道:

条件:Windows 7中(64),微软VC(2005/2008/2010/2012)

目的:在本地计算机上安装一个Web服务器来执行PHP的脚本

过程

1)嗯,首先我下载二进制的Apache 2.4 Win64的需要的微软VC11 。然后我编辑的conf文件,并安装了Apache,一切都很好,我能看到页面http:/本地主机返回它的工作原理。 ok了。

2)然后我去安装PHP。有没有为Win64的任何稳定的正式发布。好吧,我下载的 VC11 86线程安全并从CMD与安装了 PHP -i。这似乎是太细,因为它的工作控制台输入的php.exe -f路径到文件。 php.ini文件是使用默认设置。

3)在这里,这就是我的麻烦开始的地方。我要整合Apache和PHP。据php.net,有3种常见的方式来做到这一点:CGI,FastCGI的程序和处理程序。我选择了最后一个 - 为处理程序,在加入httpd.conf文件的最后内容:

 的LoadModule php5_moduleC:/myAdr/php5apache2_4.dll
AddHandler的应用程序/ X的httpd - PHP的.php
中的PHPIniDirC:/ myAdr

然后,我不能重新启动Web服务器。出现以下消息:

 的httpd:/myAdr/apache/conf/httpd.conf:c上的530行语法错误无法加载C:/myAdr/php/php5apache2_4.dll到服务器:1% \\固定的\\ xe5的Win32 ...

和因为你已经认为它没有工作。本地主机仍显示工作原理(即无阿帕奇已经重新开始工作),但它仍犯规执行PHP :(我在这里完成的。有没有在配置文件中我应该有取消注释或添加特殊/附加行<? / p>

简评:安装Apache和功放之前,PHP的,我有合适的微软VC安装,禁用窗口的IIS组件(否则表面常见的错误,以80端口的不能被Apache使用,因为它是使用IIS和东西)。 VC版本(在我的情况VC11)重合为Apache和PHP(这里的另一个常见的​​问题是基于基于VC9 VC6和PHP的使用Apache,例如)。我总是在我的电脑上的管理员。文件php5apache2_4.dll根据给Apache的路径是在php文件夹。此外,我看到一对夫妇在这里类似的题目,但这些建议对我来说没有工作或者,也​​许我只是不知道如何做到这一点:(

到目前为止,我有两个问题:


  • 我做了什么错了一般?

  • 有没有安排人到底是谁
    问题?如果是,我想,很多人想知道如何在细节。

更新!最后我做了它的工作!这个问题(即错误在文件的 php5apache2_4.dll 既不加载也不找到)由version`s不兼容,也就是说,我的操作系统是WIN7(64)和我的Apache是​​专为Win64平台(的httpd-2.4的1.6 Win64上-VC11),但我用PHP设计的win32(PHP-5.5.1-Win32的VC11-86由于缺乏官方稳定的PHP版本的Win64的)。对我来说,解决办法是找到PHP的Win64的!本主题中的http //www.apachelounge.com/viewtopic.php?p=23384第一个环节为我们提供了PHP 5.4.9对Windows x64!注意,有没有的php.ini文件在那里!你应该把他们从其他distributives。正如我上面描述安装该版本在开始之后,一切工作现在!


解决方案

我会删除Apache和PHP的安装目前并直接转到WAMP或XAMPP。如果你以前没有使用过Apache和PHP,有太多的事情要得到正确的它工作了。

After having searched and tryed during the whole day and before going to install something like XAMP i wonder why the following hasn`t worked out for me, in case somebody knows:

Conditions: Windows 7 (64), Microsoft VC (2005/2008/2010/2012).

Purpose: to install a web-server on the local machine to execute PHP-scripts.

Process:

1) Well, firstly i downloaded binary apache 2.4 for win64 which require Microsoft VC11. Then i edited conf-file and installed apache, everything was fine, i could see the page http:/localhost returning "It works". Ok.

2) Then i went to install PHP. There is no any stable official release for win64. Well, i downloaded VC11 x86 Thread Safe and installed it from cmd with "php -i". It seemed to be fine too because it worked in console by typing "php.exe -f path-to-file". php.ini was with default settings.

3) Thats here where my trouble begins. I have to integrate apache and php. According to php.net, there are 3 common ways to do that: cgi, fastcgi and handler. I chose the last - as handler, adding at the end of httpd.conf that content:

LoadModule php5_module "c:/myAdr/php5apache2_4.dll"
AddHandler application/x-httpd-php .php
PHPIniDir "c:/myAdr"

Then i cannot restart web-server. The following message appears:

httpd: Syntax error on line 530 of c:/myAdr/apache/conf/httpd.conf: Cannot load c:/myAdr/php/php5apache2_4.dll into server: 1% \xed \xe5 ... win32

And as you have already supposed it didnt work. The localhost still shows "it works" (i.e. apache without having been restarted works), but it still doesnt execute php :( And here i am done. Are there special/additional lines in the config file i should have uncommented or added?

Short review: Before installing apache&php, i have had proper Microsoft VC installed, disabled IIS-components of windows (otherwise surfaces common error as to port 80 that cannot be used by apache because it is used by IIS and stuff). VC versions (in my case VC11) coincide for both apache and php (another common issue here is the use of apache based on VC6 and php based on VC9, for example). I was always under Administrator on my PC. File php5apache2_4.dll was in the php-folder according to path given to apache. Also i saw a couple of similar topics here, but those advices didnt work for me or, probably, i just dont understand how to do it :(

So far i have got two questions:

  • What did i do wrong generally?
  • Is there anybody who in the end arranged the problem? And if yes, i guess, many people would like to know how in detail.

UPDATE! FINALLY I MADE IT WORK! the issue (that error when the file php5apache2_4.dll is neither loaded nor found) consists of version`s incompatibility, i.e. my OS is win7 (64) and my apache is designed for win64 (httpd-2.4.6-win64-VC11), but i used PHP DESIGNED FOR win32 (php-5.5.1-Win32-VC11-x86) because of lack of official stable php-version for win64. The solution for me was to find php for win64! first link in this topic http //www.apachelounge.com/viewtopic.php?p=23384 provides us with PHP 5.4.9 for Windows x64! Attention, there are no php.ini files there! You should take them from other distributives. And after installing that version as i described above at the beginning, everything is working now!

解决方案

I would remove the current installs of Apache and PHP and go directly to WAMP or XAMPP. If you have not used Apache and PHP before, there are too many things to get right before it works.

这篇关于阿帕奇处理`吨上的.php文件的Windows7的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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