breisig / phpLDAPadmin

phpLDAPadmin - Web based LDAP administration tool http://www.phpldapadmin.org
GNU General Public License v2.0
27 stars 33 forks source link

Not opening webpage #5

Open andrew-manger opened 5 years ago

andrew-manger commented 5 years ago

I followed the directions listed on: https://www.techrepublic.com/article/how-to-install-phpldapadmin-on-ubuntu-18-04/

I get the following when I go to the webpage at SERVER_IP:8080/phpldapadmin (I changed the apache2 listen port to 8080):

`<?php // $Header$

/**

You should secure your PLA by making the htdocs/ your docroot.

header('Location: htdocs/index.php'); die(); ?>`

What am I doing wrong?

andrew-manger commented 5 years ago

I found the htdocs directory and now when I browse there, this appears in my webpage in code

`<?php /**

/* /

/***


If you are seeing this in your browser,
PHP is not installed on your web server!!!

***/

/**

The index we will store our config in $_SESSION

define('APPCONFIG','plaConfig');

define('LIBDIR',sprintf('%s/',realpath('../lib/'))); ini_set('display_errors',1); error_reporting(E_ALL);

General functions needed to proceed.

ob_start(); if (! file_exists(LIBDIR.'functions.php')) { if (ob_get_level()) ob_end_clean(); die(sprintf("Fatal error: Required file '%sfunctions.php' does not exist.",LIBDIR)); }

if (! is_readable(LIBDIR.'functions.php')) { if (ob_get_level()) ob_end_clean(); die(sprintf("Cannot read the file '%sfunctions.php' its permissions may be too strict.",LIBDIR)); }

if (ob_get_level()) ob_end_clean();

Make sure this PHP install has pcre

if (! extension_loaded('pcre')) die('

Your install of PHP appears to be missing PCRE support.

Please install PCRE support before using phpLDAPadmin.
(Dont forget to restart your web server afterwards)

');

require LIBDIR.'functions.php';

Define the path to our configuration file.

if (defined('CONFDIR')) $app['config_file'] = CONFDIR.'config.php'; else $app['config_file'] = 'config.php';

Make sure this PHP install has session support

if (! extension_loaded('session')) error('

Your install of PHP appears to be missing php-session support.

Please install php-session support before using phpLDAPadmin.
(Dont forget to restart your web server afterwards)

','error',null,true);

Make sure this PHP install has gettext, we use it for language translation

if (! extension_loaded('gettext')) systemmessage(array( 'title'=>('Missing required extension'), 'body'=>'Your install of PHP appears to be missing GETTEXT support.

GETTEXT is used for language translation.

Please install GETTEXT support before using phpLDAPadmin.
(Dont forget to restart your web server afterwards)', 'type'=>'error'));

Make sure this PHP install has all our required extensions

if (! extension_loaded('ldap')) systemmessage(array( 'title'=>('Missing required extension'), 'body'=>'Your install of PHP appears to be missing LDAP support.

Please install LDAP support before using phpLDAPadmin.
(Dont forget to restart your web server afterwards)', 'type'=>'error'));

Make sure that we have php-xml loaded.

if (! function_exists('xml_parser_create')) systemmessage(array( 'title'=>('Missing required extension'), 'body'=>'Your install of PHP appears to be missing XML support.

Please install XML support before using phpLDAPadmin.
(Dont forget to restart your web server afterwards)', 'type'=>'error'));

/**

Configuration File check

if (! file_exists($app['configfile'])) { error(sprintf(('You need to configure %s. Edit the file "%s" to do so. An example config file is provided in "%s.example".'),app_name(),$app['config_file'],$app['config_file']),'error',null,true);

} elseif (! is_readable($app['config_file'])) { error(sprintf('Fatal error: Cannot read your configuration file "%s", its permissions may be too strict.',$app['config_file']),'error',null,true); }

If our config file fails the sanity check, then stop now.

if (! $config = check_config($app['config_file'])) { $www['page'] = new page(); $www['body'] = new block(); $www['page']->block_add('body',$www['body']); $www['page']->display(); exit;

} else { app_session_start(); $_SESSION[APPCONFIG] = $config; }

if ($uri = get_request('URI','GET')) header(sprintf('Location: cmd.php?%s',base64_decode($uri)));

if (! preg_match('/^([0-9]+.?)+/',app_version())) { systemmessage(array( 'title'=>('This is a development version of phpLDAPadmin'), 'body'=>'This is a development version of phpLDAPadmin! You should NOT use it in a production environment (although we dont think it should do any damage).', 'type'=>'info','special'=>true));

if (count($_SESSION[APPCONFIG]->untested()))
    system_message(array(
        'title'=>'Untested configuration paramaters',
        'body'=>sprintf('The following parameters have not been tested. If you have configured these parameters, and they are working as expected, please let the developers know, so that they can be removed from this message.<br/><small>%s</small>',implode(', ',$_SESSION[APPCONFIG]->untested())),
        'type'=>'info','special'=>true));

$server = $_SESSION[APPCONFIG]->getServer(get_request('server_id','REQUEST'));
if (count($server->untested()))
    system_message(array(
        'title'=>'Untested server configuration paramaters',
        'body'=>sprintf('The following parameters have not been tested. If you have configured these parameters, and they are working as expected, please let the developers know, so that they can be removed from this message.<br/><small>%s</small>',implode(', ',$server->untested())),
        'type'=>'info','special'=>true));

}

include './cmd.php'; ?>`