バージョン選択
フォーラム
メニュー
オンライン状況
|
|
72 人のユーザが現在オンラインです。 (66 人のユーザが フォーラム を参照しています。) |
|
|
機能要望 > その他 > 【Windows上での開発環境】XAMPPでApacheが落ちます |
|
その他
投稿者 |
スレッド |
ECCUORE |
投稿日時: 2010/8/5 12:48
対応状況: −−−
|
長老 登録日: 2009/10/22 居住地: 東京 投稿: 248 |
【Windows上での開発環境】XAMPPでApacheが落ちます 現在、2.5の開発環境をWindows上に作成している所で、問題が発生しました。 弊社では、XAMPPを利用してWindows上に開発環境を作ってます。 2.4系では起きなかったのですが、2.5にしてから下記の全てバージョンでApacheが異常終了します。 ・1.7.0 ・1.7.1 ・1.7.3 2.4系から2.5(コミュニティ版)で、エラーハンドリング部分に手が入ったので そこが怪しいのでは無いかと、調査をしている所です。 XAMPPを利用されている方は他にいらっしゃいますか? ---------------- EC CUORE 株式会社クオーレ カスタマイズ御相談下さい。
|
|
|
ECCUORE |
投稿日時: 2010/8/5 13:10
対応状況: −−−
|
長老 登録日: 2009/10/22 居住地: 東京 投稿: 248 |
Re: 【Windows上での開発環境】XAMPPでApacheが落ちます 現象としては、現在特定できているのは下記です。 ・DBがMySQL時にのみ発生(Postgresでは発生しない) ・管理者画面TopでApacheがエラーで終了する。(Apacheはその後、自動再起動する) ・管理者画面Topに関しては、MySQLでselect version();を実行している所をコメントアウトするとエラーが発生しなくなる。 ・ただし、管理者画面の他の画面でも同じようなエラーが発生してるので、select version();だけが原因ではなさそう。 エラーハンドルは関係無いかもしれないです。 ---------------- EC CUORE 株式会社クオーレ カスタマイズ御相談下さい。
|
|
|
nanasess |
投稿日時: 2010/8/5 14:18
対応状況: −−−
|
神 登録日: 2006/9/9 居住地: 投稿: 2313 |
Re: 【Windows上での開発環境】XAMPPでApacheが落ちます 環境が無いので, 再現できないのですが... SC_Query::getOne() の内部で PEAR::Error が発生していると思いますので, 下記のようにしてエラーのダンプを頂けますでしょうか.
function getOne($sql, $arrval = array()) {
$sql = $this->dbFactory->sfChangeMySQL($sql);
$sth = $this->conn->prepare($sql);
if (PEAR::isError($sth)) {
var_dump($sth);
return;
}
$affected = $sth->execute($arrval);
if (PEAR::isError($affected)) {
var_dump($affected);
//trigger_error($affected->getMessage(), E_USER_ERROR);
return;
}
return $affected->fetchOne();
}
MDB2 では, MySQL の特定のクエリに対して prepare() が実行できなくなくなっているようです. SC_Query::get_auto_increment() などは, MDB2::exec() に置きかえましたが, 同様の対応が必要かもしれません. あと, html/require.php 27 行目付近の下記をコメントアウトしても DBエラー発生時に Apache の強制終了は再現しますでしょうか?
require_once HTML_PATH . 'handle_error.php';
|
|
|
nanasess |
投稿日時: 2010/8/5 14:41
対応状況: −−−
|
神 登録日: 2006/9/9 居住地: 投稿: 2313 |
Re: 【Windows上での開発環境】XAMPPでApacheが落ちます 強制終了してしまうのは,
$objQuery = new SC_Query($dsn, true, true);
と, SC_Query のコンストラクタの第二引数に true を設定している箇所ですかね? ずいぶん前から, この引数は無効でした. しかし, SC_Query 内部で, DBエラーが発生しても, 処理を止めてはいけないケースがあったりする(インストーラのテーブルチェックなど)ので, エラーが発生してもエラー画面を表示させずに処理を続行するオプションとして利用しようかなと思っています. 具体的には, このオプションが有効の場合は, trigger_error をスローせず, PEAR::Error を返して return するように考えています.
|
|
|
ECCUORE |
投稿日時: 2010/8/5 15:29
対応状況: −−−
|
長老 登録日: 2009/10/22 居住地: 東京 投稿: 248 |
Re: 【Windows上での開発環境】XAMPPでApacheが落ちます 返信ありがとうございます。 getOneの箇所でPEAR::Errorが発生していないようです。 (前述のログが出力されませんでした) html/require.phpのコメントアウトも事前に行ってみたのですが、結果は同じでした。 管理者TOP画面で落ちている原因を探ってみましたが、画面自体は表示されますので強制終了の場所はわかりませんでした。 原因と思しき箇所としては、data/class/pages/admin/LC_Page_Admin_Home.phpの64行目付近がエラーが発生してるようです。 <エラー発生するケース>
// DBバージョンの取得
$objDb = new SC_Helper_DB_Ex();
$this->db_version = $objDb->sfGetDBVersion();
下記のように変更した場合、エラーが発生しなくなりました。 <エラー発生しないケース>
// DBバージョンの取得
$this->db_version = $objQuery->getOne("select version()");
2つのケースを比べると、行ってる事にそう大差ないので 特定のSQLを発行したらエラーとなるようなケースや、特定のメソッドを読んで起こる問題では無く、実装の仕方によるものではないかと思われます。。 エラー発生ケースのみに出力されるエラーログが下記です。handle_errorでSTRICTも出力するようにしたものです。
[error] [client 127.0.0.1] handle_error Error(2048) \\xampp\\htdocs\\version-2_5-dev\\data\\class\\helper\\SC_Helper_DB.php:57 Non-static method SC_DB_DBFactory_Ex::getInstance() should not be called statically, assuming $this from incompatible context
[error] [client 127.0.0.1] handle_error Error(2048) \\xampp\\htdocs\\version-2_5-dev\\data\\class\\SC_Query.php:61 Non-static method MDB2::connect() should not be called statically, assuming $this from incompatible context
[error] [client 127.0.0.1] handle_error Error(2048) \\xampp\\htdocs\\version-2_5-dev\\data\\module\\MDB2.php:436 Non-static method MDB2::factory() should not be called statically, assuming $this from incompatible context
[error] [client 127.0.0.1] handle_error Error(2048) \\xampp\\htdocs\\version-2_5-dev\\data\\module\\MDB2.php:379 Non-static method MDB2::parseDSN() should not be called statically, assuming $this from incompatible context
[error] [client 127.0.0.1] handle_error Error(2048) \\xampp\\htdocs\\version-2_5-dev\\data\\module\\MDB2.php:388 Non-static method MDB2::loadClass() should not be called statically, assuming $this from incompatible context
[error] [client 127.0.0.1] handle_error Error(2048) \\xampp\\htdocs\\version-2_5-dev\\data\\module\\MDB2.php:330 Non-static method MDB2::classExists() should not be called statically, assuming $this from incompatible context
[error] [client 127.0.0.1] handle_error Error(2048) \\xampp\\htdocs\\version-2_5-dev\\data\\module\\MDB2.php:389 Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context
[error] [client 127.0.0.1] handle_error Error(2048) \\xampp\\htdocs\\version-2_5-dev\\data\\module\\PEAR.php:269 is_a(): Deprecated. Please use the instanceof operator
[error] [client 127.0.0.1] handle_error Error(2048) \\xampp\\htdocs\\version-2_5-dev\\data\\module\\MDB2.php:2353 Non-static method MDB2::parseDSN() should not be called statically, assuming $this from incompatible context
[error] [client 127.0.0.1] handle_error Error(2048) \\xampp\\htdocs\\version-2_5-dev\\data\\module\\MDB2.php:395 Non-static method MDB2::setOptions() should not be called statically, assuming $this from incompatible context
[error] [client 127.0.0.1] handle_error Error(2048) \\xampp\\htdocs\\version-2_5-dev\\data\\module\\MDB2.php:287 Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context
[error] [client 127.0.0.1] handle_error Error(2048) \\xampp\\htdocs\\version-2_5-dev\\data\\module\\PEAR.php:269 is_a(): Deprecated. Please use the instanceof operator
[error] [client 127.0.0.1] handle_error Error(2048) \\xampp\\htdocs\\version-2_5-dev\\data\\module\\MDB2.php:287 Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context
[error] [client 127.0.0.1] handle_error Error(2048) \\xampp\\htdocs\\version-2_5-dev\\data\\module\\PEAR.php:269 is_a(): Deprecated. Please use the instanceof operator
[error] [client 127.0.0.1] handle_error Error(2048) \\xampp\\htdocs\\version-2_5-dev\\data\\module\\MDB2.php:396 Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context
[error] [client 127.0.0.1] handle_error Error(2048) \\xampp\\htdocs\\version-2_5-dev\\data\\module\\PEAR.php:269 is_a(): Deprecated. Please use the instanceof operator
[error] [client 127.0.0.1] handle_error Error(2048) \\xampp\\htdocs\\version-2_5-dev\\data\\module\\MDB2.php:437 Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context
[error] [client 127.0.0.1] handle_error Error(2048) \\xampp\\htdocs\\version-2_5-dev\\data\\module\\PEAR.php:269 is_a(): Deprecated. Please use the instanceof operator
[error] [client 127.0.0.1] handle_error Error(2048) \\xampp\\htdocs\\version-2_5-dev\\data\\module\\PEAR.php:269 is_a(): Deprecated. Please use the instanceof operator
[error] [client 127.0.0.1] handle_error Error(2048) \\xampp\\htdocs\\version-2_5-dev\\data\\module\\MDB2\\Driver\\mysql.php:563 Non-static method MDB2::areEquals() should not be called statically, assuming $this from incompatible context
[error] [client 127.0.0.1] handle_error Error(2048) \\xampp\\htdocs\\version-2_5-dev\\data\\module\\PEAR.php:269 is_a(): Deprecated. Please use the instanceof operator
[error] [client 127.0.0.1] handle_error Error(2048) \\xampp\\htdocs\\version-2_5-dev\\data\\module\\PEAR.php:269 is_a(): Deprecated. Please use the instanceof operator
[error] [client 127.0.0.1] handle_error Error(2048) \\xampp\\htdocs\\version-2_5-dev\\data\\module\\MDB2.php:442 Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context
[error] [client 127.0.0.1] handle_error Error(2048) \\xampp\\htdocs\\version-2_5-dev\\data\\module\\PEAR.php:269 is_a(): Deprecated. Please use the instanceof operator
[error] [client 127.0.0.1] handle_error Error(2048) \\xampp\\htdocs\\version-2_5-dev\\data\\class\\SC_Query.php:80 Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context
[error] [client 127.0.0.1] handle_error Error(2048) \\xampp\\htdocs\\version-2_5-dev\\data\\module\\MDB2.php:1008 Non-static method MDB2::errorMessage() should not be called statically, assuming $this from incompatible context
[error] [client 127.0.0.1] handle_error Error(2048) \\xampp\\htdocs\\version-2_5-dev\\data\\module\\MDB2.php:779 Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context
[error] [client 127.0.0.1] handle_error Error(2048) \\xampp\\htdocs\\version-2_5-dev\\data\\module\\PEAR.php:269 is_a(): Deprecated. Please use the instanceof operator
[error] [client 127.0.0.1] handle_error Error(2048) \\xampp\\htdocs\\version-2_5-dev\\data\\module\\PEAR.php:856 Non-static method PEAR::getStaticProperty() should not be called statically, assuming $this from incompatible context
[error] [client 127.0.0.1] handle_error Error(2048) \\xampp\\htdocs\\version-2_5-dev\\data\\class\\SC_Query.php:70 Non-static method SC_DB_DBFactory_Ex::getInstance() should not be called statically, assuming $this from incompatible context
[error] [client 127.0.0.1] handle_error Error(2048) \\xampp\\htdocs\\version-2_5-dev\\data\\module\\PEAR.php:269 is_a(): Deprecated. Please use the instanceof operator
[error] [client 127.0.0.1] handle_error Error(2048) \\xampp\\htdocs\\version-2_5-dev\\data\\module\\MDB2\\Driver\\mysql.php:563 Non-static method MDB2::areEquals() should not be called statically, assuming $this from incompatible context
[error] [client 127.0.0.1] handle_error Error(2048) \\xampp\\htdocs\\version-2_5-dev\\data\\module\\PEAR.php:269 is_a(): Deprecated. Please use the instanceof operator
[error] [client 127.0.0.1] handle_error Error(2048) \\xampp\\htdocs\\version-2_5-dev\\data\\module\\PEAR.php:269 is_a(): Deprecated. Please use the instanceof operator
[error] [client 127.0.0.1] handle_error Error(2048) \\xampp\\htdocs\\version-2_5-dev\\data\\module\\MDB2.php:1911 Non-static method MDB2::classExists() should not be called statically, assuming $this from incompatible context
[error] [client 127.0.0.1] handle_error Error(2048) \\xampp\\htdocs\\version-2_5-dev\\data\\module\\MDB2.php:1918 Non-static method MDB2::loadClass() should not be called statically, assuming $this from incompatible context
[error] [client 127.0.0.1] handle_error Error(2048) \\xampp\\htdocs\\version-2_5-dev\\data\\module\\MDB2.php:330 Non-static method MDB2::classExists() should not be called statically, assuming $this from incompatible context
[error] [client 127.0.0.1] handle_error Error(2048) \\xampp\\htdocs\\version-2_5-dev\\data\\module\\PEAR.php:269 is_a(): Deprecated. Please use the instanceof operator
[error] [client 127.0.0.1] handle_error Error(2048) \\xampp\\htdocs\\version-2_5-dev\\data\\module\\MDB2.php:1937 Non-static method MDB2::classExists() should not be called statically, assuming $this from incompatible context
[error] [client 127.0.0.1] handle_error Error(2048) \\xampp\\htdocs\\version-2_5-dev\\data\\module\\PEAR.php:269 is_a(): Deprecated. Please use the instanceof operator
---------------- EC CUORE 株式会社クオーレ カスタマイズ御相談下さい。
|
|
|
nanasess |
投稿日時: 2010/8/6 15:31
対応状況: −−−
|
神 登録日: 2006/9/9 居住地: 投稿: 2313 |
Re: 【Windows上での開発環境】XAMPPでApacheが落ちます Windows 環境を用意してみました.
---------------------------------------- DBサーバ MySQL 5.0.45-community-nt WEBサーバ Apache/2.2.15 (Win32) PHP/5.2.13 PHP 5.2.13 OS WIndows XP ----------------------------------------
XAMPP を使用せず, それぞれ個別にインストールしましたが, こちらの環境でも再現しました. 発現位置については, 管理画面TOP には変わりないのですが, 何らかの DB アクセスをしようとすると Apache が強制終了するようです.
本日時点のコミュニティ版(r18755) では再現しませんので, どうやら MDB2 の対応が関連していそうな感じです.
MDB2 に対応するため, include_path を書きかえたりと, 結構強引なことをしているので, もう少し調べてみます.
|
|
|
seasoft |
投稿日時: 2010/8/8 14:01
対応状況: −−−
|
神 登録日: 2008/6/4 居住地: 投稿: 7367 |
Re: 【Windows上での開発環境】XAMPPでApacheが落ちます 関連があるかもしれない現象を別途投稿いたしました。 http://xoops.ec-cube.net/modules/newbb/viewtopic.php?topic_id=6512&forum=14 ---------------- Seasoft こちらでの投稿は、アイディア程度に留めさせていただいております。 個別案件の作業は有償で承っております。お気軽にご相談ください。
|
|
|
ECCUORE |
投稿日時: 2010/8/9 11:29
対応状況: −−−
|
長老 登録日: 2009/10/22 居住地: 東京 投稿: 248 |
Re: 【Windows上での開発環境】XAMPPでApacheが落ちます 今回の件は、SC_DB_DBFactoryとSC_Queryの循環参照の問題は関係無いでしょうか? 直接関係無いかもしれませんが、質問があります。 SC_DB_DBFactoryとSC_QueryとSC_Helper_DBの関係性についてです。 SC_DB_DBFactoryは、Factoryと名が付いていますが、実際はファクトリークラスとしてだけでは無いように見えます。 SC_DB_DBFactoryが各DBに応じたオブジェクト(SC_QueryかSC_Helper_DB)を返すのが良い気がしますが、どうでしょうか? 具体的な実装提案としては、 今のSC_Helper_DBをベースとして、SC_Helper_DB_MYSQL、SC_Helper_DB_PGSQLを作り、SC_DB_DBFactory_MYSQL、PGSQLにある固有の処理を移す。(SC_Queryも同様) DBアクセスの経路は、SC_DB_DBFactory::getHelper_DBInstance と SC_DB_DBFactory::getQueryInstance で返るオブジェクトの2経路に絞る。 ---------------- EC CUORE 株式会社クオーレ カスタマイズ御相談下さい。
|
|
|
nanasess |
投稿日時: 2010/8/9 13:34
対応状況: −−−
|
神 登録日: 2006/9/9 居住地: 投稿: 2313 |
Re: 【Windows上での開発環境】XAMPPでApacheが落ちます 引用: ECCUOREさんは書きました: 今回の件は、SC_DB_DBFactoryとSC_Queryの循環参照の問題は関係無いでしょうか?
可能性あると思います. しかし以前も, SC_Query の中で SC_DbConn のインスタンスを生成しており, 結果的に循環参照していたはずなんですけどね... 引用: 直接関係無いかもしれませんが、質問があります。 SC_DB_DBFactoryとSC_QueryとSC_Helper_DBの関係性についてです。
SC_DB_DBFactoryは、Factoryと名が付いていますが、実際はファクトリークラスとしてだけでは無いように見えます。 SC_DB_DBFactoryが各DBに応じたオブジェクト(SC_QueryかSC_Helper_DB)を返すのが良い気がしますが、どうでしょうか?
具体的な実装提案としては、 今のSC_Helper_DBをベースとして、SC_Helper_DB_MYSQL、SC_Helper_DB_PGSQLを作り、SC_DB_DBFactory_MYSQL、PGSQLにある固有の処理を移す。(SC_Queryも同様) DBアクセスの経路は、SC_DB_DBFactory::getHelper_DBInstance と SC_DB_DBFactory::getQueryInstance で返るオブジェクトの2経路に絞る。
元々の設計思想としては, SC_Query を直接呼ばずに SC_DB_DBFactory のみにしたかったのです. SC_Helper_DB は, SC_DB_DBFactory のヘルパーという位置付けです. しかし, 分散した SC_Query をすべて置き替えるだけの工数が割けませんでした. 今回も, スケジュール的には if (DB_TYPE == と条件分岐している箇所を SC_DB_DBFactory に置き替えるだけで精一杯な気がします...
|
|
|
nanasess |
投稿日時: 2010/8/9 17:26
対応状況: −−−
|
神 登録日: 2006/9/9 居住地: 投稿: 2313 |
Re: 【Windows上での開発環境】XAMPPでApacheが落ちます 本件, 手元の環境では data/class/helper/SC_Helper_Session.php の 83行目を削除 or コメントアウトすることで解消しました.
--- a/data/class/helper/SC_Helper_Session.php
+++ b/data/class/helper/SC_Helper_Session.php
@@ -83,7 +83,6 @@
*/
function sfSessWrite($id, $sess_data)
{
- if (!$this->objDb->sfTabaleExists("dtb_session")) return false;
$objQuery = new SC_Query();
$count = $objQuery->count("dtb_session", "sess_id = ?", array($id));
$sqlval = array();
根本原因までは追い切れていませんが, とり急ぎご報告まで. やはり, SC_DB_DBFactory と SC_Query の循環参照が関係あるかもしれません. また, 該当の処理は不要だと思われますので, 削除してしまっても問題ないかと思われます.
|
|
|
|
統計情報
総メンバー数は88,865名です
総投稿数は109,999件です
|