Activities

December 2009
M T W T F S S
« Nov   Jan »
 123456
78910111213
14151617181920
21222324252627
28293031  

Enabling PDO_MYSQL on PHP, Magento installation

Question

My box is cents5.3.1 and I want to install Magento ( a php framework) on users desktop. During the installation I got stucked because php_mycrypt and pdo_mysql was enabled on my existing php compilation.

1. Installation of mycrypt is fairly easy, find the follows
Download location : http://sourceforge.net/projects/mcrypt/files/Libmcrypt/2.5.8/libmcrypt-2.5.8.tar.gz/download

#tar -zxvf libmcrypt-2.5.8.tar.gz
#cd libmcrypt-2.5.8
#./configure && make && make install

2. Then compile the php again. I have created a file which will help to enable maximum modules that we need( it takes long time to sort it out)
There is also another solution to enable it without php compilation. Go to php source directory and then switched to “ext/mcyrpt” under the source tree.

[root@rc-026 php-5.2.9]# cd ext/mcrypt/
[root@rc-026 mcrypt]# phpize
Configuring for:
PHP Api Version: 20041225
Zend Module Api No: 20060613
Zend Extension Api No: 220060519
Cannot find autoconf. Please check your autoconf installation and the $PHP_AUTOCONF
environment variable is set correctly and then rerun this script.

[root@rc-026 mcrypt]# yum install autocon*
[root@rc-026 mcrypt]# sh configure
[root@rc-026 mcrypt]# make
[root@rc-026 mcrypt]# make install
Installing shared extensions: /usr/lib/extensions/no-debug-non-zts-20060613/
[root@rc-026 mcrypt]# vi /usr/local/lib/php.ini
added ” extension_dir=”/usr/lib/extensions/no-debug-non-zts-20060613/”
extension=”mcrypt.so”
[root@rc-026 mcrypt]# php -r ‘phpinfo();’ |grep “mcrypt”
PWD => /home/installation/php/php-5.2.9/ext/mcrypt
_SERVER[“PWD”] => /home/installation/php/php-5.2.9/ext/mcrypt
_ENV[“PWD”] => /home/installation/php/php-5.2.9/ext/mcrypt
[root@rc-026 mcrypt]# service httpd restart
Stopping httpd: [ OK ]
Starting httpd: [ OK ]

I uses con.sh file to add config parameters and added the following lines in to it

./configure --prefix=/usr/local/php  --with-apxs2=/usr/sbin/apxs --with-xsl --with-mysql --with-config-file-scan-dir=/etc/php.d --prefix=/usr --exec-prefix=/usr --bindir=/usr/bin  --sbindir=/usr/sbin --sysconfdir=/etc --datadir=/usr/share --includedir=/usr/include --libdir=/usr/lib --libexecdir=/usr/libexec --with-config-file-path=/etc --with-bz2 --with-curl --with-exec-dir=/usr/bin  --with-png --with-zlib --with-pear=/usr/share/pear --with-zml --with-gd --with-libxml=/usr/lib --enable-calendar --with-openssl-dir=/usr/local/ssl --with-bcmath --with-mysqli --enable-soap -with-jpeg --enable-sockets --enable-mbstring --enable-shared --with-jpeg-dir=/usr/local --with-freetype-dir=/usr/local/lib    --with-mcrypt=/usr/local/bin/mcrypt

Then

#make && make install

3. MySQL_PDO installation

#yum install autoconf
#pecl install  pdo_mysql
[root@rc-040 php-5.2.9]# vi /etc/php.ini

edit php.ini and set the path of extension_dir to identify the module.
extension_dir = “/usr/lib/extensions/no-debug-non-zts-20060613″
extension=”pdo_mysql.so”

[root@rc-040 php-5.2.9]# php -r 'phpinfo();' |grep "pdo"

which returns

[root@rc-169 ~]# php -r 'phpinfo();' |grep "pdo"
pdo_mysql
pdo_sqlite
PECL Module version => (bundled) 1.0.1 $Id: pdo_sqlite.c,v 1.10.2.6.2.4 2008/12/31 11:17:42 sebastian Exp $
[root@rc-169 ~]#

Try http://localhost/phpinfo.php to verify the installation

Magento installation issue

Leave a Reply

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>