Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7085167
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T07:23:29+00:00 2026-05-28T07:23:29+00:00

I have a very simple php ldap script that is only failing when running

  • 0

I have a very simple php ldap script that is only failing when running with Zend and Apache. When I run this script from the command line, it passes. Running strace, I can see where the behavior changes, but I cannot tell why. I have confirmed that the same ldap.conf is being read and the same ldap.so is being loaded.

I believe this is because of a certificate problem, but my settings are supposed to ignore certificate issues.

Version Information (these appear to be identical between running from php and apache):

OpenSSL:   0.9.8o 01 Jun 2010
OpenLdap:  $Id: ldap.c 313665 2011-07-25 11:42:53Z felipe $
Zend:      5.5
PHP:       5.3.8


<?php
      ldap_set_option(NULL, LDAP_OPT_DEBUG_LEVEL, 7);
      putenv('LDAPTLS_REQCERT=never');
      $ds = ldap_connect("ldaps://myserver.com:636");
      $db = ldap_bind($ds, 'user', 'pass');
?>

In my ldap.conf, I have only “TLS_REQCERT never”. I realize that this is duplicated above.

When running under apache, I get the following trace from ldap:

ldap_create 
ldap_url_parse_ext(ldaps://myserver.com:636)
ldap_bind_s 
ldap_simple_bind_s 
ldap_sasl_bind_s 
ldap_sasl_bind
ldap_send_initial_request 
ldap_new_connection 1 1 0
ldap_int_open_connection 
ldap_connect_to_host: TCP myserver.com:636 
ldap_new_socket: 20 
ldap_prepare_socket: 20
ldap_connect_to_host: Trying <myip>:636 
ldap_pvt_connect: fd: 20 tm: -1 async: 0 
TLS trace: SSL_connect:before/connect initialization
TLS trace: SSL_connect:SSLv2/v3 write client hello A 
TLS trace: SSL_connect:SSLv3 read server hello A 
TLS certificate verification: depth: 0, err: 20, subject: /CN=mycn.com,
    issuer: /CN=Collaboration Services CA 
TLS certificate verification: Error, unable to get local issuer certificate 
TLS trace: SSL_connect:SSLv3 read server certificate A 
TLS trace: SSL_connect:SSLv3 read server certificate request A 
TLS trace: SSL_connect:SSLv3 read server done A 
TLS trace: SSL_connect:SSLv3 write client certificate A 
TLS trace: SSL_connect:SSLv3 write client key exchange A 
TLS trace: SSL_connect:error in SSLv3 write finished A
TLS trace: SSL_connect:error in SSLv3 write finished A 
TLS: can't connect: error:140D308A:SSL routines:TLS1_SETUP_KEY_BLOCK:cipher or hash unavailable. 
ldap_err2string

When running the same script using the same php executable on the command line I get:

ldap_create
ldap_url_parse_ext(ldaps://myserver.com:636)
ldap_bind_s
ldap_simple_bind_s
ldap_sasl_bind_s
ldap_sasl_bind
ldap_send_initial_request
ldap_new_connection 1 1 0
ldap_int_open_connection
ldap_connect_to_host: TCP myserver.com:636
ldap_new_socket: 4
ldap_prepare_socket: 4
ldap_connect_to_host: Trying <my ip>:636
ldap_pvt_connect: fd: 4 tm: -1 async: 0
TLS trace: SSL_connect:before/connect initialization
TLS trace: SSL_connect:SSLv2/v3 write client hello A
TLS trace: SSL_connect:SSLv3 read server hello A
TLS certificate verification: depth: 0, err: 20, subject: /CN=myserver.com, issuer: /CN=Collaboration Services CA
TLS certificate verification: Error, unable to get local issuer certificate
TLS trace: SSL_connect:SSLv3 read server certificate A
TLS trace: SSL_connect:SSLv3 read server certificate request A
TLS trace: SSL_connect:SSLv3 read server done A
TLS trace: SSL_connect:SSLv3 write client certificate A
TLS trace: SSL_connect:SSLv3 write client key exchange A
TLS trace: SSL_connect:SSLv3 write change cipher spec A
TLS trace: SSL_connect:SSLv3 write finished A
TLS trace: SSL_connect:SSLv3 flush data
TLS trace: SSL_connect:SSLv3 read finished A
ldap_open_defconn: successful
ldap_send_server_request
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T07:23:29+00:00Added an answer on May 28, 2026 at 7:23 am

    I finally fixed this when inspecting results from running strace showed that it did not have permission to open my ldap.conf file. Opening permissions fixed the issue. However, the file is not supposed to be needed since it only had the same setting from the environment variable:

    putenv(‘LDAPTLS_REQCERT=never’);

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a very simple INSERT statement being executed from a PHP script running
i have this very simple php script: <?php require 'functions.php'; $token = some-number; $id
I have a very simple script that pulls data from a mysql db, However
I have very simple form that gets values in JSON format from searchAlbum.php .
I have this very simple script that allows the user to specify the url
I have written a very very very simple!! script in php. header redirection not
I have very simple select like this: SELECT * FROM table WHERE column1 IN
I have a very simple bit of script that changes the status of an
I have a very simple file upload PHP script. I am testing with a
I've came across on this problem, I have a sever running apache and php.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.