简体   繁体   中英

how to install Moodle with Postgre

i am installing Moodle 2.1 with postgre database. the problem i am facing is that it gives me error

PHP has not been properly configured with the PGSQL extension so that it can communicate with PostgreSQL. Please check your php.ini file or recompile PHP.

i have adjusted all the required extension for pgsql. but still i get the same error. i have even created a database in postgre (an empty database) but still i didnt work.

please help me

thanks

Have you tried (command line):

apt-get install php5-pgsql
apache2ctl restart

Or:

sudo apt-get install php5-pgsql
sudo apache2ctl restart

I had a lot of trouble, because the version of Moodle I have (3.3) wants a newer version of php than I have on my Ubuntu 14.04. I had 5.5.9 and Moodle insisted on 5.6. So I upgraded php5 to php5.6 with a special ppa. But what happened was it put the new php5.6 next to the old one. So I kept having trouble with Apache, until I set soft links to libphp5.so from my new libphp5.6.so, and set the conf and load files in mods-available to the new php5.6 versions.

Then I had a problem with the postgresql php driver. I tried installing php5-pgsql and it was always linking back to the old php 5.5.9 on Ubuntu. This did not make moodle happy. Then I discovered that there is a php5.6-pgsql. I uninstalled my php5-pgsql and installed php5.6-pgsql. Uff. And added these two lines to php:ini (inside the /etc/php5/apache2 directory):

extension=/usr/lib/php/20131226/pdo_pgsql.so extension=/usr/lib/php/20131226/pgsql.so

Now moodle can move on to the next error (the php xml extension)!

sudo apt-get install php5-pgsql fixed it for me despite the fact that my vhost on Plesk runs PHP7.0. Now I can use the CLI in Moodle with PostgreSQL.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM