さんきゅう堂的_バックアップ

 
  

 PHP_PEAR で大苦戦!

/etc/php5/cli/php.ini
/etc/php5/apache2/php.ini

include_path = ".:/usr/lib/php:/usr/share/php:/usr/share/php5:/usr/share/php5/PEAR"

# pear config-show
Configuration (channel pear.php.net):
=====================================
Auto-discover new Channels     auto_discover    <not set>
Default Channel                default_channel  pear.php.net
HTTP Proxy Server Address      http_proxy       <not set>
PEAR server [DEPRECATED]       master_server    pear.php.net
Default Channel Mirror         preferred_mirror pear.php.net
Remote Configuration File      remote_config    <not set>
PEAR executables directory     bin_dir          /usr/bin
PEAR documentation directory   doc_dir          /usr/share/php/docs
PHP extension directory        ext_dir          /usr/lib64/php5/extensions
PEAR directory                 php_dir          /usr/share/php
PEAR Installer cache directory cache_dir        /tmp/pear/cache
PEAR data directory            data_dir         /usr/share/php/data
PEAR Installer download        download_dir     /usr/temp/download
directory
PHP CLI/CGI binary             php_bin          /usr/bin/php5
php.ini location               php_ini          <not set>
PEAR Installer temp directory  temp_dir         /usr/temp
PEAR test directory            test_dir         /usr/share/php/tests
Cache TimeToLive               cache_ttl        3600
Preferred Package State        preferred_state  stable
Unix file mask                 umask            22
Debug Log Level                verbose          1
PEAR password (for             password         <not set>
maintainers)
Signature Handling Program     sig_bin          /usr/local/bin/gpg
Signature Key Directory        sig_keydir       /etc/php5/cli/pearkeys
Signature Key Id               sig_keyid        <not set>
Package Signature Type         sig_type         gpg
PEAR username (for             username         <not set>
maintainers)
User Configuration File        Filename         /root/.pearrc
System Configuration File      Filename         /etc/php5/cli/pear.conf


# pear5 install Pear_Info
WARNING: channel "pear.php.net" has updated its protocols, use "channel-update pear.php.net" to update
Did not download optional dependencies: pear/XML_RPC, use --alldeps to download automatically
pear/PEAR can optionally use package "pear/XML_RPC" (version >= 1.4.0)
downloading PEAR_Info-1.7.0.tgz ...
Starting to download PEAR_Info-1.7.0.tgz (56,638 bytes)
..............done: 56,638 bytes
downloading PEAR-1.6.2.tgz ...
Starting to download PEAR-1.6.2.tgz (297,794 bytes)
...done: 297,794 bytes
downloading Archive_Tar-1.3.2.tgz ...
Starting to download Archive_Tar-1.3.2.tgz (17,150 bytes)
...done: 17,150 bytes
downloading Structures_Graph-1.0.2.tgz ...
Starting to download Structures_Graph-1.0.2.tgz (30,947 bytes)
...done: 30,947 bytes
downloading Console_Getopt-1.2.3.tgz ...
Starting to download Console_Getopt-1.2.3.tgz (4,011 bytes)
...done: 4,011 bytes
install ok: channel://pear.php.net/Archive_Tar-1.3.2
install ok: channel://pear.php.net/Structures_Graph-1.0.2
install ok: channel://pear.php.net/Console_Getopt-1.2.3
install ok: channel://pear.php.net/PEAR-1.6.2
install ok: channel://pear.php.net/PEAR_Info-1.7.0
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"

# pear install Pear_Info
Ignoring installed package pear/Pear_Info
Nothing to install

pear_info.php

<?php
require_once "PEAR/Info.php";

$info =& new PEAR_Info();
$info->show();
?>

エラー
PEAR configuration files /var/lib/apache2/.pearrc, /etc/php5/apache2/pear.conf does not exist

# ln -s /etc/php5/cli/pear.conf /etc/php5/apache2/pear.conf

http://example.com/pear_info.php
OK
  
  

 画像上任意の位置に画像とリンク

