0. 目標(biāo)
安裝eolinker 開源版本3.2.1玩讳。
本文均以WIN X64環(huán)境议双,綠色安裝包來講解絮姆。
1. 安裝包準(zhǔn)備
本文均已綠色安裝包來講解羊壹,eolinker 3.2.1 的基礎(chǔ)環(huán)境為:
PHP 5.5+ / PHP7+(推薦)
Mysql 5.5+ / Mariadb 5.5+
Nginx(推薦) / Apache
1.1 PHP 5.5+
以 PHP 5.6.33 為例:
http://windows.php.net/download/
在下拉框中選擇 PHP5.6+ VC11 X64 Thread Safe侥祭。
附下載鏈接(可能會(huì)失效):
http://windows.php.net/downloads/releases/php-5.6.33-Win32-VC11-x64.zip
注意:
1.?必須為Thread Safe版本叁执,否則會(huì)缺少php5apache2_4.dll這個(gè)動(dòng)態(tài)鏈接庫;
2. 須保證VC11已安裝矮冬;https://www.microsoft.com/zh-CN/download/details.aspx?id=14632
1.2 APACHE 2.4.x
以?Apache 2.4.29為例:
http://www.apachelounge.com/download/
選擇Apache 2.4.29 Win64谈宛。
附下載鏈接(可能會(huì)失效):
http://www.apachelounge.com/download/VC15/binaries/httpd-2.4.29-Win64-VC15.zip
注意:
1. 須保證VC15已安裝;https://www.microsoft.com/zh-CN/download/details.aspx?id=30679
1.3 MySQL 5.5+
以mysql 5.6.38為例:
https://dev.mysql.com/downloads/mysql/
在頁面下方點(diǎn)擊 "Looking for the latest GA version?" 胎署,依次選擇 5.6.38吆录,Microsoft Windows,Windows(x86, 64-bit)琼牧,然后下載下方zip包恢筝。
附下載鏈接(可能會(huì)失效):
https://cdn.mysql.com//Downloads/MySQL-5.6/mysql-5.6.38-winx64.zip
1.4 eolinker
以eolinker 3.2.1 為例:
https://github.com/eolinker/eoLinker-API-Management-System-OS-3.X
下載eolinker_os_3.2.1.zip
3. 安裝、配置及服務(wù)啟動(dòng)
綠色版的安裝巨坊,其實(shí)就是解壓撬槽,修改配置文件,配置環(huán)境變量等動(dòng)作趾撵。
3.1 PHP安裝及配置
3.1.1 安裝
解壓?php-5.6.33-Win32-VC11-x64.zip 至工作目錄侄柔,本文以 D:\eolinker\php 為例。
在path環(huán)境變量中添加:
D:\eolinker\php
和
D:\eolinker\php\ext
3.1.2 配置
將 D:\eolinker\php\php.ini-development 備份一份為?D:\eolinker\php\php.ini占调,
以下內(nèi)容均在 D:\eolinker\php\php.ini 中修改:
1. 修改
; extension_dir = "ext"
為
extension_dir = "D:/eolinker/php/ext"
2. 修改
;extension=php_curl.dll
為
extension=php_curl.dll
3. 修改
;extension=php_mbstring.dll
為
extension=php_mbstring.dll
4. 修改
;extension=php_mysql.dll
為
extension=php_mysql.dll
5. 修改
;extension=php_mysqli.dll
為
extension=php_mysqli.dll
6. 修改
;extension=php_pdo_mysql.dll
為
extension=php_pdo_mysql.dll
3.1.3 測(cè)試安裝成果
命令行中輸入
php -v
能顯示版本號(hào)信息即為配置成功勋拟,否則請(qǐng)檢查環(huán)境變量;
若提示xxx.dll未安裝妈候,請(qǐng)確認(rèn)VC11庫是否安裝敢靡。
3.2 Apache安裝及配置
3.2.1 安裝
解壓?httpd-2.4.29-Win64-VC15.zip 至工作目錄,本文以 D:\eolinker\Apache24 為例苦银。
3.2.2 配置
以下內(nèi)容均在 D:\eolinker\Apache24\conf\httpd.conf 中修改:
(1-5點(diǎn)可簡化為全局替換 c:/Apache24 為 D:/eolinker/Apache24)
1. 修改?
ServerRoot "c:/Apache24"?
為?
ServerRoot "D:/eolinker/Apache24"啸胧;
2. 修改
DocumentRoot "c:/Apache24/htdocs"
為
DocumentRoot "D:/eolinker/Apache24/htdocs"
3. 修改
<Directory "c:/Apache24/htdocs">
為
<Directory "D:/eolinker/Apache24/htdocs">
4. 修改
ScriptAlias /cgi-bin/ "c:/Apache24/cgi-bin/"
為
ScriptAlias /cgi-bin/ "D:/eolinker/Apache24/cgi-bin/"
5. 修改
<Directory "c:/Apache24/cgi-bin">
為
<Directory "D:/eolinker/Apache24/cgi-bin">
6. 修改 ?
# ServerName www.example.com:80
為
ServerName www.example.com:8123
注意:
1. 此處為取消注釋赶站;
2. 修改端口號(hào)為需要對(duì)外提供服務(wù)的端口號(hào),避免與已有服務(wù)沖突纺念。
7. 修改
DirectoryIndex index.html
為
DirectoryIndex index.html index.php index.htm
8. 添加
在httpd.conf最后添加以下三行:
LoadModule php5_module "D:/eolinker/php/php5apache2_4.dll"?
AddType application/x-httpd-php .php .html .htm
PHPIniDir "D:/eolinker/php"
注意:
1. 此處添加這三行為讓apache支持php贝椿;
3.2.3 服務(wù)啟動(dòng)
在命令行(不要使用powershell,可能會(huì)有錯(cuò)誤信息無法顯示的問題)中進(jìn)入D:/eolinker/Apache24/bin陷谱,執(zhí)行:
httpd -k install
安裝apache服務(wù)烙博,
然后再執(zhí)行:
net start apache2.4
啟動(dòng)服務(wù)
注意:
1. 如果啟動(dòng)報(bào)錯(cuò),提示找不到php5apache2_4.dll烟逊,請(qǐng)確認(rèn)PHP版本渣窜;
2. 如果提示確實(shí)xxx.dll 請(qǐng)確認(rèn)VC15是否安裝;
3. httpd -k restart 為重啟服務(wù)命令宪躯,在配置文件乔宿,或PHP內(nèi)容有修改后,可通過此命令重新啟動(dòng)访雪;
4. httpd -k uninstall 為刪除apache服務(wù)详瑞。
3.3 MySQL安裝及配置
3.3.1 安裝
解壓?mysql-5.6.38-winx64.zip 至工作目錄,本文以 D:\eolinker\mysql-5.6.38 為例臣缀。
在path環(huán)境變量中添加:
D:\eolinker\mysql-5.6.38\bin
3.3.2 配置
將
D:\eolinker\mysql-5.6.38\my-default.ini
復(fù)制為
D:\eolinker\mysql-5.6.38\my.ini
以下內(nèi)容均在 D:\eolinker\mysql-5.6.38\my.ini?中修改:
1. 修改
# basedir = .....
為
basedir =?D:\eolinker\mysql-5.6.38
2. 修改
# datadir = .....
為
datadir =?D:\eolinker\mysql-5.6.38\data
3. 修改
# port = .....
為
port = 3306
4. 添加
在文件末尾添加
skip-grant-tables
3.3.3 服務(wù)啟動(dòng)
3.3.3.1 mysql服務(wù)啟動(dòng)
使用命令行進(jìn)入
D:\eolinker\mysql-5.6.38\bin
執(zhí)行
mysqld --install
提示成功坝橡,再執(zhí)行
mysqld -install MySQSL --defaults-file="D:\eolinker\mysql-5.6.38\my.ini"
成功后,再執(zhí)行
net start mysql
啟動(dòng)mysql服務(wù)
在命令行執(zhí)行
mysql -u root -p
進(jìn)入數(shù)據(jù)庫精置,首次進(jìn)入不需要輸入密碼
show databases;
查看當(dāng)前數(shù)據(jù)庫
use mysql;
切換到mysql數(shù)據(jù)庫
UPDATE?user?SET?password=PASSWORD("123456")?WHERE?user='root';
設(shè)置root用戶密碼為123456
FLUSH?PRIVILEGES;
刷新使密碼生效
quit;
3.3.3.2 eolinker數(shù)據(jù)庫配置
在命令行執(zhí)行
mysql -u root -p
使用root用戶進(jìn)入數(shù)據(jù)庫
create database eolinker_test;
創(chuàng)建數(shù)據(jù)庫计寇,名為eolinker_test
use eolinker_test
進(jìn)入eolinker_test數(shù)據(jù)庫
CREATE USER eo identified BY 'eo123';
創(chuàng)建用戶名為eo的用戶,密碼為eo123
Grant all ON eolinker_test TO eo;
將eolinker_test數(shù)據(jù)庫的所有權(quán)限賦予eo
quit;
4. 安裝eolinker
解壓eolinker_os_3.2.1.zip至工作目錄氯窍,本文以 D:\eolinker\Apache24\htdocs\eolinker 為例饲常。
命令行執(zhí)行 httpd -k restart 重啟apache服務(wù)
瀏覽器中打開
http://localhost:8123/eolinker
按照提示安裝即可蹲堂。
5. 可能出現(xiàn)的問題
1. VC11的缺失狼讨;
安裝VC11即可
2. VC15的缺失;
安裝VC15即可
3. 安裝eolinker提示缺失curl模塊:
將 libssh2.dll, php_curl.dll, ssleay32.dll, libeay32.dll 復(fù)制到c:\Windows\system32 中柒竞,
將 libssh2.dll 復(fù)制到 D:\eolinker\Apache24\bin 中政供,
httpd -k restart 重啟apache服務(wù)。
6. 類似的工具
http://rapapi.org/org/index.do
http://yapi.qunar.com/
http://doclever.cn/controller/index/index.html