# Define /phpldapadmin alias, this is the default
<IfModule mod_alias.c>
    Alias /phpldapadmin /usr/share/phpldapadmin/htdocs
</IfModule>

# You can also use phpLDAPadmin as a VirtualHost
# <VirtualHost *:*>
#     ServerName ldap.example.com
#     ServerAdmin root@example.com
#     DocumentRoot /usr/share/phpldapadmin
#     ErrorLog logs/ldap.example.com-error.log
#     CustomLog logs/ldap.example.com-access.log common
# </VirtualHost>

<Directory /usr/share/phpldapadmin/htdocs/>

    DirectoryIndex index.php
    Options +FollowSymLinks
    AllowOverride None

    # limit libapache2-mod-php to the necessary files and directories

    # PHP 7
    <IfModule mod_php7.c>
        php_admin_value open_basedir /tmp:/usr/share/phpldapadmin/:/usr/share/doc/phpldapadmin:/etc/phpldapadmin/
    </IfModule>

    # PHP 8+
    <IfModule mod_php.c>
        php_admin_value open_basedir /tmp:/usr/share/phpldapadmin/:/usr/share/doc/phpldapadmin:/etc/phpldapadmin/
    </IfModule>

</Directory>

