How to run PHP 5.5.4 mcrypt run on CentOS 6.4? - centos

I am getting the following error:
PHP Warning: PHP Startup: Unable to load dynamic library
'/usr/lib/php/extensions/no-debug-non-zts-20121212/mcrypt.so' -
/lib64/libc.so.6: version `GLIBC_2.14' not found (required by
/usr/lib/php/extensions/no-debug-non-zts-20121212/mcrypt.so)
Does mcrypt require glibc 2.14?
We are running CentOS 6.4 (latest stable version of CentOS) and it comes with glibc 2.12 (can't really upgrade glibc as being a core part of OS, changing it will likely break lots of stuff)
How do I make my PHP 5.5.4 run mcsypt under these circumstances?
Current configuration (phpinfo output) is here.

I was also having issues installing mcrypt on my VPS dev server so I thought I would post my solution in the hopes that it helps someone. I am running Centos OS 6.5 and had upgraded PHP to 5.5.13 using the Webtatic EL yum repository. https://webtatic.com/packages/php55/
First shh into your server
ssh admin#domain.com
initially I was trying to do (which was not working):
yum update
yum install php-mcrypt
I then realized my mistake when I looked at php -v and realized php-common was conflicting as the above code was trying to load a dependency from 5.3.
I then executed the following correct commands:
rpm -Uvh http://mirror.webtatic.com/yum/el6/latest.rpm
yum update
yum install php55w-mcrypt
service httpd restart
This worked perfectly for me.
I also read while researching this issue that some people did have to add the extension to their .ini file manually by adding the following line but i did not have to do this.
extension=mcrypt.so
you can find the location of your php.ini file by looking at phpinfo(); and see which configuration it is loading. For me the following ini files were loading:
/etc/php.ini
/etc/php.d/mcrypt.ini
/var/www/vhosts/system/domain.com/etc/php.ini
If the installation is successful then you will see the extension when you echo phpinfo();

Try installing php-mcrypt using yum. That should pull in any other libraries you need to run it.
yum install php-mcrypt

In light of your update, it would appear that you are trying to use the MCrypt extension built from another PHP Source which was created by an updated GLIBC library. The only proper solution I can see is the following:
You first need to ensure you have libmcrypt, libmcrypt-devel, and mcrypt installed before continuing. Check your CentOS repository.
Download the PHP Source from http://php.net
Untar the downloaded source tar -zxf php-5.5.4.tar.gz
cd into the source cd php-5.4.4
Copy your current ./configure string. The whole thing!
Add support for Mcrypt --with-mcrypt=/usr and run the new configure command
make && make install
restart Apache and PHP-FPM
This will keep your current configuration just as CentOS has built it but with the additional support of MCrypt as you are looking to have. Once you've done this, you do not need to enable the MCrypt extension in your php.ini file as it will be built into PHP itself and will be automatically loaded for you now.
When in doubt, you can also read up on the installation here http://us1.php.net/manual/en/mcrypt.installation.php

Related

Installing/activitating pgsql.so extension in CentOS 6

I am trying to install a student information system (RosarioSIS) that is PostgreSQL-driven. After installing PostgreSQL 9.6 , the system asks me to install and activate a php extension (pgsql.so). I tried 'yum install php-pgsql' command, but it didn't work for some reason. I have tried all the suggested solutions on Stackoverflow and other forums, but still no luck. The last thing I tried is unarchiving a copy of php 5.4.45 and compiling the extension manually using:
phpize
./configure
make
sudo make install
This also did not manage to add the pgsql.so to the folder extension. What do you suggest I do in order to add the required extension (pgsql.so) to where it belongs?
PHP 5.6 release date is far earlier than PostgrSQL 9.6 (PG96). When PHP56 is released, it wasn't knowing about PG96. Try installing PostgreSQL 9.3 and you'll see everything works great. BTW, even PHP7.1 doesn't have client library for PG96 in FreeBSD ports tree.

Centos - how do I install a specific version of Erlang?

I'm running Centos 6.7 on my server and am trying to install Erlang/Rabbitmq following these instructions:
Erlang Installation
RabbitMQ Installation
The trouble is that at time of writing these install Erlang 19.0 with RabbitMQ 3.6.3, which leads to a pretty major bug as far as my client who occasionally looks at the management interface to monitor queues is concerned.
The guidance in the error ticket is not to use erlang 19 until RabbitMQ 3.6.4 is released. But how can I install a specific version of Erlang?
These steps worked for me:
Go to the download page here: https://packages.erlang-solutions.com/erlang/
Select your appropriate package -- you can copy/peek the link then download it using wget.
Install it using rpm.
Example:
# Download erlang 19
$ wget http://packages.erlang-solutions.com/site/esl/esl-erlang/FLAVOUR_1_general/esl-erlang_19.0~centos~7_amd64.rpm
# Install
rpm -Uvh esl-erlang_19.0~centos~7_amd64.rpm
You can always build install from source.
Go to the Erlang.org Downloads page, pick your version from the right side.
From there you can follow the instructions. Although they are for Ubuntu, the commands are the same except for the dependencies part where you can use the command below to install what you need:
sudo yum install g++ openssl-devel unixodbc-devel autoconf ncurses-devel
Another option would be to use kerl, which is similar to rvm in some sense and very (very!) easy to use. It will let you install different Erlang versions and switch between them any time you want.
I prefer this approach instead of looking up packages myself (with possible incompatibilities in the dependencies required) or downloading and compiling everything myself every time I want to try a new Erlang version.

Mountain Lion Zend Install - You must enable the openssl extension to download files via https

I've been trying to get Zend installed on my Mac Pro for some time. I've tried installing it manually, with homebrew, and with port. I've changed php's, reinstalled php, updated php, reinstalled openssl multiple times.
php.ini has openssl in it and it is uncommented, curl is also enabled.
no matter which way I go about it I always get a message like this or very similar (always ssl)
You must enable the openssl extension to download files via https
I also installed a certificate for ssl.
currently I have downloaded the zip for the Zend 2.2.2 'tutorial', extracted to a sites directory and have run
composer install
which as given me:
Loading composer repositories with package information
Installing dependencies (including require-dev)
- Installing zendframework/zendframework (2.2.2)
[RuntimeException]
You must enable the openssl extension to download files via https
install [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-dev] [--no-custom-installers] [--no-scripts] [--no-progress] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader]
I know its installed. I've reinstalled it 3 times. Only thing I can think of is maybe there is more than one php.ini but I haven't been able to find a second one.
thanks in advance for any advice.
I ran php info in apache and got the old install of php version 5.3, when I run it from the command line I get the new 5.4 ?
$ openssl version
OpenSSL 1.0.1e 11 Feb 2013
$ composer diag
Checking platform settings: FAIL
The openssl extension is missing, which will reduce the security and stability of Composer.
If possible you should enable it or recompile php with --with-openssl
Checking http connectivity: OK
Checking composer.json: OK
Checking disk free space: OK
Checking composer version: OK
There is more than one php.ini - the command line version of PHP has a separate one. To see what that is, run php -i | grep ini from the command line - the output should include the .ini files being used near the top.
(Disclaimer: I'm not a Mac user so things may be different in Apple world.)
I'd like to say there was an easy fix. My suggestion is to use homebrew, install everything, then make sure your php.ini is in the right spot (probably have to move it) and also that you change the permissions on local\openssl so that homebrew can write to it. Eventually by moving php.ini around and installing php54 I was able to get it to work.
these are great resources
http://juniorgrossi.com/2013/working-with-multiple-php-versions-on-mac-os-x/
http://railsapps.github.io/openssl-certificate-verify-failed.html

memcache install for MAMP using wrong API version

I'm attempting to install memcache for MAMP. It seems to configure/make/install fine but I'm getting an error saying the API version is wrong:
[26-Oct-2012 17:40:51 UTC] PHP Warning: PHP Startup: memcache: Unable to initialize module
Module compiled with module API=20090626
PHP compiled with module API=20100525
These options need to match
in Unknown on line 0
I am using MAMP 2.1.1 on OS X Mountain Lion.
I'm using this memcache build:
http://pecl.php.net/package/memcache/2.2.7
I extracted the archive into this directory:
/Applications/MAMP/bin/php/php5.4.4/include/memcache-2.2.7
And then ran these commands from the extracted directory:
/Applications/MAMP/bin/php/php5.4.4/bin/phpize
./configure
make
sudo make install
No errors except what I noted above, which I am seeing in:
/Applications/MAMP/logs/php_error.log
Any ideas on how to fix this?
Ok so after a few hours of trying to figure this out, I was able to find the problem and fix it. I'm pretty much a huge noob when it comes to all of this stuff, but here is the best I can explain what I think I figured out:
So, when I ran first ran phpize on the module, it was configured for my system's default installation of php. I had to point php and phpize to my PATH in my .bash_profile
export PATH=/Applications/MAMP/Library/bin:/Applications/MAMP/bin/php/php5.4.3/bin:/usr/local/bin:$PATH:/opt/local/bin
Make sure to change the php version to what ever version you are running.
After adding this to your path, running phpize -v should return:
PHP Api Version: 20100412
Zend Module Api No: 20100525
Zend Extension Api No: 220100525
and running which phpize should return: /Applications/MAMP/bin/php/php5.4.3/bin/phpize
So then it was just a matter of deleting all of the files that were installed the first time, and running through the installation process again. I unzipped the downloaded file cd into the unzipped folder and ran:
/Applications/MAMP/bin/php/php5.4.3/bin/phpize
./configure
make
cp modules/memcache.so /Applications/MAMP/bin/php/php5.4.3/lib/php/extensions/no-debug-non-zts-20100525/
And boom done. It works!
This article helped me out a lot, even though it isn't related to memcache: http://drupal.org/node/1464236

Installing PDO-drivers for PostgreSQL on Mac (using Zend for eclipse)

How can I get PDO to work on my mac (os x 10.5)? I'm using the built in php and php in Zend/Eclipse. Can't seem to find useful drivers for it at all.
I had to install the PDO_PGSQL driver recently on Leopard, and I ran across a multitude of problems. In my search for answers, I stumbled across this question. Now I have it successfully installed, and so, even though this question is quite old, I hope that what I've found can help others (like myself) who will undoubtedly run into similar problems.
The first thing you'll need to do is install PEAR, if you haven't done so already, since it doesn't come installed on Leopard by default.
Once you do that, use the PECL installer to download the PDO_PGSQL package:
$ pecl download pdo_pgsql
$ tar xzf PDO_PGSQL-1.0.2.tgz
(Note: you may have to run pecl as the superuser, i.e. sudo pecl.)
After that, since the PECL installer can't install the extension directly, you'll need to build and install it yourself:
$ cd PDO_PGSQL-1.0.2
$ phpize
$ ./configure --with-pdo-pgsql=/path/to/your/PostgreSQL/installation
$ make && sudo make install
If all goes well, you should have a file called "pdo_pgsql.so" sitting in a directory that should look something like "/usr/lib/php/extensions/no-debug-non-zts-20060613/" (the PECL installation should have outputted the directory it installed the extension to).
To finalize the installation, you'll need to edit your php.ini file. Find the section labeled "Dynamic Extensions", and underneath the list of (probably commented out) extensions, add this line:
extension=pdo_pgsql.so
Now, assuming this is the first time you've installed PHP extensions, there are two additional steps you need to take in order to get this working. First, in php.ini, find the extension_dir directive (under "Paths and Directories"), and change it to the directory that the pdo_pgsql.so file was installed in. For example, my extension_dir directive looks like:
extension_dir = "/usr/lib/php/extensions/no-debug-non-zts-20060613"
The second step, if you're on a 64-bit Intel Mac, involves making Apache run in 32-bit mode. (If there's a better strategy, I'd like to know, but for now, this is the best I could find.) In order to do this, edit the property list file located at /System/Library/LaunchDaemons/org.apache.httpd.plist. Find these two lines:
<key>ProgramArguments</key>
<array>
Under them, add these three lines:
<string>arch</string>
<string>-arch</string>
<string>i386</string>
Now, just restart Apache, and PDO_PGSQL will be up and running.
Take a look at this PECL package: PDO_PGSQL
I haven't tried it myself, but I've been interested in playing with Postgres as an alternative to MySQL. If I have a chance to try it soon, I'll throw my results up here in case it helps.
I'm not sure this will help with the PDO drivers specifically, but you might look into BitNami's MAPPStack.
I had a ton of trouble with Postgres, PHP, and Apache on my Mac, some of it having to do with 64- vs 32-bit versions of some or all of them. So far, the BitNami MAPPStack install is working nicely in general. Maybe it will help with your PDO issues as well.
Install new php version via brew and restart server, and php -v, all issues are removed.
This is what worked for me
brew install php55-pdo-pgsql
This installs PHP 5.5.32 and PostgreSQL 9.5. I already had PostgreSQL 9.4 installed so I uninstalled the homebrew version with:
brew uninstall postgres
You then have to update /etc/apache2/httpd.conf to point to the correct PHP version and restart Apache:
LoadModule php5_module /usr/local/Cellar/php55/5.5.32/libexec/apache2/libphp5.so
My OSX version is Yosemite.