Dokuwiki with LDAP (Version3) on a Synology NAS - php

I'm trying to setup Dokuwiki with LDAP (Version3) on a Synology NAS.
DokuWiki version is Release 2014-09-29b "Hrun"
Synology version is DSM 5.1-5004 Update 2
Authentication settings
authtype: authldap
Plugin Authldap (bundled plugin) settings
$conf['title'] = '.... wiki';
$conf['license'] = '0';
$conf['useacl'] = 1;
$conf['authtype'] = 'authldap';
$conf['superuser'] = '#wiki_admin';
$conf['plugin']['authldap']['server'] = 'ldap://example.com:389';
$conf['plugin']['authldap']['usertree'] = 'cn=users,dc=example,dc=com';
$conf['plugin']['authldap']['grouptree'] = 'cn=groups,dc=example,dc=com';
$conf['plugin']['authldap']['userfilter'] = '(&(uid=%{user})(objectClass=posixAccount))';
$conf['plugin']['authldap']['groupfilter'] = '(&(objectClass=posixGroup)(|(gidNumber=%{gid}) (memberUID=%{user})))';
$conf['plugin']['authldap']['version'] = 3;
$conf['plugin']['authldap']['debug'] = 1;
local.php copied to local.protected.php
I'm always getting following error messages
LDAP err: PHP LDAP extension not found. [auth.php:34]
User authentication is temporarily unavailable. If this situation persists, please inform your Wiki Admin.
althougt according to [Dokuwiki with LDAP error: User authentication is temporarily unavailable
the plugin seems to be installed (bundled) and enabled.
I cannot find any authldap.php in the whole wiki directory.
The \php folder as mentioned in the answer to the above link is not in the DokuWiki tree.
I installed it on a second NAS with no DokuWiki project contents with the same results.
What's going wrong here?

PHP LDAP extension not found Your PHP installation is missing the needed LDAP extension. That is completely unrelated to DokuWiki.
The LDAP-Extension is often distributed in a different package (eg. php5-ldap) or it might already be installed but needs to be enabled in your php.ini.
This post suggests it can simply enabled in your NAS configuration interface.

Related

PhalconPHP Database transactions fail on server

I have developed a website using PhalconPHP. the website works perfectly fine on my local computer with the following specifications:
PHP Version 7.0.22
Apache/2.4.18
PhalconPHP 3.3.1
and also on my previous Server (with DirectAdmin):
PHP Version 5.6.26
Apache 2
PhalconPHP 3.0.1
But recently I have migrated to a new VPS. with cPanel:
CENTOS 7.4 vmware [server]
cPanel v68.0.30
PHP Version 5.6.34 (multiple versions available, this one selected by myself)
PhalconPHP 3.2.2
On the new VPS my website always gives me Error 500.
in my Apache Error logs file: [cgi:error] End of script output before headers: ea-php70, referer: http://mywebsitedomain.net
What I suspect is the new database System. the new one is not mySql. it is MariaDB 10.1. I tried to downgrade to MySQL 5.6 but the WHM says there is no way I could downgrade to lower versions.
this is my config file:
[database]
adapter = Mysql
host = localhost
username = root
password = XXXXXXXXXXXX
dbname = XXXXXXXXXXXX
charset = utf8
and my Services.php:
protected function initDb()
{
$config = $this->get('config')->get('database')->toArray();
$dbClass = 'Phalcon\Db\Adapter\Pdo\\' . $config['adapter'];
unset($config['adapter']);
return new $dbClass($config);
}
And in my controllers...
for example this code throws Error 500:
$this->view->files = Patients::query()->orderBy("id ASC")->execute();
but changing id to fname fixes the problem:
$this->view->files = Patients::query()->orderBy("fname ASC")->execute();
or even the following code throws error 500:
$user = Users::findFirst(array(
"conditions" => "id = :id:",
"bind" => array("id" => $this->session->get("userID"))
));
is there a problem with the compatibility of PhalconPHP and MariaDB?
MariaDB was built to be mostly compatible with MySQL clients, it's unlikely to be the reason for your problems. If you're still concerned, you can switch from MariaDB to MySQL (and vice versa) by dumping (exporting) your tables, switching over, and importing them again.
More likely, the error line you're showing indicates that your new server is actually running PHP7 (ea-php70) and not PHP5.6 as you thought you selected.
The error End of script output before headers means the CGI script (in this case PHP7 itself) did not produce any HTTP headers before terminating. I suspect that your version of PhalconPHP is incompatible with PHP7 and therefore just crashes immediately.
If cPanel doesn't let you properly configure your infrastructure you likely have no other option but to drop it and set up your stack manually. But since you probably paid for cPanel, you could try opening a support ticket with them first: https://cpanel.com/support/
Most probably old phalconPHP version it does not support latest php 7.x version i guess. as i remember I have read similiar problem in another blog question.

Trouble with Parsoid and Visual Editor for Mediawiki

Mediawiki Version 1.27
Visual Editor Version 1.27
Parsoid Version latest in repository
So I have several web servers running on an Ubuntu VM. The hostname is "atocha". I have Apache running on port 8000. Under this I have a Mediawiki instance. The mediawiki instance is not private.
I installed Parsoid and it is running on port 8142.
I can access my mediawiki instance by going do "http://atocha:8000/mediawiki/index.php"
I can curl the Mediawiki api just fine. "http://atocha:8000/mediawiki/api.php"
However when I try to edit the pages using Visual Editor I receive the following error "Error loading from server: 404: docserver-http: HTTP 404. Would you like to retry?" that pops up in a display. No error is thrown in Apache.
Here is my parsoid local settings.js file
'use strict';
exports.setup = function(parsoidConfig) {
parsoidConfig.setMwApi({
uri: 'http://atocha:8000/mediawiki/api.php',
domain: 'atocha',
prefix: 'atocha'
});
parsoidConfig.useSelser = true;
};
Here is the pertinent LocalSettings.php section:
wfLoadExtension( 'VisualEditor');
// Enable by default for everybody
$wgDefaultUserOptions['visualeditor-enable'] = 1;
// Don't allow users to disable it
$wgHiddenPrefs[] = 'visualeditor-enable';
$wgVirtualRestConfig['modules']['parsoid'] = array(
// URL to the Parsoid instance
// Use port 8142 if you use the Debian package
'url' => 'http://127.0.0.1:8142'
);
If I try to use parsoid like this in a browser:
http://atocha:8142/localhost/v3/page/Javadoc_Basics
I get this error:
Did not find page revisions for V3/page/Javadoc_Basics
If I try parsoid like this however:
http://atocha:8142/localhost:8000/v3/page/Javadoc_Basics
I get this:
Cannot GET /atocha:8000/v3/page/Javadoc_Basics
Anyone have an idea about what's going on? Thanks in advance.
After much failure I was able to get parsoid and visual editor working.
Here is how I did it:
https://www.mediawiki.org/wiki/Parsoid/Developer_Setup
Follow Option 2 for developer setup.
Run the tests
Change the config.yaml file for mediawiki settings and changed port number
Create UpStart job
Enjoy

Mediawiki CSS not loading on hosted server (IIS)

I am trying to get mediawiki hosted via intranet on WindowsServer2012r2. I have installed mediawiki, php7, and mysql 5.x via Web platform installer. Once all were installed and setup I was able to connect both locally and via networked computers to mediawiki. I noticed however that the CSS for mediaWiki was not being executed. I have gone through the steps provided # Styles not displaying and Manual:Errors and symptoms but could not resolve the issue. The browser console shows the below issue.
Running load.php in the browser returns this error:
checkUrlExtension() ) { return; } // Respond to resource loading request. // foo()->bar() syntax is not supported in PHP4, and this file needs to *parse* in PHP4. $configFactory = ConfigFactory::getDefaultInstance(); $resourceLoader = new ResourceLoader( $configFactory->makeConfig( 'main' ), LoggerFactory::getInstance( 'resourceloader' ) ); $resourceLoader->respond( new ResourceLoaderContext( $resourceLoader, $wgRequest ) ); Profiler::instance()->setTemplated( true ); $mediawiki = new MediaWiki(); $mediawiki->doPostOutputShutdown( 'fast' );
Just to confirm: I updated the .htaccess file in the mywiki/img folder. Any help greatly appreciated.

