在P2-200 + RedHat環境安裝fpcode 0.9!

Mac OS X 平台上程式設計的相關問題討論

版主: bryanchangdigdog謝孟叡

回覆文章
內容
發表人
頭像
cjtai
冰果室水電工
文章: 2226
註冊時間: 04/19/2001 1:01 am
來自: dark side in the earth.
聯繫:

在P2-200 + RedHat環境安裝fpcode 0.9!

#1 文章 cjtai »

安裝平台版本:
RedHat 6.0 + Apache 1.3.14 + PHP 4.0.4 + MySQL 3.22.32

謹尊白老闆建議,不使用原光碟內的rpm模組安裝,改下載.tar.gz回來configue和make install。
(如此一來吃盡了苦頭,但可以學到不少!各位如果有需要,我已經將configue和make install的步驟寫成一個Script,可以來email索取。但我不保證在其他平台和版本,可以正常運作!)

在安裝fpcode 0.9時,出現幾個問題點,提供給大家參考:

第一、fpcode_0.9fc1.tgz解開後的目錄名稱有空格,這在我以純文字模式運作下的RedHat 6.0上(當Server運作的Linux,我習慣上是不安裝X-Windows),是無法操作的。甚至後來使用mc將其名稱改變。

第二、fpcode.sql要restore回MySQL Database時,出現問題。原因是原fpcode.sql的內容(我擷取部分碼說明)
<BLOCKQUOTE><font size="1" face="XYZ">quote:</font><HR>
CREATE DATABASE `fpcode`;

USE fpcode;

#
# Table structure for table `authors`
#

DROP TABLE IF EXISTS `authors`;
CREATE TABLE `authors` (
`author_id` smallint(6) NOT NULL auto_increment,
`author_account` varchar(32) NOT NULL default '',
`author_name` varchar(64) NOT NULL default '',
`author_email` varchar(128) NOT NULL default '',
`author_pic` varchar(255) default NULL,
`author_password` varchar(32) NOT NULL default '',
PRIMARY KEY (`author_id`)
) TYPE=MyISAM;
<HR></BLOCKQUOTE>

而正確的應該是

<BLOCKQUOTE><font size="1" face="XYZ">quote:</font><HR>
CREATE DATABASE fpcode;

USE fpcode;

#
# Table structure for table authors
#

DROP TABLE IF EXISTS authors;
CREATE TABLE authors (
author_id smallint(6) NOT NULL auto_increment,
author_account varchar(32) NOT NULL default '',
author_name varchar(64) NOT NULL default '',
author_email varchar(128) NOT NULL default '',
author_pic varchar(255) default NULL,
author_password varchar(32) NOT NULL default '',
PRIMARY KEY (author_id)
) TYPE=MyISAM;
<HR></BLOCKQUOTE>

在使用名稱上,是不可以用"`"符號!

還有,
<BLOCKQUOTE><font size="1" face="XYZ">quote:</font><HR>
DROP TABLE IF EXISTS `stories`;
CREATE TABLE `stories` (
`story_id` int(11) NOT NULL auto_increment,
`active` tinyint(4) NOT NULL default '0',
`story_title` text NOT NULL,
`story_text` longtext NOT NULL,
`story_more` longtext,
`post_time` datetime default NULL,
`type_id` tinyint(6) NOT NULL default '0',
`author_id` smallint(6) NOT NULL default '0',
`pic_link` varchar(255) NOT NULL default '',
`story_link` varchar(255) default NULL,
`ubb_link` varchar(255) default NULL,
`is_key_item` tinyint(4) NOT NULL default '0',
`is_report` tinyint(4) NOT NULL default '0',
`updated` tinyint(4) NOT NULL default '0',
PRIMARY KEY (`story_id`),
KEY `is_report` (`is_report`),
KEY `is_key_item` (`is_key_item`),
KEY `post_time` (`post_time`)
) TYPE=MyISAM;
<HR></BLOCKQUOTE>

其中的
`post_time` datetime default NULL,
似乎有問題,我將其改為
`post_time` timestamp(14) NOT NULL,
就OK了(但是"`"符號還是要拿掉!)

目前測試至此,有後續再繼續報告!
頭像
bryanchang
討論區管理員
文章: 7057
註冊時間: 04/19/2001 1:01 am
來自: The '60s
聯繫:

在P2-200 + RedHat環境安裝fpcode 0.9!

#2 文章 bryanchang »

感謝 CJ 的回應,以下是我的一些觀查:

1. 其實 PHP 你只要用 4.0.x 即可;而 MySQL 只要用 3.2x.x 也就成了。

2. fpcode_0.9fc1.tgz解開後的目錄名稱有空格,你在 unix shell 下面的指令只要用倒斜線來做 escape 就可以了。例如:

cd FPCode\ 0.9fc1

3. fpcode.sql 裡面包在欄位名稱之間的「‵」這個符號是合法的,我不清楚為什麼在你的機器上會有問題,若是未來有其他的人遇到問題,我會把他們拿掉。

4. post_time 這個欄位必須要用 datetime 這種資料格式,否則可能會有問題,你可能還是最好改回。
頭像
cjtai
冰果室水電工
文章: 2226
註冊時間: 04/19/2001 1:01 am
來自: dark side in the earth.
聯繫:

在P2-200 + RedHat環境安裝fpcode 0.9!

#3 文章 cjtai »

<BLOCKQUOTE><font size="1" face="XYZ">quote
4. post_time 這個欄位必須要用 datetime 這種資料格式,否則可能會有問題,你可能還是最好改回。
那應該是:
post_time datetime default NULL,

還是:
post_time datetime NULL default,
頭像
cjtai
冰果室水電工
文章: 2226
註冊時間: 04/19/2001 1:01 am
來自: dark side in the earth.
聯繫:

在P2-200 + RedHat環境安裝fpcode 0.9!

#4 文章 cjtai »

<BLOCKQUOTE><font size="1" face="XYZ">quote:</font><HR> quote:
--------------------------------------------------------------------------------
4. post_time 這個欄位必須要用 datetime 這種資料格式,否則可能會有問題,你可能還是最好改回。
--------------------------------------------------------------------------------

那應該是:
post_time datetime default NULL,

還是:
post_time datetime NULL default,
<HR></BLOCKQUOTE>

發覺要改成這樣才成!
post_time datetime NOT NULL default '0000-00-00 00:00:00',
頭像
bryanchang
討論區管理員
文章: 7057
註冊時間: 04/19/2001 1:01 am
來自: The '60s
聯繫:

在P2-200 + RedHat環境安裝fpcode 0.9!

#5 文章 bryanchang »

好吧,也許這是 MySQLdump 的毛病,我會在未來版本的 FPCode 裡改正這些 SQL 的問題。
回覆文章