2009年6月アーカイブ

macportsでphp5をアップグレードした。

php5 @5.2.9_2+apache2+macosx+mysql5+pear+postgresql82+sqlite
 ↓
php5 @5.2.10_0+apache2+macosx+mysql5+pear+postgresql82+sqlite

すると、以下のエラー。

(追記: 後日、php5 @5.2.10_1が出たのでアップグレードしたら何の問題もなかった。)

$ sudo port upgrade php5
--->  Fetching php5
--->  Verifying checksum(s) for php5
--->  Extracting php5
--->  Applying patches to php5
--->  Configuring php5
--->  Building php5
--->  Staging php5 into destroot
Warning: php5 requests to install files outside the common directory structure!
--->  Deactivating php5 @5.2.9_2+apache2+macosx+mysql5+pear+postgresql82+sqlite
--->  Installing php5 @5.2.10_0+apache2+macosx+mysql5+pear+postgresql82+sqlite
--->  Activating php5 @5.2.10_0+apache2+macosx+mysql5+pear+postgresql82+sqlite
Error: Target org.macports.activate returned: Image error: /opt/local/lib/php/.registry/xml_util.reg already exists and does not belong to a registered port.  Unable to activate port php5.

最後のフェーズのactivateで失敗している。(ファイルのコピーでエラー)
-f オプションを付けて、強制的にactivateした。

$ sudo port -f activate php5 @5.2.10_0+apache2+macosx+mysql5+pear+postgresql82+sqlite
Password:
--->  Activating php5 @5.2.10_0+apache2+macosx+mysql5+pear+postgresql82+sqlite
Warning: File /opt/local/lib/php/.registry/xml_util.reg already exists.  Moving to: /opt/local/lib/php/.registry/xml_util.reg.mp_1246068080.
Warning: File /opt/local/lib/php/doc/XML_Util/examples/example.php already exists.  Moving to: /opt/local/lib/php/doc/XML_Util/examples/example.php.mp_1246068080.
Warning: File /opt/local/lib/php/doc/XML_Util/examples/example2.php already exists.  Moving to: /opt/local/lib/php/doc/XML_Util/examples/example2.php.mp_1246068080.
Warning: File /opt/local/lib/php/test/XML_Util/tests/AllTests.php already exists.  Moving to: /opt/local/lib/php/test/XML_Util/tests/AllTests.php.mp_1246068080.
Warning: File /opt/local/lib/php/test/XML_Util/tests/testBasic_apiVersion.phpt already exists.  Moving to: /opt/local/lib/php/test/XML_Util/tests/testBasic_apiVersion.phpt.mp_1246068080.
Warning: File /opt/local/lib/php/test/XML_Util/tests/testBasic_attributesToString.phpt already exists.  Moving to: /opt/local/lib/php/test/XML_Util/tests/testBasic_attributesToString.phpt.mp_1246068080.
Warning: File /opt/local/lib/php/test/XML_Util/tests/testBasic_collapseEmptyTags.phpt already exists.  Moving to: /opt/local/lib/php/test/XML_Util/tests/testBasic_collapseEmptyTags.phpt.mp_1246068080.
Warning: File /opt/local/lib/php/test/XML_Util/tests/testBasic_createCDataSection.phpt already exists.  Moving to: /opt/local/lib/php/test/XML_Util/tests/testBasic_createCDataSection.phpt.mp_1246068080.
Warning: File /opt/local/lib/php/test/XML_Util/tests/testBasic_createComment.phpt already exists.  Moving to: /opt/local/lib/php/test/XML_Util/tests/testBasic_createComment.phpt.mp_1246068080.
Warning: File /opt/local/lib/php/test/XML_Util/tests/testBasic_createEndElement.phpt already exists.  Moving to: /opt/local/lib/php/test/XML_Util/tests/testBasic_createEndElement.phpt.mp_1246068080.
Warning: File /opt/local/lib/php/test/XML_Util/tests/testBasic_createStartElement.phpt already exists.  Moving to: /opt/local/lib/php/test/XML_Util/tests/testBasic_createStartElement.phpt.mp_1246068080.
Warning: File /opt/local/lib/php/test/XML_Util/tests/testBasic_createTag.phpt already exists.  Moving to: /opt/local/lib/php/test/XML_Util/tests/testBasic_createTag.phpt.mp_1246068080.
Warning: File /opt/local/lib/php/test/XML_Util/tests/testBasic_createTagFromArray.phpt already exists.  Moving to: /opt/local/lib/php/test/XML_Util/tests/testBasic_createTagFromArray.phpt.mp_1246068080.
Warning: File /opt/local/lib/php/test/XML_Util/tests/testBasic_getDocTypeDeclaration.phpt already exists.  Moving to: /opt/local/lib/php/test/XML_Util/tests/testBasic_getDocTypeDeclaration.phpt.mp_1246068080.
Warning: File /opt/local/lib/php/test/XML_Util/tests/testBasic_getXmlDeclaration.phpt already exists.  Moving to: /opt/local/lib/php/test/XML_Util/tests/testBasic_getXmlDeclaration.phpt.mp_1246068080.
Warning: File /opt/local/lib/php/test/XML_Util/tests/testBasic_isValidName.phpt already exists.  Moving to: /opt/local/lib/php/test/XML_Util/tests/testBasic_isValidName.phpt.mp_1246068080.
Warning: File /opt/local/lib/php/test/XML_Util/tests/testBasic_raiseError.phpt already exists.  Moving to: /opt/local/lib/php/test/XML_Util/tests/testBasic_raiseError.phpt.mp_1246068080.
Warning: File /opt/local/lib/php/test/XML_Util/tests/testBasic_replaceEntities.phpt already exists.  Moving to: /opt/local/lib/php/test/XML_Util/tests/testBasic_replaceEntities.phpt.mp_1246068080.
Warning: File /opt/local/lib/php/test/XML_Util/tests/testBasic_reverseEntities.phpt already exists.  Moving to: /opt/local/lib/php/test/XML_Util/tests/testBasic_reverseEntities.phpt.mp_1246068080.
Warning: File /opt/local/lib/php/test/XML_Util/tests/testBasic_splitQualifiedName.phpt already exists.  Moving to: /opt/local/lib/php/test/XML_Util/tests/testBasic_splitQualifiedName.phpt.mp_1246068080.
Warning: File /opt/local/lib/php/test/XML_Util/tests/testBug_4950.phpt already exists.  Moving to: /opt/local/lib/php/test/XML_Util/tests/testBug_4950.phpt.mp_1246068080.
Warning: File /opt/local/lib/php/test/XML_Util/tests/testBug_5392.phpt already exists.  Moving to: /opt/local/lib/php/test/XML_Util/tests/testBug_5392.phpt.mp_1246068080.
Warning: File /opt/local/lib/php/XML/Util.php already exists.  Moving to: /opt/local/lib/php/XML/Util.php.mp_1246068080.