Could not connect to the database. Connector returned number: Database sqlsrv_connect failed

I am unable to connect Joomla to MSSQL
I keep getting
Could not connect to the database. Connector returned number: Database
sqlsrv_connect failed
Whether I use the MySQLi driver or the drivers I installed (Microsoft SQL Server)
Seems like driver installation issue ,
I am able to connect to the same box with Mssql Client fine...
Can someone post an explanation on how to install MSSQL drivers for Joomla on PHP from scratch?
Or send an up to date reference on how to do this?
Joomla 3.4
PHP 5.6
IIS 7.5
MSSQL 2008 R2
If I switch the driver to: php_sqlsrv_54_ts.dll - it will disperser from the "database type" in joomla installer..
Thank you
The joomla error that is displayed is misleading and not quite useful.
So first step would be to modify the joomla code to find out the exact error.
Modify the following code in connect() function in your application's root directory
libraries\joomla\database\driver\sqlsrv.php
From
// Attempt to connect to the server.
if (!($this->connection = # sqlsrv_connect($this->options['host'], $config)))
{
throw new RuntimeException('Database sqlsrv_connect failed');
}
To
// Attempt to connect to the server.
if (!($this->connection = # sqlsrv_connect($this->options['host'], $config)))
{
throw new RuntimeException("Database sqlsrv_connect failed - Error : ".print_r( sqlsrv_errors(), true));
}
This will give you the exact error and guide you with the next steps needed.
Another thing to consider during SQL server installation is to enable the SQL server authentication as Joomla uses SQL server authentication by default.
You can confirm that Joomla uses SQL server authentication by checking in the same function in the same file as mentioned above
$config = array(
'Database' => $this->options['database'],
'uid' => $this->options['user'],
'pwd' => $this->options['password'],
'CharacterSet' => 'UTF-8',
'ReturnDatesAsStrings' => true);
Here is the PHP manual that confirms the same.
http://php.net/manual/en/function.sqlsrv-connect.php
You can enable SQL server authentication either during installation or post installation from the manamgement studio.
Hope this helps.
Download SQLServer 2008 Express, SQLServer 2008 Standard/Enterprise
editions (R2 or later)
Download PHP Drivers
Download SQLSRV20.EXE to a temporary directory
Run SQLSRV20.EXE
When prompted, enter the path to the PHP extensions directory
If you are using some sort of LAMP stack like XAMPP
Copy php_sqlsrv_52_ts_vc6.dll to php/ext folder
Make an entry in php.ini as follows
Extension=php_sqlsrv_52_ts_vc6.dll
Note:
If you need PDO or vc9 versions - please copy the "ts" version
appropriate for your needs.
If you are using IIS with PHP engine installed via FAST-CGI - please
make the appropriate changes in c:\Program Files\php\php.ini and
copy the dll to c:\Program Files\php\ext folder
Now - You can install Joomla 2.5 by selecting the SQLServer 2008 from the dropdown list in the step 4 of the installation.
After installation is complete - continue navigation around the administrator/site

Php - Ingres, fresh install : How to debug?

I just finished to install Ingres on my server(only the client part, to connect to an existing ingres server), I just added the php_ingres module.
Now php recognize my module, so I tried to connect my self to several existing servers, but I always a
Unable to connect to database (Hostname here)
But with this I can't find what is wrong?? ingres error? Php driver? Credentials? ...?
What can I do to isolate these problem?
Most likely it's a user credentials issue. To see the actual error message use the following code:
$connection = ingres_connect(.....);
if (!is_resource($connection))
{
trigger_error(ingres_errno()." - ". ingres_error(),E_USER_ERROR);
}
You might also want to take a look at http://community.ingres.com/wiki/Ingres_with_Apache_on_Debian_Etch which outlines the setup steps for Ingres, PHP, Apache and Debian/Ubuntu.

Categories