Upgrading PHP issue

Upgrading PHP issue

by Giannis Theodoulou -
Number of replies: 11

Hello,

i currently have Moodle version 3.0, i am trying to prepare for the 3.4 upgrade, so first things first i am trying to upgrade php, i replaced the files, configured php.ini file to meet the necessary requirements, created all the mappings in IIS, i have also created a testphp file that returns phpinfo() correctly, my issue is that it gives me a database connection failed, however when i return to the previous version of PHP everything is working properly.

Please help me 

Average of ratings: -
In reply to Giannis Theodoulou

Re: Upgrading PHP issue

by Nilesh Pathade -

 

In reply to Nilesh Pathade

Re: Upgrading PHP issue

by Giannis Theodoulou -


2. SQL server 2008 r2 

3. i checked all the connection parameters in config.php and they must be correct because when i rename the PHP folder and leave the old one everything is connecting fine

4. i will follow the steps mentioned there but only when i upgrade PHP so it will be ready for the 3.4 upgrade

In reply to Giannis Theodoulou

Re: Upgrading PHP issue

by Luis de Vasconcelos -

Which PHP driver are you using to connect to your SQL Server 2008 R2 instance? FreeTDS or the Microsoft driver?

Look at the output of PHPInfo(). If you're using FreeTDS it should contain a section called MSSQL. If you're using the Microsoft driver there will be a section called SQLSRV. If PHPInfo() doesn't show either of those drivers then your PHP hasn't been setup correctly for it to integrate with MS SQL Server. You'll need to fix that...

SQLSRV is probably the better option these days. You need to add the php_sqlsrv.dll file to your PHP \ext folder and then add the extension to your php.ini file, like;

[sqlsrv]
extension=php_sqlsrv.dll

The SQLSRV driver requires the Microsoft SQL Server 2008 R2 Native Client, so you'll need to install that too before PHP can load the SQLSRV driver.

See:

https://docs.moodle.org/34/en/Installing_MSSQL_for_PHP

https://www.microsoft.com/en-us/download/details.aspx?id=55642

Lastly, turn the Moodle Debugging option in http://yoursite/admin/settings.php?section=debugging up to Developer before you attempt the upgrade on your test server. Or do it in the Moodle config.php file, example:

$CFG->debug = 38911; // DEBUG_DEVELOPER
$CFG->debugdisplay = true;

That may help catching the problem with your Moodle and/or PHP setup.

In reply to Luis de Vasconcelos

Re: Upgrading PHP issue

by Giannis Theodoulou -

yes debug mode indeed told me what was the problem and it seems native client was missing, thank you so much though now i get a different error:


 


In reply to Giannis Theodoulou

Re: Upgrading PHP issue

by Emma Richardson -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers

Did you install all the necessary components - php7.0-mysql, for example?

In reply to Emma Richardson

Re: Upgrading PHP issue

by Giannis Theodoulou -

you mean the drivers? yes and added them into the php.ini file as well, but i am suspicious that they might cause the problem 

In reply to Giannis Theodoulou

Re: Upgrading PHP issue

by Giannis Theodoulou -

debug mode indeed told me what was the problem and it seems native client was missing, thank you so much though now i get a different error:


 


In reply to Giannis Theodoulou

Re: Upgrading PHP issue

by Giannis Theodoulou -

never mind i fixed everything, uninstalled the unsupported plugin and everything is working fine now