I have update my php 5.6 to php 7 and update mongodb driver also. but now my old code is not working on new environment.
please help
yes i have install in php7 mongodb using pecl.
then use https://github.com/alcaeus/mongo-php-adapter.
then use composer and change the code according to mongo-php-adapter library.
then its work.
enjoy :)
Related
I recently updated Postgres from version 9.3 to 9.6. After the update all of my commands (such as pg_dumpall) all point to version 9.3. I get the error of version mismatch.
I found that if I change my symlink in /usr/bin to point to 9.6 it seems to work. Is there a better way to point my commands to version 9.6? Thanks you for your help!
The best way to do it is using the package manager of your linux distro: it ensures all symlinks are changed to the newer version.
From your question it is possible to infer that the upgrade was done without using the package manager. I suggest to try to install Postgres with the package manager or give a little more information about your system so we can give you a more accurate answer.
we want to upgrade our php version and laravel to php v7 and laravel v5.4 from php v5.2 ,and laravel 4.2 .I already upgraded locally in windows 7 , Now I want to upgrade in production server (Linux Debian (wheezy ) , so anyone please guide me correct solution . i went through below links, and i am not able to understand which one is correct and i would follow , i am new to Linux OS , please anyone give me proper guidance and solution.
Thanks
Devidas Pawar
Well here's an odd situation I've found. I've been using PHP and MongoDB together on a project, and updated the associated software. After the upgrade, I did make sure to update the new conf files and all is well --- except when I try to use the MongoClient class, I get the following fatal error:
Fatal error: Uncaught Error: Class 'MongoClient' not found in /srv/http/test.php
So my first instinct was to check my /etc/php/php.ini to make sure that mongodb.so was correctly included. I found it after the other extension lines:
extension=mcrypt.so
extension=zip.so
extension=mongodb.so ; <--- here it is
With that checked, I loaded up a quick phpinfo() script to check that I was using the right php.ini file, and confirmed that I am. And not only that, the mongodb driver also appears to be loaded correctly!
Loaded Configuration File /etc/php/php.ini
. . .
mongodb support enabled
mongodb version 1.1.1
mongodb stability stable
libmongoc version 1.3.1-dev
libbson version 1.3.0
So I restarted httpd and tried again. No dice, still can't find the MongoClient class. So I tried to install it from pecl instead of my distribution's package manager, and the situation is the same as described above.
So here's a quick rundown of the situation:
Linux kernel 4.3.3
PHP Version 7.0.1
php-mongodb version 1.1.1
Yes, 1.1.1 supports php7.
Seems properly configured, and mongodb is enabled and shown in phpinfo().
Tried installing the mongodb driver through pecl and my distro's package manager.
Other info that may be useful:
MongoDB Version 3.2.0
mongod is running
Also tried rebooting, no change.
Well I found the answer.
The class has been changed. It's no longer \MongoClient, and is now \MongoDB\Driver\Manager
All that I need is a refactor. The new driver is designed to be a lower-level driver for high-level functionality to be filled with userspace libraries, so anyone else upgrading to php7, make sure you check that you'll be comfortable with the new driver, or that the userspace libraries exist when you do it. Hopefully this question/answer helps others in the future.
Commenter ianaz below has posted this good userspace library for MongoDB: http://mongodb.github.io/mongo-php-library/
I was trying to install jdk1.6 onto my Ubuntu 10.04.
However, It looks like jdk1.6 is no longer available in Ubuntu repository(at least, i havent found it yet).
In my case, I need to install jdk1.6 as my java version instead of openjdk.
Could anyone tell me if it still could be found in anywhere?
Thanks.
I suggest installing it manually. Use the following link and use update-alternatives. The instructions are for 1.7 but they work for 1.6. Just get it from sun's site.
https://askubuntu.com/questions/55848/how-do-i-install-oracle-java-jdk-7
You can download JDK from java.sun.com and install it yourself. The reason its not included because it needs you to accept their license agreement.
HTH.
I am running Ampps 4.9.3 on Mac, and I am trying to install Laravel 5.6, which has a dependency on PHP 7.1.3. The latest version of Ampps says it supports 7.1.8, but I can't figure out how to change it from 7.1.2. Sorry if I'm missing something obvious, thanks for your help!
As #IgnazioC said, you can replace the contents of the relevant php version with a new one. You can grab the latest PHP 7.1 windows builds from https://windows.php.net/download#php-7.1
Make sure you download the VC14 x86 Thread Safe build, because this is what Ampps uses. You can also download newer versions of ionCube, XDebug and Opcache, but this isn't usually required.
InstallationFolder\ampps\data\apps
Edit this file to change your PHP Version in Ampps. You can actually use this to upgrade or change any modules whether it be PHP or Apache or mysql, etc...