PHP模块加载,但是Apache开始说不 - LDAP [英] PHP loads module, but Apache Start Says No - LDAP
问题描述
我有以下的下载我的机器上
I have the following downloaded on my machine
从apachelounge apache2.2.21拉链
apache2.2.21 zip from apachelounge
PHP 5.3.8线程从php.net
php 5.3.8 thread safe zip from php.net
Windows 7的
Windows 7
我他们俩解压缩到我的电脑上的一些路径。比方说,它被称为$ HOME。
I've unzipped them both to some path on my computer. Let's say its called $HOME.
所以我有$ HOME / apach2和$ HOME / PHP的。
So I have $HOME/apach2 and $HOME/php.
我已经成功地得到了的phpinfo()页面中显示,甚至安装在NetBeans调试目的Xdebug扩展。
I've successfully gotten the phpinfo() page to display and even installed the xdebug extension for debugging purposes in netbeans.
我的问题是这样的:
我注释掉扩展= php_ldap.dll'在php.ini,因为我需要LDAP连接。
I uncommented 'extension=php_ldap.dll' in the php.ini because I need ldap connectivity.
我将开始Apache和显示器说,Apache是运行。后来我转到我的index.php,但出现错误说ldap_connect不存在。
I'll start apache and the monitor says that apache is running. I then navigate to my index.php but an error occurs saying that ldap_connect doesn't exist.
当我键入如果PHP --rf ldap_connect进入命令行,我得到的函数原型没有问题的。
When I type if 'php --rf ldap_connect' into the command line, I get the function prototype no problem.
我甚至写了一个PHP脚本,将使用LDAP扩展做LDAP搜索。
I even have a php script written that will use the ldap extension to do ldap search.
$conn = ldap_connect( 'ldap://myhostsomewhere', 389 );
ldap_set_option( $conn, LDAP_OPT_PROTOCOL_VERSION, 3 );
ldap_bind( $conn, 'cn=admin,dc=emc,dc=com', 'secret' );
$rs = ldap_search( $conn, 'cn=jerry,ou=people,dc=example,dc=com', '(cn=jerry)');
$stuff = ldap_get_entries( $conn, $rs );
var_dump( $stuff );
在code以上将返回所有结果的数组和我没有得到任何错误。
The code above will return an array with all the results and I get NO errors.
然而,当我检查Apache的错误日志,我得到以下错误,
When I check the Apache error log however, I get the following error,
PHP的警告:PHP启动:无法加载动态库'C:/Users/jerry/Documents/myprogs/php/ext/php_ldap.dll' - 指定的模块找不到\\ r \\ n在未知线0中。
PHP Warning: PHP Startup: Unable to load dynamic library 'C:/Users/jerry/Documents/myprogs/php/ext/php_ldap.dll' - The specified module could not be found.\r\n in Unknown on line 0.
我双重检查和三重检查,该目录是存在的,但所有的Apache时尝试运行PHP时,没有加载。但是当我通过命令行运行PHP它加载的罚款。
I've double checked and triple checked and the directory is there and all but it isn't loading when apache tries to run php. BUT it loads fine when I run PHP through the command line.
我看了的phpinfo()和Apache加载了正确的php.ini文件中。
I've looked at the phpinfo() and apache is loading the correct php.ini file as well.
我不知道是怎么回事的。
I have NO clue what is going one.
怪异的是,通常这样的PHP的错误可能导致阿帕奇停止,并造成某种故障。这是一个PHP的警告,虽然,和apache启动就好了,但是当我尝试调用ldap_connect它抱怨。
The weird part is that usually a php error like that might cause apache to stop and cause some sort of fault. It's a PHP Warning though, and apache starts up just fine but it complains when I try to call ldap_connect.
任何人有什么建议吗?
推荐答案
这是我如何解决它。
我想我一定是交换在php.ini文件中的东西的价值。我把窗户PHP安装程序,运行它,让它覆盖现有的php.ini文件。
I think that I must've switched the value of something in the php.ini file. I took the windows php installer, ran it and let it override the existing php.ini file.
在这之后,我把PHP的压缩版本,并放弃了它来取代Windows Installer版本,但我保存php.ini文件。之后,它工作得很好,没有问题。
After that, I took the zipped version of php and dropped it in to replace the windows installer version but I saved the php.ini file. After that it worked fine, no issues.
这篇关于PHP模块加载,但是Apache开始说不 - LDAP的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!