湖濱散記部落格的樹心幽徑[login][主頁]
303:20141030在fedora 19 裝moodle

(1)
[root@localhost webadm]# wget https://download.moodle.org/download.php/direct/stable27/moodle-latest-27.tgz
--2014-10-29 07:52:50--  https://download.moodle.org/download.php/direct/stable27/moodle-latest-27.tgz
正在查找主機 download.moodle.org (download.moodle.org)... 141.101.113.179, 141.101.112.179, 2400:cb00:2048:1::8d65:70b3, ...
正在連接 download.moodle.org (download.moodle.org)|141.101.113.179|:443... 連上了。
已送出 HTTP 要求,正在等候回應... 200 OK
長度: 34880610 (33M) [application/x-forcedownload]
Saving to: ‘moodle-latest-27.tgz.1’

100%[======================================>] 34,880,610  4.91MB/s   in 6.2s

2014-10-29 07:52:56 (5.40 MB/s) - ‘moodle-latest-27.tgz.1’ saved [34880610/34880610]

[root@localhost webadm]# mv moodle-latest-27.tgz.1 moodle-latest-27.tgz
mv:是否覆寫 ‘moodle-latest-27.tgz’? y
[root@localhost webadm]#

(2)
[root@localhost webadm]# tar xvzf moodle-latest-27.tgz

(3)

[root@localhost webadm]# mv moodle /usr/local/apache2/htdocs/
[root@localhost webadm]#
(4)
http://163.25.20.92/moodle/install.php

選擇一種語言:zw-th

(5)環境檢查失敗!

cURL PHP擴展
    必須安裝並啟用
Zip PHP擴展
    必須安裝並啟用

(6)
[root@localhost webadm]# yum install curl
Loaded plugins: langpacks, refresh-packagekit
Package curl-7.29.0-23.fc19.i686 already installed and latest version
Nothing to do
[root@localhost webadm]#

(7)rebuild php
[root@localhost webadm]# cd php-5.4.34
[root@localhost php-5.4.34]# ./configure --with-apxs2=/usr/local/apache2/bin/apxs  --with-mysql --with-jpeg-dir=/home/webadm/jpeg-6b --with-gd --with-curl
:

checking for cURL in default path... not found
configure: error: Please reinstall the libcurl distribution -
    easy.h should be in <curl-dir>/include/curl/
[root@localhost php-5.4.34]#

[root@localhost php-5.4.34]# ./configure --with-apxs2=/usr/local/apache2/bin/apxs  --with-mysql --with-jpeg-dir=/home/webadm/jpeg-6b --with-gd --with-curlwrappers



(8)
[root@localhost php-5.4.34]# make
:

Don't forget to run 'make test'.

[root@localhost php-5.4.34]# make test

[root@localhost php-5.4.34]# make install

[root@localhost php-5.4.34]# libtool --finish /home/webadm/php-5.4.34/libs

[root@localhost php-5.4.34]# /usr/local/apache2/bin/apachectl stop
httpd (no pid file) not running
[root@localhost php-5.4.34]# /usr/local/apache2/bin/apachectl start
[root@localhost php-5.4.34]#


[root@localhost php-5.4.34]# curl -V
curl 7.29.0 (i686-redhat-linux-gnu) libcurl/7.29.0 NSS/3.16.2 Basic ECC zlib/1.2.7 libidn/1.26 libssh2/1.4.3
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtsp scp sftp smtp smtps telnet tftp
Features: AsynchDNS GSS-Negotiate IDN IPv6 Largefile NTLM NTLM_WB SSL libz
[root@localhost php-5.4.34]# locate curl
[root@localhost php-5.4.34]# locate  curl-devel
[root@localhost php-5.4.34]# yum install  curl-devel
:

Installed:
  libcurl-devel.i686 0:7.29.0-23.fc19
Complete!
[root@localhost php-5.4.34]#

(9)
[root@localhost php-5.4.34]# ./configure --with-apxs2=/usr/local/apache2/bin/apxs  --with-mysql --with-jpeg-dir=/home/webadm/jpeg-6b --with-gd --with-curl
[root@localhost php-5.4.34]# make
:
Don't forget to run 'make test'.
[root@localhost php-5.4.34]# make test
Do you want to send this report now? [Yns]: n
[root@localhost php-5.4.34]# make install
[root@localhost php-5.4.34]# libtool --finish /home/webadm/php-5.4.34/libs

(10)
[root@localhost php-5.4.34]# ./configure --with-apxs2=/usr/local/apache2/bin/apxs  --with-mysql --with-jpeg-dir=/home/webadm/jpeg-6b --with-gd --with-curl  --enable-zip


[root@localhost php-5.4.34]# ./configure --with-apxs2=/usr/local/apache2/bin/apxs  --with-mysql --with-jpeg-dir=/home/webadm/jpeg-6b --with-gd --with-curl  --enable-zip --with-zlib
:
PEAR package PHP_Archive not insta
lled: generated phar will require PHP's phar extension be enabled.

[root@localhost php-5.4.34]# ./configure --with-apxs2=/usr/local/apache2/bin/apxs  --with-mysql --with-jpeg-dir=/home/webadm/jpeg-6b --with-gd --with-curl  --enable-zip --with-zlib --enable-mbstring

(11)
[root@localhost php-5.4.34]#  wget http://pear.php.net/go-pear.phar
--2014-10-30 07:55:33--  http://pear.php.net/go-pear.phar
:
2014-10-30 07:55:38 (789 KB/s) - ‘go-pear.phar’ saved [3673193/3673193]


[root@localhost php-5.4.34]# whereis php
php: /usr/bin/php /usr/lib/php /etc/php.ini /etc/php.d /usr/local/bin/php /usr/local/lib/php.ini /usr/local/lib/php /usr/local/php /usr/share/php /usr/share/man/man1/php.1.gz
[root@localhost php-5.4.34]# /usr/bin/php ./go-pear.phar

Below is a suggested file layout for your new PEAR installation.  To
change individual locations, type the number in front of the
directory.  Type 'all' to change all of them or simply press Enter to
accept these locations.

 1. Installation base ($prefix)                   : /usr
 2. Temporary directory for processing            : /tmp/pear/install
 3. Temporary directory for downloads             : /tmp/pear/install
 4. Binaries directory                            : /usr/bin
 5. PHP code directory ($php_dir)                 : /usr/share/pear
 6. Documentation directory                       : /usr/docs
 7. Data directory                                : /usr/data
 8. User-modifiable configuration files directory : /usr/cfg
 9. Public Web Files directory                    : /usr/www
10. Tests directory                               : /usr/tests
11. Name of configuration file                    : /etc/pear.conf

