1、安裝報404錯誤php
git clone 下最新代碼,跳轉到index/install 安裝時出現404錯誤html
須要把僞靜態規則加到nginx配置文件中:nginx
# # The default server # server { listen 8090; #server_name _; #charset koi8-r; #access_log logs/host.access.log main; # Load configuration files for the default server block. include /etc/nginx/default.d/*.conf; location / { root /usr/share/nginx/html/hoh; index index.php index.html index.htm; try_files $uri $uri/ @handler; ## If missing pass the URI to Magento’s front handler #add_header Access-Control-Allow-Origin *; expires 30d; ## Assume all files are cachable } ## These locations would be hidden by .htaccess normally location /app/ { deny all; } location /includes/ { deny all; } location /lib/ { deny all; } location /media/downloadable/ { deny all; } location /pkginfo/ { deny all; } location /report/config.xml { deny all; } location /var/ { deny all; } location /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 /. { ## Disable .htaccess and other hidden files return 404; } location @handler { ## Magento uses a common front handler rewrite / /index.php; } location ~ .php/ { ## Forward paths like /js/index.php/x.js to relevant handler rewrite ^(.*.php)/ $1 last; } # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 # location ~ \.php$ { root /usr/share/nginx/html/hoh; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; } # deny access to .htaccess files, if Apache's document root # concurs with nginx's one # #location ~ /\.ht { # deny all; #} }
重啓nginx後正常安裝。git
2、後臺404錯誤web
1.檢查後臺地址是否輸入錯誤sql
打開app/etc/local.xmlsession
<frontName><![CDATA[admin]]></frontName>
那麼後臺登錄地址就是 域名/adminapp
2.若是後臺地址無誤,執行下面sql語句,表名根據自身是否有加前綴spa
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;
3.刪除 var文件夾下cache文件夾和session文件夾下的全部內容code