カテゴリー:

カテゴリー:

現在実行中のメソッド名を取得する MethodBase.GetCurrentMethod()

System.Reflection.MethodBase.GetCurrentMethod().Name

カテゴリー:

カテゴリー:

RewriteRuleのenvフラグで環境変数をセットしておき、RequestHeader append で使う。

  RewriteEngine on
  RewriteRule ^/(.*)$ http://appserver/$1 [P,L,QSA,env=ORG_REMOTE_ADDR:%{REMOTE_ADDR}]
  ProxyPassReverse / http://appserver/
  RequestHeader append X_ORG_REMOTE_ADDR %{ORG_REMOTE_ADDR}e env=ORG_REMOTE_ADDR
  RequestHeader append X-Forwarded-Proto https

mod_rewrite - Apache HTTP Server

たまねぎプログラマハマリ日記:Apache内のCGI環境変数をTomcatに渡す。 - livedoor Blog(ブログ)

カテゴリー:

カテゴリー:

カテゴリー:

カテゴリー:

-exec command \;

検索後、コマンドcommandを実行する。検索結果をcommandに引き渡すのに{}をもちいる。

例:
find ~ -name '*bak" -exec rm {} \;

上記の例で-execにつづくrm {} \;が実行されるコマンド。最後の";"は-execのパラメタの終わりを示しており、その前の"\"は、";"がシェルに解釈されないようにエスケープする為のもの。

例: ホームディレクトリ以下にある*~(emacsのバックアップファイル)を全て削除
$ find ~/ -name "*~" -exec rm {} \;
Subversionの作業コピーディレクトリから.svnディレクトリを全て削除する。
find . -name .svn -exec rm -rf {} \;
ディレクトリ配下のファイルをgrepする
find ディレクトリ -type f -exec grep 文字列 {} \;

カテゴリー:

MySQLでは、サブクエリ FROM 節と更新対象の両方に同じテーブルを使用することはでき
ない。

mysql> delete from user \
    -> where user.id in \
    -> (select user.id from user \
    -> left join reserve_data on user.id = reserve_data.user_id where reserve_data.id is null);
ERROR 1093 (HY000): You can't specify target table 'user' for update in FROM clause

このような場合は、以下のようにする。

mysql> delete from user \
    -> where user.id in \
    -> (select x.id from \
    -> (select user.id from user left join reserve_data on user.id = reserve_data.user_id where reserve_data.id is null) \
    -> as x \
    -> );
Query OK, 350 rows affected (0.00 sec)

こうすると、暗黙的に一時テーブルが作成されるので、うまくいく。

MySQL :: MySQL 5.1 リファレンスマニュアル :: 12.2.8.9 サブクエリ エラー

SQL Delete: can't specify target table for update in FROM clause - Stack Overflow

カテゴリー:

カテゴリー:

symfonyのschema.ymlで、MySQLのLONGTEXTを指定したい場合は、clobを指定する。
longvarcharだと、TEXTになる。

カテゴリー:

カテゴリー:

カテゴリー:

カテゴリー:

1

このアーカイブについて

このページには、2009年6月に書かれたブログ記事が新しい順に公開されています。

前のアーカイブは2009年5月です。

次のアーカイブは2009年7月です。

最近のコンテンツはインデックスページで見られます。過去に書かれたものはアーカイブのページで見られます。