1-11, 'all' or Enter to continue:
Beginning install...
Configuration written to /etc/pear.conf...
Initialized registry...
Preparing to install...
installing phar:///home/webadm/php-5.4.34/go-pear.phar/PEAR/go-pear-tarballs/Archive_Tar-1.3.12.tar...
installing phar:///home/webadm/php-5.4.34/go-pear.phar/PEAR/go-pear-tarballs/Console_Getopt-1.3.1.tar...
installing phar:///home/webadm/php-5.4.34/go-pear.phar/PEAR/go-pear-tarballs/PEAR-1.9.5.tar...
installing phar:///home/webadm/php-5.4.34/go-pear.phar/PEAR/go-pear-tarballs/Structures_Graph-1.0.4.tar...
installing phar:///home/webadm/php-5.4.34/go-pear.phar/PEAR/go-pear-tarballs/XML_Util-1.2.3.tar...
PHP Warning:  date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in phar:///home/webadm/php-5.4.34/go-pear.phar/PEAR/Registry.php on line 1012
PHP Warning:  date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in phar:///home/webadm/php-5.4.34/go-pear.phar/PEAR/Registry.php on line 1012
PHP Warning:  date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in phar:///home/webadm/php-5.4.34/go-pear.phar/PEAR/Registry.php on line 1012
PHP Warning:  date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in phar:///home/webadm/php-5.4.34/go-pear.phar/PEAR/Registry.php on line 1012
install ok: channel://pear.php.net/Archive_Tar-1.3.12
install ok: channel://pear.php.net/Console_Getopt-1.3.1
install ok: channel://pear.php.net/Structures_Graph-1.0.4
install ok: channel://pear.php.net/XML_Util-1.2.3
install ok: channel://pear.php.net/PEAR-1.9.5
PEAR: Optional feature webinstaller available (PEAR's web-based installer)
PEAR: Optional feature gtkinstaller available (PEAR's PHP-GTK-based installer)
PEAR: Optional feature gtk2installer available (PEAR's PHP-GTK2-based installer)
PEAR: To install optional features use "pear install pear/PEAR#featurename"

** WARNING! Backed up old pear to /usr/local/bin/pear_old

The 'pear' command is now at your service at /usr/bin/pear
[root@localhost php-5.4.34]#



(12)
[root@localhost php-5.4.34]# ./configure --with-apxs2=/usr/local/apache2/bin/apxs  --with-mysql --with-jpeg-dir=/home/webadm/jpeg-6b --with-gd --with-curl  --enable-zip --with-zlib --enable-mbstring
[root@localhost php-5.4.34]# make
:
PEAR package PHP_Archive not installed: generated phar will require PHP's phar extension be enabled.


[root@localhost php-5.4.34]# ./configure --with-apxs2=/usr/local/apache2/bin/apxs  --with-mysql --with-jpeg-dir=/home/webadm/jpeg-6b --with-gd --with-curl  --enable-zip --with-zlib --enable-mbstring --without-pear
[root@localhost php-5.4.34]# make
:
PEAR package PHP_Archive not installed: generated phar will require PHP's phar extension be enabled.
[root@localhost php-5.4.34]# ./configure --with-apxs2=/usr/local/apache2/bin/apxs  --with-mysql --with-jpeg-dir=/home/webadm/jpeg-6b --with-gd --with-curl  --enable-zip --with-zlib --enable-mbstring --enable-pear
[root@localhost php-5.4.34]# make
[root@localhost php-5.4.34]# make test
[root@localhost php-5.4.34]# make install
[root@localhost php-5.4.34]# libtool --finish /home/webadm/php-5.4.34/libs

(13)確認路徑
網站位址: http://163.25.20.92/moodle
Moodle目錄: /usr/local/apache2/htdocs/moodle
資料目錄:  /usr/local/apache2/moodledata

(14)
[root@localhost ~]# cd /usr/local/apache2/
[root@localhost apache2]# mkdir /usr/local/apache2/moodledata
[root@localhost apache2]# chmod 777 /usr/local/apache2/moodledata

(15)
選擇資料庫裝置:native/mysqli
資料庫主機:local
資料庫名稱:moodle
資料庫用戶名稱:root
資料庫密碼:
資料表名稱的前置字元:mdl_
資料庫端:
Unix socket:

PHP的MySQLi延伸套件沒有適當設置

(16)
[root@localhost php-5.4.34]# ./configure --with-apxs2=/usr/local/apache2/bin/apxs  --with-mysql --with-jpeg-dir=/home/webadm/jpeg-6b --with-gd --with-curl  --enable-zip --with-zlib --enable-mbstring --with-pear --with-mysqli
[root@localhost php-5.4.34]# make
[root@localhost php-5.4.34]# make test
[root@localhost php-5.4.34]# make install
[root@localhost php-5.4.34]# libtool --finish /home/webadm/php-5.4.34/libs

(17)
設定完成:
Moodle會嘗試將設定資料儲存在您的Moodle根目錄中。這個安裝程式無法自動將您所選擇的設定建立成config.php檔,這可能是因為Moodle目錄無法寫入。您可以手動複製下面的程式碼到Moodle的根目錄下,建立名為config.php的檔案中。
[root@localhost php-5.4.34]# vi /usr/local/apache2/htdocs/moodle/config.php
[root@localhost php-5.4.34]# cat /usr/local/apache2/htdocs/moodle/config.php
<?php  // Moodle configuration file

unset($CFG);
global $CFG;
$CFG = new stdClass();

$CFG->dbtype    = 'mysqli';
$CFG->dblibrary = 'native';
$CFG->dbhost    = 'localhost';
$CFG->dbname    = 'moodle';
$CFG->dbuser    = 'root';
$CFG->dbpass    = '??????';
$CFG->prefix    = 'mdl_';
$CFG->dboptions = array (
  'dbpersist' => 0,
  'dbport' => '',
  'dbsocket' => '',
);

$CFG->wwwroot   = 'http://163.25.20.92/moodle';
$CFG->dataroot  = '/usr/local/apache2/moodledata';
$CFG->admin     = 'admin';

$CFG->directorypermissions = 0777;

require_once(dirname(__FILE__) . '/lib/setup.php');

// There is no php closing tag in this file,
// it is intentional because it prevents trailing whitespace problems!
[root@localhost php-5.4.34]#


(18)
安裝Moodle - Modular Object-Oriented Dynamic Learning Environment
版權聲明
(19)
伺服器檢查
名稱     資訊     報表     外掛程式     狀態
database     mysql (5.0.27-log)     需求版本為5.5.31,而您目前版本為 5.0.27         檢查
php_extension     openssl     為了最佳效果,應該安裝並啟用

強烈建議您安裝 OpenSSL 函式庫,這樣才能夠使用 Moodle Networking功能
        檢查
php_extension     xmlrpc     為了最佳效果,應該安裝並啟用

xmlrpc延伸套件對於hub伺服器通訊是必須要的,而且Web Service網站服務和Moodle Networking功能也會用到。
        檢查
php_extension     soap     為了最佳效果,應該安裝並啟用

安裝選擇性的soap擴展,對於web services和某些外掛是有用的。
        檢查
php_extension     intl     為了最佳效果,應該安裝並啟用

intl延伸套件可以增強國際化支持,例如符合區域習慣的排序。
        檢查
php_setting     opcache.enable     PHP設定應該修改。

PHP的opcode快取可以改進效率並降低記憶體的需求,本系統建議使用,並完全支援OPCache擴展,
        檢查
unicode         必須安裝並啟用         好
php         需求版本為5.4.4,而您目前版本為 5.4.34         好
pcreunicode         為了最佳效果,應該安裝並啟用         好
php_extension     iconv     必須安裝並啟用         好
php_extension     mbstring     為了最佳效果,應該安裝並啟用         好
php_extension     curl     必須安裝並啟用         好
php_extension     tokenizer     為了最佳效果,應該安裝並啟用         好
php_extension     ctype     必須安裝並啟用         好
php_extension     zip     必須安裝並啟用         好
php_extension     zlib     必須安裝並啟用         好
php_extension     gd     必須安裝並啟用         好
php_extension     simplexml     必須安裝並啟用         好
php_extension     spl     必須安裝並啟用         好
php_extension     pcre     必須安裝並啟用         好
php_extension     dom     必須安裝並啟用         好
php_extension     xml     必須安裝並啟用         好
php_extension     json     必須安裝並啟用         好
php_extension     hash     必須安裝並啟用         好
php_setting     memory_limit     檢測到建議設定         好
php_setting     file_uploads     檢測到建議設定         好
在開始安裝這個 Moodle 版本前,您必須修正上述所有環境問題(錯誤)!

(20)
[root@localhost php-5.4.34]# ./configure --with-apxs2=/usr/local/apache2/bin/apxs  --with-mysql --with-jpeg-dir=/home/webadm/jpeg-6b --with-gd --with-curl  --enable-zip --with-zlib --enable-mbstring --with-pear --with-mysqli --with-xmlrpc --with-openssl --with-libxml-dir

:
configure: error: Cannot find OpenSSL's <evp.h>

[root@localhost php-5.4.34]# yum install openssl
Updated:
  openssl.i686 1:1.0.1e-40.fc19

Dependency Updated:
  openssl-libs.i686 1:1.0.1e-40.fc19

Complete!


select id,article_id,topic,text from lt_articles_text where article_id =303; ok. update lt_articles set num_reads=num_reads +1 where id=303; ok.