Apache Tomcat/6.0.29

PHP Version 5.3.5


PHPを試めすためにTomcatのCGIを利用することにした。


PHPを早速ダウンロード

PHP 5.3.5とPHP 5.2.17の2つのバージョンがあるが迷わず最新の5.3.5へ

更に以下のバリエーションが用意されている。

VC9 x86 Non Thread Safe

VC9 x86 Thread Safe

VC6 x86 Non Thread Safe

VC6 x86 Thread Sqfe

このバリエーションの違いについて説明が無い。

おそらくThread Safeは多少パフォーマンスを犠牲にして共有メモリーが管理されているかと。

PHPのパフォーマンスを求めない限りThread Safeで良いと予測がつく。

VC9とVC6は、コンパイルがVC++9.0とVC++6.0を指しているようだ。


不覚にもVC9を選んでしまったのだが、結論を言うとPHPをCGIで利用するのであればVC6を選択する必要がある。

VC9の場合、TomcatからPHPを呼び出してもリダイレクトが帰ってこないのだが、エラーログも無い。

Tomcatは問題なく動作しているし、コマンドプロンプト上からもphp-cgi.exeは動作が確認できている。

これは設定かと思い散々いじってみたが直らない。

気を取り直し、VC9版を削除VC6版に入れ替えたところ問題なく動いた。


コンテクスト配下のweb.xmlはこんな感じ


<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<web-app xmlns="http://java.sun.com/xml/ns/javaee "
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance "
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd "
version="2.5">

<display-name>Welcome to PHP</display-name>
<description>Welcome to PHP </description>

<!-- Common Gateway Includes (CGI) processing servlet, which supports -->
<!-- execution of external applications that conform to the CGI spec -->
<!-- requirements. Typically, this servlet is mapped to the URL pattern -->
<!-- "/cgi-bin/*", which means that any CGI applications that are -->
<!-- executed must be present within the web application. This servlet -->
<!-- supports the following initialization parameters (default values -->
<!-- are in square brackets): -->
<!-- -->
<!-- cgiPathPrefix The CGI search path will start at -->
<!-- webAppRootDir + File.separator + this prefix. -->
<!-- [WEB-INF/cgi] -->
<!-- -->
<!-- debug Debugging detail level for messages logged -->
<!-- by this servlet. [0] -->
<!-- -->
<!-- executable Name of the executable used to run the -->
<!-- script. [perl] -->
<!-- -->
<!-- parameterEncoding Name of parameter encoding to be used with -->
<!-- CGI servlet. -->
<!-- [System.getProperty("file.encoding","UTF-8")] -->
<!-- -->
<!-- passShellEnvironment Should the shell environment variables (if -->
<!-- any) be passed to the CGI script? [false] -->
<!-- -->
<!-- stderrTimeout The time (in milliseconds) to wait for the -->
<!-- reading of stderr to complete before -->
<!-- terminating the CGI process. [2000] -->

<servlet>
<servlet-name>cgi</servlet-name>
<servlet-class>org.apache.catalina.servlets.CGIServlet</servlet-class>
<init-param>
<param-name>debug</param-name>
<param-value>0</param-value>
</init-param>
<init-param>
<param-name>executable</param-name>
<param-value>php-cgi</param-value>
</init-param>
<init-param>
<param-name>cgiPathPrefix</param-name>
<param-value>WEB-INF/cgi</param-value>
</init-param>
<load-on-startup>5</load-on-startup>
</servlet>

<!-- ================ Built In Servlet Mappings ========================= -->


<!-- The servlet mappings for the built in servlets defined above. Note -->
<!-- that, by default, the CGI and SSI servlets are *not* mapped. You -->
<!-- must uncomment these mappings (or add them to your application's own -->
<!-- web.xml deployment descriptor) to enable these services -->

<!-- The mapping for the CGI Gateway servlet -->
<servlet-mapping>
<servlet-name>cgi</servlet-name>
<url-pattern>/cgi-bin/*</url-pattern>
</servlet-mapping>


</web-app>

conf配下のcontext.xmlはこんな感じ


<?xml version='1.0' encoding='utf-8'?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<!-- The contents of this file will be loaded for each web application -->
<Context privileged="true">

<!-- Default set of monitored resources -->
<WatchedResource>WEB-INF/web.xml</WatchedResource>

<!-- Uncomment this to disable session persistence across Tomcat restarts -->
<!--
<Manager pathname="" />
-->

<!-- Uncomment this to enable Comet connection tacking (provides events
on session expiration as well as webapp lifecycle) -->
<!--
<Valve className="org.apache.catalina.valves.CometConnectionManagerValve" />
-->

</Context>

まともな人間って世の中どれだけいるのだろうか。

まともとは、漢字で正面、真面と書き、まっすぐ向かい合う事、正しく向かい合う事を指すそうだ。

まともな人間とは、人が人らしく生きる為に自分だけではなく周りの人間に対しても配慮する事だろう。


人が人らしく生きると言う事は、人とコミュニケーションが必要だ

例えば、周りの人間とはこういった人達もいる。

 ・犯罪者

 ・病人

 ・障害者


他人事だとは全く思えない。

なぜなら、犯罪として裁かれなくても人は常に犯罪をおかしている。

子供の頃、母親のサイフからお金をくすねたり、嘘をついたり誰でも1つや2つ覚えがあるだろう。

障害者や病気ならば、いつだってなる可能性がある。

私の知り合いでバイクで事故を起こし足を切断した男性がいるが、私も休日にアメリカンバイクでツーリングにでかけている。


そうやって自分の身に置き換えてみるとどうだろうか。


犯罪者が更生する為に受け入れる家族や友人、そして社会も必要だろう。

そして、更生した犯罪者が自分の娘と結婚するとしたらどうだろう。

その犯罪者が、婦女暴行や殺人を犯した人間だったとしても受け入れられるだろうか。

人は反省し更生できる可能性を皆持っているはずだ。


病に罹った義父がAIDSだったとしたら、一緒に生活や仕事が出来るだろうか?


障害者にも人を愛する気持ちがあるはずだ。

性的な欲求を、誰がどうやって満たすのだろうか?


人は狭い境界線の中で生きている。

その一歩を踏み越えると、2度と戻ってこれないほど険しい環境が待ち受けている。

この境界線の外にいる人達も、中にいる人達も、何一つ変わらない痛みを感じる心を持っているというのに。

EAでは4時間足と15分足のADXmを2つづつを使います。


#define MODE_DI 0
#define MODE_ADX 1
#define MODE_ADXL 2
#define MODE_levh 3
#define MODE_levl 4


extern double p=14; 足の本数
extern double Level=25; 


double AdxADX240Current, AdxADX240Previous;

double AdxADXCurrent, AdxADXPrevious;


AdxADX240Current=iCustom(0,240,"ADXm",p,Level,MODE_ADX,0);
AdxADX240Previous=iCustom(0,240,"ADXm",p,Level,MODE_ADX,1);
AdxADXCurrent=iCustom(0,15,"ADXm",p,Level,MODE_ADX,0);
AdxADXPrevious=iCustom(0,15,"ADXm",p,Level,MODE_ADX,1);



影虎の雑学日記