LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 06-02-2014, 06:00 PM   #1
project722
Member
 
Registered: Jun 2009
Posts: 53

Rep: Reputation: 0
phpldapadmin on Ubuntu 14.04 wirh OpenLDAP


I pulled down phpldapadmin which gets v1.2.2.5. I got errors upon installation end saying:

Errors were encountered while processing:
phpldapadmin
E: Sub-process /usr/bin/dpkg returned an error code (1)

It did not seem to be a fatal error so I proceeded to make all the changes as per the instructions here:

https://www.digitalocean.com/communi...untu-12-04-vps

However when I put in ldap.example.com/phpldapadmin in firefox I get 404not found. So I though it was probably related to the install errors. I traced the errors back and according to Launchpad its a bug. So I then proceed to remove that version of phpldapadmin in favor of v1.2.3. I followed the install instructions to the T and I still get a 404 not found when I put the url/phpldapadmin in firefox.

My apache2 service is running. The "INSATLL" files says to just dump the whole phpldapadmin directory in the webroot, so I stuck it in /var/www. But no luck. I do have a /etc/php5/apache2 directory. Should I try placing it in there?
 
Old 06-02-2014, 06:07 PM   #2
project722
Member
 
Registered: Jun 2009
Posts: 53

Original Poster
Rep: Reputation: 0
Moving to /etc/php5/apache2 did not work.
 
Old 06-03-2014, 06:08 AM   #3
project722
Member
 
Registered: Jun 2009
Posts: 53

Original Poster
Rep: Reputation: 0
I was looking over the pre-reqs here:

http://phpldapadmin.sourceforge.net/.../PreRequisites

How do I check to see if my version of PHP5 supports LDAP?
 
Old 06-03-2014, 10:00 AM   #4
potato_farmer
Member
 
Registered: May 2014
Posts: 55

Rep: Reputation: Disabled
Your first issue is that your browser cannot access phpldapadmin. What is your web root? Is it /var/www? Or is it /var/www/html? Check the apache config for "DocumentRoot" and place the phpldapadmin directory there. Then accessing using a browser (it is case sensitive).
 
Old 06-03-2014, 03:33 PM   #5
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 12,827

Rep: Reputation: 1866Reputation: 1866Reputation: 1866Reputation: 1866Reputation: 1866Reputation: 1866Reputation: 1866Reputation: 1866Reputation: 1866Reputation: 1866Reputation: 1866
Quote:
How do I check to see if my version of PHP5 supports LDAP?
Run
Code:
php -i|grep -i ldap
Cheers
 
Old 06-04-2014, 06:20 AM   #6
project722
Member
 
Registered: Jun 2009
Posts: 53

Original Poster
Rep: Reputation: 0
Quote:
potato_farmer Your first issue is that your browser cannot access phpldapadmin. What is your web root? Is it /var/www? Or is it /var/www/html? Check the apache config for "DocumentRoot" and place the phpldapadmin directory there. Then accessing using a browser (it is case sensitive).
I don't have "DocumentRoot" anywhere in the apache config file. I see a "serverroot". And I'm not sure of the webroot. I have /var/www and inside that I have an HTML folder. Currently I have the phpldapadmin folder indside /var/www/html and now when I browse I get a different error but it would appear that this may be some sort of progress.

error is:

Fatal Error: Cannot redeclare password hash() in /var/www/html/phpldapadmin/lib/functions.php on line 2236.

So it seems that now it's at least finding the site.

Any other suggestions?

Quote:
bathory Quote:
How do I check to see if my version of PHP5 supports LDAP?

Run

Code:
php -i|grep -i ldap
I get nothing - no output, no errors. Just returns back to a prompt. What does that mean?
 
Old 06-04-2014, 07:03 AM   #7
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 12,827

Rep: Reputation: 1866Reputation: 1866Reputation: 1866Reputation: 1866Reputation: 1866Reputation: 1866Reputation: 1866Reputation: 1866Reputation: 1866Reputation: 1866Reputation: 1866
Quote:
I get nothing - no output, no errors. Just returns back to a prompt. What does that mean?
It means that your php installation does not have support for ldap Use your distro's package manager to install the php-ldap package

Regards
 
Old 06-04-2014, 07:33 AM   #8
project722
Member
 
Registered: Jun 2009
Posts: 53

Original Poster
Rep: Reputation: 0
Quote:
Use your distro's package manager to install the php-ldap package
Ran apt-get install php5-ldap. See the attachment for the output I received. So I guess the message about it being set to manually installed means I have to enable it somewhere?
Attached Thumbnails
Click image for larger version

Name:	Capture.PNG
Views:	147
Size:	122.1 KB
ID:	15669  
 
Old 06-04-2014, 08:22 AM   #9
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 12,827

