PHP LDAP Admin - 未定义的变量:_SESSION

I'm trying to install PHP LDAP Admin, http://phpldapadmin.sourceforge.net , on a RHEL 6 server. I have the files in place and Apache virtual host directive configured to htdocs.

The error I'm getting is:

Notice: Undefined variable: _SESSION in /path/to/pla/lib/page.php on line 381 Fatal error: 
Call to a member function getValue() on a non-object in /path/to/pla/lib/page.php on line 381

PHP (5.4.13) is running on the server, and sessions are not a problem elsewhere. I cloned my git repository to an OSX development box and it works there. I double checked and session_start() is called.

I had the same problem and finally i solved it just placing config.php in the correct folder (phpldapadmin/config)...really silly mistake

If httpd is running under apache group:

chgrp apache /etc/phpldapadmin/config.php

I had the same problem (ubuntu 14.04).

I changed the permissions on usr/share/phpldapadmin/config.php and that solved the problem.

This has already been answered by harveyzh but this answer is for linux-noobs like me :)

Happens in most cases after update and apache (or php5-fpm!) didn't run with default users.

Just add the user wich is running Apache2 (or php5-fpm!) to the system group "www-data" (debian) and restart services apache AND if used php5-fpm both.

Get the User apache is running as:

~# sed -rn 's/^User (.+)/\1/p' /etc/apache2/apache2.conf

Remember: Changing permissions to repo maintained files is a bad idea. This takes effect only until the next update fixes them back to default...

I had also same problem where we have just changed the group name for phpldapadmin config.php file. It worked for me.

chgrp apache /etc/phpldapadmin/config.php

Use chgrp GNU command with the group name of apache2 In my case was: www-data

So you need to do like that:

chgrp www-data /etc/phpldapadmin/config.php

to find group name of config.php you should use ls -l command line and take the fourth column