简体   繁体   English

在Windows 7 x64的PHP上安装APC

[英]Install APC on PHP For Windows 7 x64

When I try to start Apache with 当我尝试以以下方式启动Apache时

[PHP_APC]    
extension = php_apc.dll
[apc]
apc.shm_segments=1
apc.optimization=0
apc.shm_size=128
apc.ttl=7200
apc.user_ttl=7200
apc.num_files_hint=1024
apc.mmap_file_mask=/tmp/apc.XXXXXX
apc.enable_cli=1

in php.ini, it fails. 在php.ini中,它失败。 I have the php_apc.dll in the ext directory. 我在ext目录中有php_apc.dll。

Using Apache 2.2.17 and PHP 5.2.14 on Windows 7 x64. 在Windows 7 x64上使用Apache 2.2.17和PHP 5.2.14。

Any suggestions? 有什么建议么?

After trying a lot of solutions, I found one that worked for me... so I am going to post this as an answer just to help people that may have the same problem finding the correct version to use. 在尝试了许多解决方案之后,我发现了一个对我有用的解决方案。因此,我将其发布为答案,只是为了帮助可能遇到相同问题的人们找到要使用的正确版本。

I am using Windows 7 32bits , PHP 5.3.13 , Apache 2.2.22 , and the php_apc.dll found in the file apc-igbinary-fastlz-snap20110301-5.3-ts-vc9-x86.zip in this site: http://downloads.php.net/pierre/ 我正在使用Windows 7 32bitsPHP 5.3.13Apache 2.2.22和在此站点的文件apc-igbinary-fastlz-snap20110301-5.3-ts-vc9-x86.zip中找到的php_apc.dllhttp:// /downloads.php.net/pierre/

I have registered the extension by just pasting the following code to the end of php.ini file: 我已经通过将以下代码粘贴到php.ini文件的末尾来注册了扩展名:

[PHP_APC]
extension=php_apc.dll

Then I checked the result of phpinfo(), by using this php file: 然后,我使用以下php文件检查了phpinfo()的结果:

phpinfo.php phpinfo.php

<?php phpinfo(); ?>

Best bet, due to the limited windows PECL support atm, is to install Zend Server CE w/ PHP 5.3. 由于Windows PECL支持atm的限制,最好的选择是安装带有PHP 5.3的Zend Server CE。 You can have it install itself on IIS or Apache on the windows machine. 您可以将其自身安装在Windows机器上的IIS或Apache上。 Zend Server comes with APC built in (As well as many other PHP modules missing from the current 5.3 PECL stack). Zend Server内置了APC(以及当前5.3 PECL堆栈中缺少的许多其他PHP模块)。

As a side note, you could probably (I haven't tested this so...is just a possibility) install the server, "steal" the dlls, and install PHP however you like w/o zend server. 附带说明一下,您可能(我尚未测试过,所以...只是一种可能)安装服务器,“窃取” dll,然后安装PHP,但是您喜欢不使用zend服务器。 BUT, that said, Zend server is actually pretty nice :) 但是,这就是说,Zend服务器实际上非常好:)

Fixed. 固定。 Was using the wrong version of APC. 使用了错误版本的APC。

在Windows上时,请从此处http://downloads.php.net/pierre使用APC VC6

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

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