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.
Related
I have an Ubuntu 16.04.6 machine and need the SOAP extension enabled for PHP 7.4, but right now it's only installed for 7.0 The extension itself is present in path /usr/lib/php/20151012/soap.so
I've used apt-get remove php-soap and the apt-get install php-soap but it does not get installed anywhere except the 7.0 folder. I have noticed in the 7.0 folder there are certain files and symlinks, which I have duplicated into the 7.4 folder structure. /etc/php/7.4/mods-available now contains soap.ini and a symlink to it named 20-soap.ini was placed in folder /etc/php/7.4/fpm/conf.d This is in keeping with all the other extensions, which were all installed almost exactly a year ago when I upgraded PHP.
In the php.ini file I have uncommented extension=soap.so and I have tried changing that line to extension=/usr/lib/php/20151012/soap.so
service php7.4-fpm restart
service nginx restart
All this to no avail. Can someone slap me upside the head and tell me what I'm missing? Should I try deleting previous PHP versions, then reinstalling the soap extension? I've seen threads mentioning specific packages for 7.4 such as php7.4-soap but this is not found in my repositories.
Any help is appreciated!
Try this command apt install php7.4-soap
sudo add-apt-repository ppa:jczaplicki/xenial-php74-temp
sudo apt-get update
sudo apt install php7.4-soap
This is adding an external PPA repository to your system. If you do not trust the maintainer you should not do this, since it possibly exposes your system. Also note that this might work for installing php, but there will not be a guarantee that you recvive updates through it (The word "temp" in the repository name indicates that this is only temporary). I would rather recommend compiling it yourself if you really need to have it installed on 16.04.
Also this will install you php version 7.4.13 , you may have to remove the already installed php 7.4 , and reinstall after you add this ppa
I am running an Ubuntu 12.04 Apache2/PHP/MYSQL server that was using a deprecated version of PHP. I realized this once I tried to install the sqlite3 extension I get an error:
Failed to fetch http://ppa.launchpad.net/ondrej/php5-5.6/ubuntu/dists/precise/main/source/Sources
Research shows me that this is no longer used and instead use ondrej/php instead. This is a production server and I need to figure out steps to replace the PPA with the correct one.
Will I need to uninstall PHP and reinstall using the new packages? If so how should I go about doing this cleanly?
Is there a way to temporarily install sqlite3 without having to change repositories completely (I do not have php-dev installed at the moment either).
First you should check if there are any compatibility issues with the version you want to upgrade to (did a quick google to find this: https://github.com/squizlabs/PHP_CodeSniffer). Then, add the repository that contains the version you want, sudo apt-get update and install the version of php you want. To switch the version apache uses, do the following:
sudo a2dismod php5
sudo a2enmod php5.6
sudo service apache2 restart
Im currently running Php MongoDb version 1.2.10 and I'm wanting to update this version to the most recent/stable.
How would one go about doing this? Im assuming it would be via terminal and using pear or pecl command?
Any Help or advice is greatly appreciated :)
Update :
I did the following within terminal to install the latest version
sudo pecl install mongo
Which has installed version 1.5.6. But after restarting my MAMP server the extension is still stating 1.2.10. Is there something I need to change in my php.ini file? I have already added extension=mongo.so
If you ran sudo pecl install mongo, you likely upgraded the driver for the system install of PHP, which is in a different path than MAMP. There should be a pecl binary within the MAMP path (e.g. /Applications/MAMP/bin/php/php5.x.x/bin), which should be run instead. You may find this blog article as helpful walk-through for the process.
sudo pecl upgrade mongodb worked for me today.
I have a wamp server. I also have mongodb installed. I have installed the php_mongo extension, make changes in php.ini. I downloaded rockmongo, unzipped the file in my www folder. I edited the config file but when I try to open the GUI, it says:
"To make things right, you must install php_mongo module. Here for installation documents on PHP.net."
Need help. thanks
Hi I also had the same problem. I just solved it by following these steps.
Just install the mongodb Driver extension via sudo pecl install mongo
After installation check mongodb Driver is found or not via sudo pecl search mongo
If it is installed successfully following output will come
ubuntu#ip-***-3*-*-**:~$ sudo pecl search mongo
Retrieving data...0%
Matched packages, channel pecl.php.net:
=======================================
Package Stable/(Latest) Local
mongo 1.4.2 (stable) 1.4.2 MongoDB database driver
change php.ini located under /etc/php5/apache2
Add this line under Dynamic Extension of php.ini extension=mongo.so save the file
Now restart your server via sudo service apache2 restart
It will work
Quite old post, but for those who still find for a solution like me.
It's solved by:
- php_mongo-1.4.5-5.3-vc9.dll
- WampServer 2.2
- PHP 5.3.18
Windows 7, 64 bit.
PHP_Mongo here (https://s3.amazonaws.com/drivers.mongodb.org/php/php_mongo-1.4.5.zip)
I had PHP 5.2 with MongoDB installed on Debian Lenny x64 and everything was fine.
After updating PHP to 5.3 (dotdeb) I can't get MongoDB to work, I always get an error
Fatal error: Class 'Mongo' not found (...)
Everything else works fine, all default modules are working.
My php.ini:
extension_dir = "/usr/lib/php5/20090626"
extension=mongo.so
Mongo.so is in same location as written above.
But when I run php -m in console to check loaded modules, "mongo" isn't listed there.
I can't use dl('mongo.so') to load module at runtime, because this function was deprecated in PHP 5.3.
May be I should recompile mongo somehow, I just don't know how to do that because I'm not very good in *nix commands.
Thanks for your help!
UPDATE
Also may be it's worth saying that before my mongo.so was in /usr/lib/php5/20060613 and I manually copied it to "/usr/lib/php5/20090626" because it seems that after updating my PHP all modules are located there.
The extension module api has changed between php5.2 and php5.3. When php tries to load an extension module both sides have to "present" an api magic key that identifies the api version. If those numbers don't match the module is not loaded/activated.
Try sudo pecl install mongo again to get an extension module that fits your new php version.
Try re installing mongo & restart service
sudo pecl uninstall mongo
sudo pecl install mongo
sudo service apache2 restart
This will install mongo in to newer version
I spent a little time trying to fix this, I am guessing you had a previous mongo install. The way I fixed it was by:
I installed php5-dev:
sudo apt-get install php5-dev
cd /etc/php5/apache2/conf.d/
sudo rm -rf mongo.ini
I then viewed my php.ini and removed extension=mongo.so
Then:
sudo pecl uninstall mongo
sudo pecl install mongo
sudo service apache2 restart