LDAP works with PHP CLI but not through apache

后端 未结 2 2014
無奈伤痛
無奈伤痛 2020-12-19 18:21

I\'m trying to authenticate over LDAP against a Windows 2008 Server from a Fedora box.

The following code works from the command line (prints \"Success\"):



        
2条回答
  •  [愿得一人]
    2020-12-19 19:18

    You might be having this problem because Apache has one php.ini file and CLI might have another, and the Apache version might not have LDAP extension enabled.

    Try checking which php.ini is loading with phpinfo() in both of your environments:

    
    

    You should see the path of php.ini and additional useful information:

    Configuration File (php.ini) Path => /etc/php5/cli
    Loaded Configuration File => /etc/php5/cli/php.ini
    Scan this dir for additional .ini files => /etc/php5/cli/conf.d
    

    An alternative method to see the configuration loaded on the CLI is by calling php with -i parameter:

    $ php -i | grep 'php.ini'
    Configuration File (php.ini) Path => /etc/php5/cli
    Loaded Configuration File => /etc/php5/cli/php.ini
    

提交回复
热议问题