<!-- 日本地図上の任意の位置に画像を挿入 -->
<div style="text-align:center;">
<div style="display:block; position:relative; width:580px; height:550px; margin-left:auto; margin-right:auto;">
<!-- 日本地図画像 イメージ挿入、リンク共通 -->
<img src="イメージ.gif" alt="リンク先説明" title="" usemap="#map" style="border:none;">
<!-- 日本地図上の画像位置 -->
<img src="イメージ.gif" name="if1" width="120" height="95" frameborder="0" scrolling="auto" allowtransparency="true" style="position:absolute; left:240px; top:23px;">
<img src="イメージ.gif" name="if2" width="120" height="95" frameborder="0" scrolling="auto" allowtransparency="true" style="position:absolute; left:415px; top:280px;">
<img src="イメージ.gif" name="if3" width="120" height="95" frameborder="0" scrolling="auto" allowtransparency="true" style="position:absolute; left:290px; top:390px;">
<img src="イメージ.gif" name="if4" width="120" height="95" frameborder="0" scrolling="auto" allowtransparency="true" style="position:absolute; left:35px; top:260px;">
<img src="イメージ.gif" name="if5" width="120" height="95" frameborder="0" scrolling="auto" allowtransparency="true" style="position:absolute; left:160px; top:450px;">
</div><!-- text-align end -->
</div><!-- display end -->

<!-- 日本地図上県名にリンクを挿入 -->
<map name="map">
<area shape="circle" coords="410, 116, 29" href="http://リンク先" target="_blank" alt="リンク先説明" target="if1">
<area shape="circle" coords="347, 346, 15" href="http://リンク先" target="_blank" alt="リンク先説明" target="if2">
<area shape="circle" coords="260, 383, 15" href="http://リンク先" target="_blank" alt="リンク先説明" target="if3">
<area shape="circle" coords="162, 377, 15" href="http://リンク先" target="_blank" alt="リンク先説明" target="if4">
<area shape="circle" coords="160, 438, 15" href="http://リンク先" target="_blank" alt="リンク先説明" target="if5">
</map>
  
  

 G'S BBS v4 文字化け修正

VALUE DOMAIN CORESERVER用に変更。
MySQLをUnicodeで作成。
db内の文字化け無し。
吐き出し後、文字化け。

gsbbsv4/bbs/inc_files/conect_db.php
<?php
//データベース接続のパスワード等を設定します。
//★印の部分をお使いのサーバ環境に合わせて書き換えてください。

//MySQLホスト名
$SQL_HOST = "localhost";

//MySQLユーザー名
$SQL_U_NAME = "users";

//MySQLバスワード
$SQL_PASS = "password";

//MySQLデータベース名
$SQL_DB = "users_db";


/*
掲示板で使用するMySQLのテーブル名を設定します。
掲示板を複数設置する場合など必要に応じて変更して下さい。
*/
$BBS_TABLE = "GS_BBS"; //記事を格納するテーブル名


//▼データベースとの接続
$link = mysql_connect($SQL_HOST, $SQL_U_NAME, $SQL_PASS);
mysql_query("SET NAMES utf8"); //追記

if(!$link)
{
echo "MySQLとの接続に失敗しました。ユーザー名、パスワード等を確認してください。";
exit();
}

//▼$SQL_DBをアクティブなデータベースにする
$active_db = mysql_select_db($SQL_DB, $link);
mysql_query("SET NAMES utf8"); //追記
if(!$active_db)
{
echo "指定されたDBをアクティブにすることができませんでした。DB名等を確認してください。";
exit();
}

?>

  
  

 G'S BBS v4 文字化け修正

ホームページ、MySQL、PHPをUTF-8環境で使用中
削除処理後〇〇〇番のスレッドが文字化けする。
gsbbsv4/bbs/inc_files/mod_stat.inc 21行目
<td nowrap><?=$result_stat?></td>を<td nowrap><?=sjisconvert($result_stat)?></td>に変更。

gsbbsv4/bbs/inc_files/sjisconvert.incを以下に変更してあります。
<?php
function sjisconvert($str)
{
 $code_check = mb_detect_encoding($str);
 if(!eregi("utf8", $code_check) && $code_check != "")
  {
  $str = mb_convert_encoding($str, "utf8", "$code_check");
  }
 return $str;
}
?>