1.需要php5.4以上版本,mysql數據庫需要支持InnoDB,字符集utf8_general_ci(多語言不區分大小寫)
2.把域名(虛擬域名)綁定到根目錄下,需要先創建數據庫,否則界面會一直停在‘’安裝中‘’
3.linux系統 public目錄下 runtime和uploads,根目錄下oscshop給予權限
4.需要重寫隱藏index.php,apache需要開啟重寫模塊
5.安裝完成后,需要手動清除一下runtime目錄下的緩存文件
# 如何重寫
http://www.hmoore.net/manual/thinkphp5/177576
# 如何綁定
本方法適用于windows平臺,注意文件路徑改成自己的,linux下類似
1.打開 C:Windows/System32/drivers/etc/hosts 加入下面語句保存(可以填寫多個)
~~~
127.0.0.1 o2.com
~~~
2.
(1),apache服務器,找到 E:/xampp/apache/conf/httpd-vhosts.conf 寫入下面語句 ,注意文件路徑改成自己的,可以在這個文件寫多個,綁定多個域名
~~~
<VirtualHost *:80>
ServerAdmin webmaster@dummy-host2.example.com
DocumentRoot "E:/xampp/htdocs/oscshop2"
ServerName o2.com
ErrorLog "logs/dummy-host2.example.com-error.log"
CustomLog "logs/dummy-host2.example.com-access.log" common
</VirtualHost>
~~~
(2),nginx服務器,找到D:/phpStudy/nginx/conf/vhosts.conf 寫入下面語句 ,注意文件路徑改成自己的,可以在這個文件寫多個,綁定多個域名
~~~
server {
listen 80;
server_name o2.com o2.com;
root "D:/WWW/oscshop2";
location / {
index index.html index.htm index.php;
#autoindex on;
if (!-e $request_filename) { rewrite ^(.*)$ /index.php?s=$1 last; break; }
}
location ~ .php(.*)$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_split_path_info ^((?U).+.php)(/?.+)$;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
include fastcgi_params;
}
}
~~~
3.重啟服務器,瀏覽器中輸入 o2.com 即可
4.如果安裝不了,可以試試其他集成環境 如 xampp,phpStudy