Installing pdo_mysql on Amazon EC2 with PHP 5.5 - php

I've created an Amazon Linux AMI 2013.09.02 server and installed the following:
yum install php55 php55-mbstring php55-soap php55-gd php55-mcrypt php55-pdo httpd24
Apache and PHP work fine. But I need pdo_mysql.so for a legacy version of Doctrine (1.x). I cannot find out how to get pdo_mysql.so onto this system. That file is not within the /user/lib64/php/5.5/modules/ folder.
Suggestions?

Install the package php55-mysqlnd. I believe this will provide mysql support to PDO.
Edit:
For PHP 5.6 support, the package is php56-mysqlnd.
For PHP 7.0 support, the package is php70-mysqlnd.
For PHP 7.1 support, the package is php71-mysqlnd.

Related

Install Legacy Version of PHP Driver for MongoDB on Amazon Linux

I am attempting to install Learning Locker on an Amazon Linux site on AWS. I have been following the step-by-step directions on this site, which has been helpful till now. Unfortunately now I am stuck.
Learning Locker requires the older version of the Mongo driver (mongo.so) for PHP. I think this is the latest version. However if I try to install the driver using pecl it will either install the new version of the driver (mongodb.so) or if I specific "pecl install mongo" I get an error that this version is depreciated.
At this point I need to:
Uninstall the mongodb.so driver that is installed currently.
Install the legacy mongo.so driver.
I have searched the Internet but I have not found what I need to know how to uninstall the existing driver and install the legacy driver.
Suggestions? Any insight will be appreciated. Thanks!!!
With more research I was able to learn how to install an older driver with pecl.
pecl search mongo
Retrieving data...0%
.Matched packages, channel pecl.php.net:
=======================================
Package Stable/(Latest) Local
mongo 1.6.14 (stable) 1.6.14 MongoDB database driver
mongodb 1.2.8 (stable) 1.2.7 MongoDB driver for PHP
sudo pecl install mongo-1.6.14
This worked and I was able to run Composer to install Learning Locker.
I still need to uninstall mongodb.so but that is a work in progress.

Can not connect to MongoDB from PHP

I have installed MongoDB PHP lib
but despite this I can't connect to MongoDB database
Error of rockmonogo :
To make things right, you must install php_mongo module. Here for installation documents on PHP.net.
Error of phpmoadmin :
PHP cannot access MongoDB, you need to install the Mongo extension for PHP.
Error of Laravel with Jenssegers\Mongodb lib :
Unsupported driver [mongodb]
Make sure that it is in fact properly installed. The errors you're getting seem to indicate that your environment can't find the extension. I've compiled installation instructions for you.
Unix-like Systems
Open a terminal emulator and run wget http://pear.php.net/go-pear.phar
Then start the installation of PECL with php go-pear.phar
Install the PHP MongoDB extension sudo pecl install mongodb.
Add extension=mongodb.so to the php.ini file.
Mac OS X
Install homebrew by running /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" in a terminal.
Run brew update
Run brew tap homebrew/php
Install the extension according to your PHP version.
PHP 5.4: brew install php54-mongodb
PHP 5.5: brew install php55-mongodb
PHP 5.6: brew install php56-mongodb
PHP 7.0: brew install php70-mongodb
Windows
Open your web browser to http://pecl.php.net/package/mongodb
Open the latest version from the DLL link (with the Windows icon).
Choose the appropriate version from the DLL list. They are sorted by PHP version, system architecture (i.e. 32-bit vs 64-bit), and thread safety.
Extract the downloaded archive and place php_mongodb.dll in your PHP extensions directory.
Add extension=php_mongodb.dll to the php.ini file.
For mac system, the homebrew php tap mechanism is deprecated and it won't work. You need to manually install it or you need to install Ampps which contains all the packages in built.
The following error might be thrown for the user with new version of the system
Error: homebrew/php was deprecated. This tap is now empty as all its formulae were migrated.

Install mongo php driver centos 6.6

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

Problems installing PHP 5.4.11 and MySQL 5.6.10 on CentOS 6.3

I'm attempting to install PHP 5.4.11 and MySQL 5.6.10 onto a CentOS 6.3 box.
I've successfully installed PHP 5.4.11 via the remi repository for yum. I've also successfully installed MySQL 5.6.10 using the community server rpm's on the MySQL downloads page.
They both work fine independently, but when attempting to install php-mysql from the remi repository, a dependency of mysql-libs is pulled in which is at version 5.5.30, and going ahead with the install produces an array of errors like the following:
file /usr/share/mysql/czech/errmsg.sys from install of mysql-libs-5.5.30-1.el6.remi.x86_64 conflicts with file from package MySQL-server-5.6.10-1.el6.x86_64
At this point, I'm out of my depth with regards to getting this working. Can anyone suggest what I need to do to get my PHP installation working with MySQL?
rpm --nodeps --force
just override

Install libssh2-php on PHP 5.4.9 (x64)

I have a problem with the update on php 5.4.9 (i install it with the ppa "ppa:ondrej/php5")
Now i have the problem that i can't install libssh2-php (which is required on my project)
I found some .deb files, but it's only for 32-bit systems.
So when i'm trying to install libssh2-php i have a collision with "libssh2-php:i386" and i have the following dependiesmessage:
ucf:i386 libc6:i386 (>= 2.4) libssh2-1:i386 (>= 1.0) and phpapi-20090626+lfs:i386
System: Ubuntu Server 12.04 LTS x64 | PHP 5.4.9
I also got a warning on running "php -v"
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php5/20100525/ssh2.so' - /usr/lib/php5/20100525/ssh2.so: cannot open shared object file: No such file or directory in Unknown on line 0
The problem is/was that the libssh2 is not aviable for PHP5.4.x AND a x64 system.
I have the same problem trying to use ondrej's ppa for ubuntu 10.04 LTS. It seams that he didn't include the sssh extension.
Apt-get tries to install the version from default package which runs into conflict (depends phpapi-20090626+lfs) with current installed version, isn't it?
Only my backup php cli script needs this extension to run. After trying to solve dependencies witout success, I switched to a shell_exec('ssh ...#...') solution as workaround.
I am only a developer with advanced admin knowledge, no apt-get or linux packaging admin professional. There maybe other solution to fix this via packaging management or maybe building the needed version from source?
EDIT:
There will be another nicer solution :-) you can use pecl to install / build the extension, here is what i have done:
$ sudo pecl install ssh2
Failed to download pecl/ssh2 within preferred state "stable", latest release is version 0.12, stability "beta", use "channel://pecl.php.net/ssh2-0.12" to install
install failed
$ sudo pecl install channel://pecl.php.net/ssh2-0.12
downloading ssh2-0.12.tgz ...
Starting to download ssh2-0.12.tgz (26,223 bytes)
[...]
Build process completed successfully
Installing '/usr/lib/php5/20100525+lfs/ssh2.so'
install ok: channel://pecl.php.net/ssh2-0.12
configuration option "php_ini" is not set to php.ini location
You should add "extension=ssh2.so" to php.ini
Afterwards I add extension=/usr/lib/php5/20100525+lfs/ssh2.so to php config.
Just do:
sudo aptitude purge php5-suhosin
It's described in detail here: bugs.debian.org

Categories