How to install Open Source Ecommerce Magento Software and PHP 5.2 on CentOS 5 Linux
Magento is a new, feature-rich open source ecommerce software, it is much better than ecommerce software developed with PHP such as OSCommerce, Zen Cart, X-Cart, CubeCart etc. I believe someday it will be another Zimbra.
To install Magento on CentOS 5, you need to install PHP 5.2, which is not available for current CentOS version.
1, Add Jason Litka’s yum repository to your yum repository.
rpm –import http://www.jasonlitka.com/media/RPM-GPG-KEY-jlitka
yum utterramblings http://www.jasonlitka.com/media/EL5/i386/
vi /etc/yum.repos.d/utterramblings.repo :
[utterramblings]
name=Jason’s Utter Ramblings Repo
baseurl=http://www.jasonlitka.com/media/EL5/i386/
enabled=1
gpgcheck=1
gpgkey=http://www.jasonlitka.com/media/RPM-GPG-KEY-jlitkayum update
2, Install php-mcrypt
yum install php-mcrypt
3, Restart Apache
apachectl restart
4, Fix Zen Cart if you are running an old version of the software and you see these errors in the error log file:
PHP Fatal error: Call to a member function Execute() on a non-object in /xxx/xxx/zcart/includes/functions/sessions.php on line 61
edit /xx/xxx/zcart/includes/functions/sessions.php, change
function _sess_write($key, $val) { global $db; global $SESS_LIFE;to
function _sess_write($key, $val) { // The following is only to work around a PHP 5.2.0 bug: global $db; if (!is_object($db)) { //PHP 5.2.0 bug workaround ... $db = new queryFactory(); $db->connect(DB_SERVER, DB_SERVER_USERNAME, DB_SERVER_PASSWORD, DB_DATABASE, USE_PCONNECT, false); } global $SESS_LIFE;
5, Install APC (Alternative PHP Cache) cache
yum install php-pear
yum install php-devel httpd-devel
yum groupinstall ‘Development Tools’
yum groupinstall ‘Development Libraries’
pecl install apc
press enter when
the install stop at this line:
1-1, ‘all’, ‘abort’, or Enter to continue:
create a file /etc/php.d/apc.ini with the following lines
extension=apc.so apc.enabled=1 apc.shm_size=30
restart apache
/etc/init.d/httpd restart
6, Create a phpinfo.php file and check if Apc is enabled
<?php phpinfo(); ?>
7, Now you are ready to install Magento
8, If your WordPress is not working after installing apc, you may want to remove apc.ini from /etc/php.d/.
9, If you see the following error in apache error log:
[warn] RewriteCond: NoCase option for non-regex pattern ‘-f’ is not supported and will be ignored
You should change the following line in your .htaccess or httpd.conf
RewriteCond %{REQUEST_FILENAME} !-f [NC]
to
RewriteCond %{REQUEST_FILENAME} !-f
or remove the entire line
Popularity: 4%



















































