Hello, I am getting the below error while installing Moodle on Ubuntu 16.04 and Database server on windows 2012, MSSQL 2014.
installing Moodle on Ubuntu 16.04 and Database server on win 2012 MSSQL 2014
Re: installing Moodle on Ubuntu 16.04 and Database server on win 2012 MSSQL 2014
Shiva, have you used correct driver for PHP of SQL server? as there are updated drivers for PHP 7.
Re: installing Moodle on Ubuntu 16.04 and Database server on win 2012 MSSQL 2014
Hi Usman
I did install the sql Driver for PHP 7 but it still unable to connect
Re: installing Moodle on Ubuntu 16.04 and Database server on win 2012 MSSQL 2014
It looks like it is still using php5 - you need to disable php5 and enable php7. Not sure how exactly on windows but I am sure you can google it.
Re: installing Moodle on Ubuntu 16.04 and Database server on win 2012 MSSQL 2014
HI Emma PHP7 is enabled
Re: installing Moodle on Ubuntu 16.04 and Database server on win 2012 MSSQL 2014
You have only proved that *command line* PHP 7 is enabled. This is nothing to do with PHP through the web server.
Re: installing Moodle on Ubuntu 16.04 and Database server on win 2012 MSSQL 2014
Have you installed php7.0-mysql?
Re: installing Moodle on Ubuntu 16.04 and Database server on win 2012 MSSQL 2014
Yes Emma PHP7 and mysql is installed and operational
Re: installing Moodle on Ubuntu 16.04 and Database server on win 2012 MSSQL 2014
Re: installing Moodle on Ubuntu 16.04 and Database server on win 2012 MSSQL 2014
Hi Usman
I have installed the ODBC, I Have also tried connecting to Do through php code but i still got this error:
" Fatal error: Uncaught Error: Call to undefined function sqlsrv_connect() in /var/www/html/test/test.php:9 Stack trace: #0 {main} thrown in /var/www/html/test/test.php on line 9"
this is my code:
<?php
$serverName = "HOST";
$connectionOptions = array(
"Database" => "test",
"Uid" => "USERNAME",
"PWD" => "PASSWORD"
);
//Establishes the connection
$conn = sqlsrv_connect($serverName, $connectionOptions);
if($conn)
echo "Connected!";
?>
Re: installing Moodle on Ubuntu 16.04 and Database server on win 2012 MSSQL 2014
what have you written in $CFG->dbhost in config.php file?
Re: installing Moodle on Ubuntu 16.04 and Database server on win 2012 MSSQL 2014
hi Usman I have managed to get it connected and installed successful, the problem was that my .pdo and .so extensions were not included in the apache2/php.ini file.
now while m trying to connect to the external DB:
Re: installing Moodle on Ubuntu 16.04 and Database server on win 2012 MSSQL 2014
What do you see in /etc/php? a 7.0 or 7.1 directory there?
Your screen shot shows there is no reference to the .so files for sqlsrv nor pdo_sqlsrv. ... that's the line 0 stuff. Those are normally just single lines in an .ini file named for the extension ... like pdo_sqlsrv.ini ... such as below.
In
/etc/php7/apache2/php.ini
is there a line for extension=sqlsrv.so
ditto for pdo_sqlsrv.soIf not, add the lines, restart apache, then check to see if the extensions are loaded:
php -m |grep sqlsrv
OR
phpinfo page dropped at document root should show you everything about php on your server.
Those .so files should be in /usr/lib/php/20151012/
'spirit of sharing', Ken
Re: installing Moodle on Ubuntu 16.04 and Database server on win 2012 MSSQL 2014
Thanks Ken
now m facing this new error
Re: installing Moodle on Ubuntu 16.04 and Database server on win 2012 MSSQL 2014
Am a linux guy ... dumped windows many many moons ago.
The error, however, is a DB error and not the typical Moodle error screen one sees (yellow background with rounded box surrounding the error) ... might be debugging? Are you now seeing a Moodle screen without logging on? How about googling for the SQL state error number and the Error code number?
And the error screen you see, does hint at config.php ... maybe the DB user (sa), DB pasword?
So check config.php ...
Find a test php script you can program to test connectivity as well.
Maybe one found below?
http://php.net/manual/en/function.sqlsrv-connect.php
Must confess, haven't seen many who use the combo of Ubuntu with MSSQL on db. While you have had a few 'regulars' in the forums here attempt to help, think you'll find there are few that run that combo ... this to say what help you get might really be guesses.
Heard rumor that Microsoft was building a mssql for Linux. As long as you are kinda on bleeding edge, why not get waaaaayyyyy out there! ;)
'spirit of sharing', Ken
Re: installing Moodle on Ubuntu 16.04 and Database server on win 2012 MSSQL 2014
awesome thanks Ken Managed to connect to the DB now all set just needed to create moodle DB and give sa account all ok now
However I want to put my enrollments through the external Database plugin now when I connect it through that is gives me this error:
Re: installing Moodle on Ubuntu 16.04 and Database server on win 2012 MSSQL 2014
php -m |grep mssql
Also check the phpinfo link under server in Moodle Admin interface for extensions that are loaded and to see if apache sees them also.
Also check apache error logs as well as DB logs.
Turn on debugging for more info then try setting up the enrolment again to see if Moodle will report more info. [now don't ask me how to fix ... roll up sleeves and learn to dig! ;)]
@Usman ... this one is beginning to get out of my area of 'experise' (whatever that means) ... when it comes to the Windows end things.
'spirit of sharing', Ken
Re: installing Moodle on Ubuntu 16.04 and Database server on win 2012 MSSQL 2014
Which external database is it? the same on SQL Server or some other.
@Ken, its not windows any more, now it's related to moodle for you've fixed the major issue
Re: installing Moodle on Ubuntu 16.04 and Database server on win 2012 MSSQL 2014
hi Usman,
this is a dif DB but on the same SQL server :/
Re: installing Moodle on Ubuntu 16.04 and Database server on win 2012 MSSQL 2014
Sorry I meant to say, is if you're importing users from a different DB.
Re: installing Moodle on Ubuntu 16.04 and Database server on win 2012 MSSQL 2014
I am using the user enrollment to course from external DB my users are linked from LDAP