Rep: Reputation: 1866Reputation: 1866Reputation: 1866Reputation: 1866Reputation: 1866Reputation: 1866Reputation: 1866Reputation: 1866Reputation: 1866Reputation: 1866Reputation: 1866
Quote:
Originally Posted by project722 View Post
Ran apt-get install php5-ldap. See the attachment for the output I received. So I guess the message about it being set to manually installed means I have to enable it somewhere?
So php5-ldap is installed. It should be shown by "php -i".
anyway, I'm not familiar with ubuntu, but from this, looks like you might need to add
Code:
extension=ldap.so
in /etc/php5/apache2/php.ini
 
Old 06-04-2014, 10:19 AM   #10
project722
Member
 
Registered: Jun 2009
Posts: 53

Original Poster
Rep: Reputation: 0
Quote:
So php5-ldap is installed. It should be shown by "php -i".
anyway, I'm not familiar with ubuntu, but from this, looks like you might need to add

Code:
extension=ldap.soin /etc/php5/apache2/php.ini
Added, restarted apache, no luck. phpldapadmin gets same error and checking for php-ldap returns nothing.

I did notice that I have 2 apache2 folders -

/etc/apache2

and

/etc/apache2/php5/apache2

The second contains the php.ini and a conf.d folder.

Should I merge my 2 apache2 folders and drop it in /etc/php5 or is /etc/apache2 correct for my version?
 
Old 06-04-2014, 11:31 AM   #11
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 12,827

Rep: Reputation: 1866Reputation: 1866Reputation: 1866Reputation: 1866Reputation: 1866Reputation: 1866Reputation: 1866Reputation: 1866Reputation: 1866Reputation: 1866Reputation: 1866
Quote:
I did notice that I have 2 apache2 folders -

/etc/apache2

and

/etc/apache2/php5/apache2
D'oh there should be no /etc/apache2/php5/apache2 directory, but a /etc/apache2 for apache configuration and /etc/php5/apache2 for php-apache related configuration. Perhaps you misspelled in the 2nd directory path.
How did you install apache/php? Maybe you should uninstall/reinstall the apache-php stack
 
Old 06-04-2014, 02:35 PM   #12
project722
Member
 
Registered: Jun 2009
Posts: 53

Original Poster
Rep: Reputation: 0
Quote:
D'oh there should be no /etc/apache2/php5/apache2 directory, but a /etc/apache2 for apache configuration and /etc/php5/apache2 for php-apache related configuration. Perhaps you misspelled in the 2nd directory path.
How did you install apache/php? Maybe you should uninstall/reinstall the apache-php stack
Ok - removed apache and php5 - reinstalled - now running the php command I do show that LDAP is enabled. See attachement. I also have the correct folder structure...BUT..I still get that same error about password hash in the functions.php file when I try to browse to localhost/phpldapadmin
Attached Thumbnails
Click image for larger version

Name:	ldap.PNG
Views:	81
Size:	2.5 KB
ID:	15671  
 
Old 06-05-2014, 01:52 AM   #13
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 12,827

Rep: Reputation: 1866Reputation: 1866Reputation: 1866Reputation: 1866Reputation: 1866Reputation: 1866Reputation: 1866Reputation: 1866Reputation: 1866Reputation: 1866Reputation: 1866
Quote:
Originally Posted by project722 View Post
Ok - removed apache and php5 - reinstalled - now running the php command I do show that LDAP is enabled. See attachement. I also have the correct folder structure...BUT..I still get that same error about password hash in the functions.php file when I try to browse to localhost/phpldapadmin
Doing a little search, looks like an incompatibility between phpldapadmin and the newer php-5.5x. Take a look here and here for workarounds

Regards
 
Old 06-05-2014, 02:00 AM   #14
project722
Member
 
Registered: Jun 2009
Posts: 53

Original Poster
Rep: Reputation: 0
Thanks - I'll check'um out and post back here.
 
Old 06-06-2014, 06:43 AM   #15
project722
Member
 
Registered: Jun 2009
Posts: 53

Original Poster
Rep: Reputation: 0
The saga continues I followed the instructions in the first link and viola it worked. Then I went further to try and eliminate the pre_replace errors but botched that up now I'm back to square one. Going to restore the functions.php file from backup and go from there. Will keep you posted. BTW, When it worked I could only log in anonymously, which gave me only read access. I tried at first to log in with the following DN and my LDAP password:

dn=admin,dc=ldap,dc=example,dc=com (this was auto-populated)

However this did not work. I am not sure if I need to change the DN or if I was using the wrong password. I don't remember setting a password for dn=admin, unless that was the slapd "administrator" password you setup from the start.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem wirh mailx drazenmd Linux - Newbie 1 12-27-2011 04:45 AM
problem wirh qmail server dellxmax Linux - Server 1 11-14-2009 04:22 PM
OpenLDAP and phpldapadmin on Ubuntu 9.04 rohit06061988 Linux - Server 2 07-25-2009 08:13 AM
Problem wirh baghira aerlinn Linux - Software 2 05-13-2005 11:27 PM
Problems wirh compile - GTK falcon56215 Linux - Software 3 11-07-2003 04:10 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 01:16 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration