安装 zencart magento 及配置等

来源:互联网 发布:手机看淘宝直播 编辑:程序博客网 时间:2024/06/04 00:59

安装 openssl

tar zxvf openssl-1.0.1c.tar.gz 

./config --prefix=/usr/local/openssl
make make install cd /home/lnmp0.9-full/php-5.2.17/ext/openssl
cp config0.m4 config.m4
phpize
./configure  --with-php-config=/usr/local/php/bin/php-config --with-openssl
make 
make install
安装 带ssl curl 
tar -zxvf curl-7.18.2.gz cd curl-7.18.2 ./configure --prefix=/usr/local/curl --with-ssl=/usr/local/ssl make make install cd /home/lnmp0.9-full/php-5.2.17/ext/curl phpize ./configure  --with-php-config=/usr/local/php/bin/php-config --with-curl=/usr/local/curlmake cp /home/lnmp0.9-full/php-5.2.17/ext/curl/modules/curl.so /usr/local/php/lib/php/extensions/no-debug-non-zts-20060613/ 

(复制modules/curl.so到php的扩展目录下)

(修改php.ini文件,加入: extension=curl.so)


-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

安装 magento 版本1.7.0
yum install php-mbstring
yum install php-gd
yum install php-dom

配置 ngnix.conf  magento文件  /var/www/magento/m7下面
 server {        listen      80;        #server_name magento.tt www.magento.tt;        server_name  www.magento.tt magento.tt;        root /var/www/magento;        index index.php index.html;        location / {           index index.html index.php; ## Allow a static html file to be shown first           try_files $uri $uri/ @handler; ## If missing pass the URI to Magento’s front handler           expires 30d; ## Assume all files are cachable       }        location ~ \.php$ {                fastcgi_pass   127.0.0.1:9000;                fastcgi_index  index.php;                include fcgi.conf;                rewrite ^(.*.php)/ $1 last;                #       limit_conn crawler  5;                #       limit_req zone=bbs burst=2 nodelay;        }        location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$ {                expires      30d;        }        location ~ .*\.(js|css)?$ {                expires      12h;        }        location ~* \.(htaccess|inc|dwt|lbi|sql|bak)$ {                deny all;        }        location m7/app/ { deny all; }        location m7/includes/ { deny all; }        location m7/lib/ { deny all; }        location m7/media/downloadable/ { deny all; }        location m7/pkginfo/ { deny all; }        location m7/report/config.xml { deny all; }               location m7/var/export/ { ## Allow admins only to view export folder                auth_basic “Restricted”; ## Message shown in login window                        auth_basic_user_file htpasswd; ## See /etc/nginx/htpassword                        autoindex on;        }        location @handler { ## Magento uses a common front handler                rewrite / /index.php;        }       #log_format  wwwlogs1  '$remote_addr - $remote_user [$time_local] "$request" '       #               '$status $body_bytes_sent "$http_referer" '       #               '"$http_user_agent" $http_x_forwarded_for';       #        access_log  logs/wholesale7.net_access.log  wwwlogs1;                                access_log  off;                                error_log  logs/magento.tt_error.log;       # error_log  /dev/null;                                include rewrite/magento_rewrite.conf;}                               

装magento系统时,出现了以下的提示:The URL "http://www.mydomainname.com/" is not accessible. Unable to read response, or response is empty. 解决方法是:在当前那个页面选择 “Skip Base URL Validation” 这个选项即可解决问题

/*************升级php5.2.7到5.4.9********************************/
wget http://www.zend.com/en/products/guard/tZendGuardLoader-70429-PHP-5.4-linux-glibc23-x86_64?package=698解压后得到 更高版本的 ZendGuardLoader.so cd /data/ZendGuardLoader-70429-PHP-5.4-linux-glibc23-x86_64/php-5.4.xcp ZendGuardLoader.so /usr/local/zend/cd /data/php-5.4.19./buildconf --force./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/php/etc --with-mysql=/usr/local/mysql --with-mysqli=/usr/local/mysql/bin/mysql_config --with-iconv-dir --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir=/usr --enable-xml --disable-rpath --enable-discard-path --enable-magic-quotes --enable-safe-mode --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --with-curl --with-curlwrappers --enable-mbregex --enable-fastcgi --enable-fpm --enable-force-cgi-redirect --enable-mbstring --with-mcrypt --enable-ftp --with-gd --enable-gd-native-ttf --with-openssl --with-mhash --enable-pcntl --enable-sockets --with-xmlrpc --enable-zip --enable-soap --without-pear --with-gettext --with-mime-magic --with-curlwrappers  --with-curl=/usr/bin/curlmake ZEND_EXTRA_LIBS='-liconv'ln -s /usr/local/php/bin/php /usr/bin/php   ln -s /usr/local/php/bin/phpize /usr/bin/phpize ln -s /usr/local/php/sbin/php-fpm /usr/bin/php-fpm tar -zxvf memcached-2.0.0.tarcd memcached-2.0.0/usr/local/php/bin/phpize./configure --with-php-config=/usr/local/php/bin/php-configmake && make installcp /data/memcached-2.0.0/modules/memcached.so /usr/local/php/lib/php/extensions/no-debug-non-zts-20100525/cd /data/php-5.4.19/ext/pdo_mysql/usr/local/php/bin/phpize./configure --with-php-config=/usr/local/php/bin/php-config --with-pdo-mysql=/usr/local/mysqlmake && make installcp /data/php-5.4.19/ext/pdo_mysql/modules/pdo_mysql.so /usr/local/php/lib/php/extensions/no-debug-non-zts-20100525///默认 5.3.3以后 php-fpm 集成到php中 使用 --enable-fpm  旧版本需要补丁cp /usr/local/php/etc/php-fpm.conf /usr/local/php/etc/php-fpm.conf_bakcd /usr/local/php/etc/cp php-fpm.conf.default etc/php-fpm.conf#修改 php-fpm.conf user=www group=www 其他地方对照原来的修改#php.ini 添加配置信息cat >>/usr/local/php/etc/php.ini<<EOF;eaccelerator;ionCube[Zend Optimizer] zend_optimizer.optimization_level=1 zend_extension="/usr/local/zend/ZendOptimizer.so" ; Directory in which the loadable extensions (modules) reside.extension_dir = "/usr/local/php/lib/php/extensions/no-debug-non-zts-20100525/"extension = "memcache.so"extension = "memcached.so"extension = "pdo_mysql.so"
extension = "mcrypt.so"
EOF#设置自动启动chkconfig --level 345 php-fpm onchkconfig --level 345 nginx onchkconfig --level 345 mysql onmkdir /usr/local/php/logstouch  /usr/local/php/logs/php-fpm.log#运行php-fmp/usr/local/php/sbin/php-fpm  -c /usr/local/php/etc/php.ini 
/*************升级php5.2.7到5.4.9完*******************************/

网络错误

网卡启动时报Connection activation failed: Device not managed by NetworkManager的错误解决

chkconfig network off

chkconfig network on

service NetworkManager stop


magento 2.0错误

Exception printing is disabled by default for security reasons.
Error log record number: XXXXXXXXXXXXXXX

在网站根目录创建tmp文件夹,或者使用命令

mkdir tmp

在pub文件夹下的 errors文件夹

cp local.xml.sample /local.xml

在lib\zend\Cache\Backend\File.php下面修改

  第90行修改为

protected $_options = array(
        'cache_dir' => 'tmp/',
        'file_locking' => true,


出现错误 Failed to resolve the file pattern '/var/www/magento/w2/app/design/install/default/basic/*_*/layout/*.xml'

修改 把 ../lib/magento/Filesystem/Adapter/Local.php 下241-248行先注释掉   这个异常处理先注释
    public function searchKeys($pattern)
    {
        $result = @glob($pattern);
        //if (false === $result) {
        //    throw new Magento_Filesystem_Exception("Failed to resolve the file pattern '{$pattern}'");
        //}
        return $result;
    }
安装就可以正常。

编译出错:
ext/gd/libgd/.libs/gdkanji.o: In function `do_convert':
/root/php-5.2.12/ext/gd/libgd/gdkanji.c:350: undefined reference to `libiconv_open'
vi Makefile
找到下面这行:
在 EXTRA_LIBS 后面添加 -liconv
make ZEND_EXTRA_LIBS='-liconv'
make install

把1.6的实例数据导入到1.7的后问题:
提示错误:app/code/core/Mage/Bundle/sql/bundle_setup/mysql4-upgrade-1.6.0.0-1.6.0.0.1.php 中有错误
magento There has been an error processing your request QLSTATE[42S01]: Base table or view already exists: 1050 Table 'catalog_product_entity_group_price' already exists

解决: mv app/code/core/Mage/Bundle/sql/bundle_setup/mysql4-upgrade-1.6.0.0-1.6.0.0.1.php app/code/core/Mage/Bundle/sql/bundle_setup/mysql4-upgrade-1.6.0.0-1.6.0.0.1.php_
mv app/code/core/Mage/Catalog/sql/catalog_setup/upgrade-1.6.0.0.9-1.6.0.0.10.php app/code/core/Mage/Catalog/sql/catalog_setup/upgrade-1.6.0.0.9-1.6.0.0.10.php_
mv app/code/core/Mage/SalesRule/sql/salesrule_setup/upgrade-1.6.0.2-1.6.0.3.php app/code/core/Mage/SalesRule/sql/salesrule_setup/upgrade-1.6.0.2-1.6.0.3.php_
mv app/code/core/Mage/Reports/sql/reports_setup/upgrade-1.6.0.0-1.6.0.0.1.php app/code/core/Mage/Reports/sql/reports_setup/upgrade-1.6.0.0-1.6.0.0.1.php_
mv app/code/core/Mage/Oauth/sql/oauth_setup/install-1.0.0.0.php app/code/core/Mage/Oauth/sql/oauth_setup/install-1.0.0.0.php_
mv app/code/core/Mage/Captcha/sql/captcha_setup/install-1.7.0.0.0.php app/code/core/Mage/Captcha/sql/captcha_setup/install-1.7.0.0.0.php_
mv app/code/core/Mage/Api2/sql/api2_setup/install-1.0.0.0.php app/code/core/Mage/Api2/sql/api2_setup/install-1.0.0.0.php_

不错的数据库比较脚本 生成数据库补丁  https://gist.github.com/iegik/1268222

magento 后台 index.php/admin 登录404错误 解决:
SET FOREIGN_KEY_CHECKS=0;UPDATE `core_store` SET store_id = 0 WHERE code='admin';UPDATE `core_store_group` SET group_id = 0 WHERE name='Default';UPDATE `core_website` SET website_id = 0 WHERE code='admin';UPDATE `customer_group` SET customer_group_id = 0 WHERE customer_group_code='NOT LOGGED IN';SET FOREIGN_KEY_CHECKS=1;
 删除缓存 即ok.

magento 跳转到后台无法登录 index.php/admin/index/index/key/8ea2131443ae/
you need to change in app/code/core/Mage/Core/Model/Session/Abstract/Varien.php
需要把后面三个参数注释掉。
$cookieParams = array(
    'lifetime' => $cookie->getLifetime(),
    'path'     => $cookie->getPath(),
    //'domain'   => $cookie->getConfigDomain(),
   // 'secure'   => $cookie->isSecure(),
   // 'httponly' => $cookie->getHttponly()
);

magento 代码分析
//返回类 global 下 models下面  优先rewrite的类  rewrite节点里面直接配置类的名称    然后  返回 $group下class或model 节点里面定义的类名
 //再然后 是将global 下 models下面 $modelClass通过 '/'分解$group和$class  'model'字符 是此处的$groupType             $className='mage_'.$group.'_'.$groupType.'_'.$class;
//并且把 类名称放进 _classNameCache变量中
return $this->getGroupedClassName('model', $modelClass);










原创粉丝点击