I have a dedicated Centos server.
As I see at plesk it has 5.3 (5.4),5.6 and 7 php but the default php is 5.4
My problem is that I want to install mongo driver for the 5.6 PHP version and I do not know where is 5.6 PHP installed.
Also I need to run some php 5.6 command line scripts.How can I find where php ver. 56 is located at centos server?
Use /opt/plesk/php/5.6/bin/ path.
You can use following instruction for installation php mongo extension for PHP5.6, for example:
Install all necessary packages for compiling mongo module:
yum install make plesk-php56-devel gcc glibc-devel openssl-devel
Compile mongo module:
/opt/plesk/php/5.6/bin/pecl install mongo
Add extension to corresponding ini file:
echo "extension=mongo.so" > /opt/plesk/php/5.6/etc/php.d/mongo.ini
Reread php handlers:
plesk bin php_handler --reread
Go to Plesk -> Tools&Settings -> PHP Settings -> 5.6.xxxx
Enjoy the view of the installed mongo module.
Related
Currently, I have cloned a project. I have PHP 7 on Ubuntu 14.04 64-bit.
The ImageMagick library is installed using the following command
sudo apt-get install php-imagick
But when I try image manipulation through this library, it throws the following exception
(1/1) NotSupportedException
ImageMagick module not available with this PHP installation.
How can I install this software with the latest PHP version?
Note: I am using Laravel 5.4 in this project.
You have to add extension=imagick.so in your php.ini file.
Location:
You can do some thing like this for the fastest way:
php -i | grep 'php.ini'
The result is like that:
Loaded Configuration File => /usr/local/lib/php.ini
Or call <?php phpinfo(); ?> from some php file to get this information :)
PS: Source
I had the same problem on my computer, and what solved it was:
Instead of installing sudo apt install php-imagick, I installed sudo apt install php7.4-imagick (or whatever version your PHP installation is).
This, in combination with Maraboc's answer did the trick for me.
I have installed the lastest mongodb php driver on linux centos 6 with plesk onyx using the following commands.
yum install plesk-php56-devel make gcc openssl-devel
/opt/plesk/php/5.6/bin/pecl install mongodb
echo "mongodb.so" > /opt/plesk/php/5.6/etc/php.d/mongodb.ini
plesk bin php_handler --reread
I have also added extension=mongodb.so to the php.ini file.
I also changed the cli version from php 5.3 to 5.6 before running the install as php needed to be at least 5.4 for the install to continue.
The mongodb section in now in my phpinfo() page. However the extension is not loaded when I test it in a php page.
When I try to reinstall I get this message:
PHP Warning: PHP Startup: Unable to load dynamic library
'/opt/plesk/php/5.6/lib64/php/modules/mongo.so' -
/opt/plesk/php/5.6/lib64/php/modules/mongo.so: cannot open shared
object file: No such file or directory in Unknown on line 0
pecl/mongodb is already installed and is the same as the released
version 1.2.9 install failed
Also, the line that says /opt/plesk/php/5.6/lib64/php/modules/mongo.so
refers to mongo.so when in actual fact the file present in the modules folder is mongodb.so
Does anyone have any suggestions or experience with this please?
For those facing the same issue. This was fixed by changing the extension name in the following file /opt/plesk/php/5.6/etc/php.d/mongodb.ini from mongo.so to mongodb.so
And then remember to use the new mongo driver class ie MongoDB\Driver\
I have installed Homestead and I am trying to work on a Laravel project version 4.2 however I keep getting the following error:
Mcrypt PHP extension required.
I have already installed Mcypt installed on the server and I have enabled it into the PHP 7 ini file. This problem does not want to go away for some reason.
Any recommendations to what I can do in order to enable Mcrypt on my virtual box please?
Since php7.1 mcrypt is deprecated so you have to downgrade php to php7.0
or install multiple versions of php but don't forget to enable the right
version inside your http server config file
or you can use php built in sever like :
cd project_dir/
php7.0 -S localhost:8000
when i tried to install composer with php 5.6.3 that return message said i have to install php 5.6.4 at least
so i just download xampp package that support php 7 to be able to install composer and laravel and when i tried to install composer after that the composer show me that Error :
The PHP exe file you specified did not run correctly [exit code 1]:
E:\xampp\php\php.exe
The php.ini used by your command-line PHP is: E:\xampp\php\php.ini
A setting in your php.ini could be causing the problem: Either the 'extension_dir' value is incorrect or the dll does not exist.
I also had this problem. Try install Xampp 5.6.24 / PHP 5.6.24 (Not the latest Xampp 7.0.9 / PHP 7.0.9)
I have a cloud hosted VPS with Centos 6.6 + Direct Admin + PHP 5.6.6 installed by my hosting provider.
I need to have the MongoDB php driver installed to connect to an external mongoDB.
I tried the following installations:
http://www.liquidweb.com/kb/how-to-install-the-mongodb-php-driver-extension-on-centos-6/
http://andres.jaimes.net/876/setup-mongo-php-module-centos-6/
install-mongodb-php-driver-in-centos-6-3 at madcoda com
Also yum --enablerepo=remi,remi-php56 php-pecl-mongo does not do the trick
I have in /usr/lib64/php/modules/ the following modules:
bz2.so, calendar.so, ctype.so, curl.so, exif.so, fileinfo.so, ftp.so, gettext.so, iconv.so, json.so, mongo.so, phar.so, sockets.so, tokenizer.so, zip.so
And in /etx/php.d/ the .ini files that are created for each module.
Installing mongo php driver on an old vps with centos 5.x was not a problem also not on Centos 6.2 with php 5.5.
In these cases the mongo.so was located in the location /usr/local/php/lib/php/extensions/no-debug-non-zts-xxxxxx/ and had to add it manually to the php.ini
The hosting provider is not supporting any else than the default installation I got.
I really appreciate any help.
Stan
I found the solution in the comment of this answer https://serverfault.com/questions/589877/pecl-command-produces-long-list-of-errors
PEAR had to be reinstalled from the remi-php56 repo because of PHP 5.6 running on the server.
After that I could use pecl install mongo and copy the mongo.so to the /usr/local/php/lib/php/extensions/no-debug-non-zts-xxxxxx/ folder.
# php -m | grep -i mongo > mongo is running