Advertisement

06.29.2005 at 06:37AM PDT, ID: 21474752
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

6.8

PHP and Active Directory not playing nicely

Asked by richswyatt in PHP Scripting Language

Tags: , ,

Here is the scenario:

Active Directory Domain Controller named "bob"
bob is on the test.int domain
Linux Enterprise 3.0 server named "project" (not on the test.int domain)

I have a script on "project" that connects to the Active Directory on "bob" using ldap_connect, ldap_bind, etc...

A portion of the script is:
echo "<h3>LDAP query test</h3>\n";
echo "Connecting...";

// using ldap bind
$ldapdomainNB = 'test.int';
$ldaprdn  = 'admin';  // ldap rdn or dn (i.e., username)
$ldappass = 'somepass';  // associated password

$ds=ldap_connect("ldaps://bob's ip/");  // must be a valid LDAP server!
echo "OK. Connect result is " . $ds . "\n";


EVERYTHING IS FINE TILL THIS PART...

if ($ds) {

      ldap_set_option($ds, LDAP_OPT_PROTOCOL_VERSION, 3);

      # In order to perform the searches on Windows 2003 Server Active Directory you have to set the LDAP_OPT_REFERRALS option to 0:
      ldap_set_option($ds, LDAP_OPT_REFERRALS, 0);
      # Without this, you will get "Operations error" if you try to search the whole AD schema (using root of the domain as a $base_dn).
      # As opposed to Windows 2000 Server, where this option was optional and only increased the performance.


      echo "Binding...";
      $r=ldap_bind($ds, $ldapdomainNB.'\\'.$ldaprdn, $ldappass)
      
#      $r=ldap_bind($ds)                              // this is an "anonymous" bind, typically
            or exit(">>Could not bind to ldap host<<\n");            // read-only access
      echo "OK\n";


Here is the problem... IF I run this script - we'll call it ldap_test.php, from the browser - it gives a "page cannot be displayed"...
HOWEVER, if I go into the command line on the linux server and type:    php ldap_test.php it is able to bind and goes through the rest of the script and gives my results.

WHY can I not do this through the browser?  Why does it only work if I run the script via linux command line?  Has anybody run into this before and if so, any suggestions?

Thanks,
RIchStart Free Trial
[+][-]06.29.2005 at 06:47AM PDT, ID: 14328415

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.29.2005 at 06:55AM PDT, ID: 14328503

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06.29.2005 at 07:04AM PDT, ID: 14328600

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.29.2005 at 09:28AM PDT, ID: 14330326

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06.29.2005 at 09:30AM PDT, ID: 14330347

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06.29.2005 at 10:18AM PDT, ID: 14330802

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.30.2005 at 09:05AM PDT, ID: 14339676

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06.30.2005 at 09:43AM PDT, ID: 14340085

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10.06.2005 at 12:07PM PDT, ID: 15033379

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]03.17.2006 at 02:01PM PST, ID: 16220635

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]03.21.2006 at 02:54AM PST, ID: 16245646

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: PHP Scripting Language
Tags: ldap_bind, exit, php
Sign Up Now!
Solution Provided By: CetusMOD
Participating Experts: 3
Solution Grade: A
 
 
 
Loading Advertisement...
20080716-EE-VQP-32