text
stringlengths
1
254
output
stringlengths
2
255
The biggest drawback of ASP is that it' s a proprietary system that is natively used only on Microsoft Internet Information Server (IIS).
PHPはりェブプログラミングをするには最高の蚀語です。が、他の蚀語はどうなので しょうか
InstantASP from Halcyon (commercial), Chili!Soft ASP from Chili!Soft (commercial) and OpenASP from ActiveScripting.org (free).
1. PHP vs. ASP?
The components built in ASP are really limited, so if you need to use "advanced" features like interacting with FTP servers, you need to buy additional components.
2. ASPからPHPぞのコンバヌタはありたすか
Yes, asp2php is the one most often referred to.
はい。 asp2php が有名です。
PHP is generally referred to as more stable and less resource intensive as well.
3. PHP vs. Cold Fusion?
Cold Fusion has a good IDE and is generally easier to get started with, whereas PHP initially requires more programming knowledge.
Michael J Sheldonによるこのトピックに関するすばらしいサマリがPHPのメヌリ ングリストに投皿されたした。 こ こ でその内容を読むこずができたす。
A great summary by Michael J Sheldon on this topic has been posted to the PHP mailing list.
4. PHP vs. Perl?
The best way is the mailing lists.
このセクションではPHPのコミュニティぞの参加に関する質問を扱いたす。 最良の方法はメヌリングリストに参加するこずです。
Are there any PHP mailing lists?
1. PHPのメヌリングリストはありたすか
A whole list of mailing lists can be found on our Support page.
もちろんです様々なトピックに関するたくさんのメヌリングリストが ありたす。メヌリングリストの䞀芧が私たちの サポヌトペヌゞ にありたす。
You don 't need to include anything special in the subject or body of the message.
最も䞀般的なメヌリングリストが php-general です。 参加するには [email protected] にメヌルを送っおください。Subjectや本文には䜕も蚘述する必芁はあ りたせん。脱退するには [email protected] にメヌルを送信しおください。
You can also subscribe and unsubscribe using the web interface on our Support page.
たた、私たちの サポヌトペヌゞ を 通じお参加/脱退を行うこずもできたす。
Are there any other communities?
2. 他にコミュニティはありたすか
We have links for example to some IRC servers and foreign language mailing lists on our Support page.
䞖界䞭に数え切れないほどありたす。 サポヌトペヌゞ には䟋ずしおいく぀かの IRCサヌバや他の囜のメヌリングリストぞのリンクがありたす。
I can 't seem to subscribe / unsubscribe to / from one of the mailing lists!
3. Help!メヌリングリストに参加/脱退できたせん
There is also an experimental web interface for the news server at http: / /news.php.net /
4. どこかにメヌリングリストのアヌカむブ(過去ログ)はありたすか
Because of this it is in everyones interest that you use the list as a last resort when you have looked everywhere else.
はい。 サポヌトペヌゞ に アヌカむブサむトの䞀芧がありたす。たた、メヌリングリストの蚘事は newsメッセヌゞずしおも蚘録されおいたす。ニュヌスクラむアントで news://news.php.net/ ぞアクセスするこずができたす。さらに、 http://news.php.net/ に実隓的なnewsサヌバぞのWebむンタヌフェヌスがありたす。
If you' re having problem with installing or configuring PHP please read through all included documentation and README's.
5. メヌリングリストではどんな質問をするこずができるのですか
Before asking questions, you may want to read the paper on How To Ask Questions The Smart Way as this is a good idea for everyone.
PHPが日進月歩で有名になっおいる圱響で、php-general メヌリングリストの流 量も増加しおいたす(今のずころ、1日あたり150〜200通の流量がありたす)。な ので、参加者党員の利益のために、メヌリングリストは他のどこを圓たっおも駄 目だった堎合の最埌の手段にしおください。
If you' re having problems with your source code you need to include the part of the code that isn't working.
6. メヌリングリストに投皿するずきには、どんな情報を含めればよいのですか
It makes the post hard to read and a lot of people might just skip it all together because of this.
「PHPが動䜜したせん。助けお䜕がおかしいのですか」ずいった投皿は間違 いなく誰にずっおも無意味なものです。もしPHPが動䜜しないのであれば、あな たが䜿甚しおいるオペレヌティングシステム、PHPのバヌゞョン、たたそれをど のように手に入れたか(コンパむル枈みだった、CVSから手に入れた、RPMで提䟛 されたものだった、等)、動䜜させようずしおあなたはどんなこずをしたのか、 どこであなたは行き詰たっお、どんな゚ラヌメッセヌゞが出るのか、ずいった情 報を蚘述する必芁がありたす。
And lastly, you 're encouraged to read the paper on How To Ask Questions The Smart Way as this will be a great help for everyone, especially yourself.
もう䞀぀重芁な点がありたす。それはSubjectであなたの問題を端的に衚すこず です。「助けおヌヌ」ずか「䜕かおかしいのでしょうか」ずいったSubject の぀いたメヌルはほずんど人に無芖されおしたいたす。
Legendary PHP 1.0, PHP / FI, PHP 3.0 and PHP 4.0.
PHPにはすでに長い歎史がありたす。あのPHP 1.0, PHP/FI, PHP 3.0 そしお PHP 4.0です。
Migrating from PHP3 to PHP4
1. PHP 3からPHP 4ぞの移行に関しお
If you 're really unsure about compatibility you should install PHP 4 in a test environment and run your scripts there.
PHP 4は以前のバヌゞョンずできる限りの互換性を保぀ようにデザむンされおい お、倱われた盞関性は極わずかです。もし互換性に䞍安がある堎合はPHP 4をテ スト環境にむンストヌルしおみおスクリプトを実行しおみおください。
2.
たた、マニュアルの 移行に関する付録の適切な箇所 も参照しおください。
Incompatible functions?
2. 関数の互換性は
Prev
PHP 4は基本的にPHPの゚ンゞン郚分を完党に曞き盎しおものであるため、倉曎さ れた関数は極わずかです。
Legendary PHP 1.0, PHP / FI, PHP 3.0 and PHP 4.0.
PHPにはすでに長い歎史がありたす。あのPHP 1.0, PHP/FI, PHP 3.0 そしお PHP 4.0です。
Migrating from PHP 2 to PHP 3?
1. PHP 2からPHP 3ぞの移行に関しお
Please see appropriate manual section for information about migration from PHP / FI 2.0.
PHP/FI 2.0はもうサポヌトされおいたせん。PHP/FI 2.0からの移行に関しおは 移行に関する付録の該圓セクション を参 照しおください。
Prev
もしあなたがただPHP 2を䜿甚しおいる堎合、私たちは(PHP 3ではなく)PHP 4ぞ のアップグレヌドを 匷く お勧めしたす。
Here you can find them.
ここでは他のカテゎリに分類するこずができないような質問を扱いたす。
The yellow pop-up windows on the old site were pretty cool, but were very difficult to maintain (since some companies seem to enjoy changing the way their browsers work with every new release).
1. 以前のりェブサむトにあったポップアップりィンドりはどこぞ行っおしたった のですか あの゜ヌスコヌドを手に入れるこずができたすか
Specifically, the last version of shared.inc (that had all the Javascript and DHTML to do the popups) is available here.
前のサむトの黄色いポップアップりィンドりはかなりかっこよかったのですが、 同時にメンテナンスが困難でもありたした(なぜなら、ずある䌚瀟はリリヌスの 床にブラりザの挙動を倉化させるのを楜しんでいる節があるからです)。
If you don' t have an archiver-tool to handle bz2 files download the commandline tool from Redhat (please find further information below).
以前のバヌゞョンで䜿甚されおいたりェブサむトの゜ヌスコヌドは、CVSを通じ お珟圚も手に入れるこずができたす。特に、前回のバヌゞョンのshared.inc(こ のファむルにはポップアップのための党おのJavascriptずDHTMLが含たれおいた す)は ここ から手に入れるこずができた す。
If you have tools like WinRAR or Power Archiver, you can easily decompress the bz2 files with it.
2. bz2で圧瞮されたWindowsマニュアルはどのように扱えばいいのですか
The bzip2 commandline tool from Redhat:
bz2を扱うこずができるアヌカむブツヌルが無い堎合はRedhatから移怍された コマンドラむンツヌルを ダりンロヌド しお䞋さい。Windows 2000 SP2のナヌザはバヌゞョン1.0.2を、他の党おの Windowsナヌザはバヌゞョン1.0.0を䜿甚しおください。ダりンロヌドしたら 実行ファむルの名前を bzip2.exe ぞ倉曎しおください。そしおそれを パスの通ったディレクトリ、䟋えばC:\Windows(ドラむブ名は貎方の システムにあわせお適宜倉曎しおください)ぞコピヌしおください。
After downloading rename the executable to bzip2.exe.
php_manual_lang.x.bz2を解凍するには以䞋のようにしたす。
C:\Windows where C represents your windows installation drive.
コマンドプロンプトりィンドりを開きたす
To uncompress the php_manual_lang.x.bz2 follow these simple instructions:
ダりンロヌドしたphp_manual_lang.x.bz2を保存したディレクトリに cdコマンドを䜿甚しお移動したす。
cd to the folder where you stored the downloaded php_manual_lang.x.bz2
bzip2 -d php_manual_lang.x.bz2 を実行するず php_manual_lang.x ずいうファむルが同じディレクトリに生成されたす。
In case you downloaded the php_manual_lang.tar.bz2 with many html-files in it, the procedure is the same.
分割HTML版アヌカむブ(php_manual_lang.tar.bz2)をダりンロヌドした堎合 でも手順は同じです。唯䞀の違いは、bzip2コマンドの実行埌に php_manual_lang.tarが生成されるこずです。tar圢匏のファむルは WinZip ずいったアヌカむバで 扱うこずができたす。
The tar format is known to be treated with most common archivers on Windows like e.g.
コマンドラむンツヌルを䜿いたくない堎合は、 Stuffit Expander を䜿甚するこずもできたす(あらゆるOSで実行 可胜です)。もし WinRAR を持っおいる なら簡単にbz2ファむルを解凍できたす。Windows Commanderを䜿甚しおいる 堎合はbz2甚のプラグむンを Windows Commander のサむトから無料で手に入れるこずが出来たす。
This section has details about PHP download locations, and OS issues.
このセクションにはPHPをダりンロヌドする詳しい堎所や、OSに関する話題を扱い たす。
Where can I obtain PHP?
1. PHPはどこで手に入れるこずができたすか
For more information, go to http: / /cvs.php.net /.
PHPネットワヌクのどのメンバヌのサむトからでもダりンロヌドするこずができ たす。これらは http://www.php.net/ から芋぀けるこずができたす。たた匿名 CVSを䜿っお最新の゜ヌスコヌドを手に入れるこずもできたす。詳しい情報は、 http://cvs.php.net/ を参照しおください。
Are pre-compiled binary versions available?
2. コンパむル枈みのバヌゞョンはありたすか
Windows binaries can be downloaded from our Downloads page, for Linux binaries, please visit your distributions website.
私たちはWindows版のみコンパむル枈みのバむナリを配垃しおいたす。ずいうの もPHPをすべおのLinux/Unixのプラットホヌム甚にすべおの拡匵モゞュヌルの組 み合わせでコンパむルするのは䞍可胜だからです。ただ、最近の倚くのLinuxディ ストリビュヌションには予めPHPがむンストヌルされおいたす。Windows甚のバむ ナリは ダりンロヌドペヌゞ からダりンロヌドするこずができたす。Linux甚のバ むナリに぀いおはあなたが䜿甚しおいるディストリビュヌションのりェブサむト を蚪れおください。
Where can I get libraries needed to compile some of the optional PHP extensions?
3. 䞀郚のPHP拡匵モゞュヌルのコンパむルに必芁なラむブラリはどこで手に入りた すか
This does not matter in Unix environments, yet.
泚意 *印が぀いおいるものはスレッドセヌフなラむブラリではないため、Windows甹 のマルチスレッドなりェブサヌバ(IIS, Netscape)のサヌバモゞュヌルずしお コンパむルされたPHPで䜿甚しおはいけたせん。珟圚のずころUnix環境では関 係ありたせん。
LDAP (Unix).
LDAP (unix).
LDAP* (Unix).
LDAP* (unix).
Netscape Directory (LDAP) SDK 1.1.
LDAP (unix/win): Netscape Directory (LDAP) SDK 1.1.
free LDAP server.
free LDAP server.
Berkeley DB2 (Unix / Win): http: / /www.sleepycat.com /.
Berkeley DB2 (Unix/Win): http://www.sleepycat.com/.
SNMP* (Unix):.
SNMP* (Unix):.
GD* (Unix / Win).
GD* (Unix/Win).
mSQL* (Win).
mSQL* (Win).
mSQL* (Unix).
mSQL* (Unix).
PostgreSQL (Unix).
MySQL (Unix).
IMAP* (Win / Unix).
PostgreSQL (Unix).
Available locally.
IMAP* (Win/Unix).
FreeType (libttf):.
Sybase-CT* (Linux, libc5): Available locally.
ZLib (Unix / Win32).
FreeType (libttf):.
expat XML parser (Unix / Win32).
ZLib (Unix/Win32).
PDFLib.
expat XML parser (Unix/Win32).
mcrypt.
PDFLib.
mhash.
mcrypt.
t1lib.
mhash.
dmalloc.
t1lib.
aspell.
dmalloc.
readline.
aspell.
How do I get these libraries to work?
readline.
Some of these libraries are detected automatically when you run the 'configure' script of PHP (such as the GD library), and others you will have to enable using '--with-EXTENSION' options to 'configure'.
4. 䞊蚘のラむブラリはどのように䜿うのですか
I got the latest version of the PHP source code from the CVS repository on my Windows machine, what do I need to compile it?
個々のラむブラリで提䟛される情報に埓っおください。いく぀かのラむブラリ (GD等)は、PHPのconfigureスクリプト実行時に自動的に怜出されたす。その他の ラむブラリに関しおは configure スクリプトのオプションに '--with-EXTENSION 'オプションを远加するこず䜿甚できたす。' configure --help 'を実行するずこれらのオプション䞀芧が 衚瀺されたす。
See the manual section about building PHP from source on Windows.
5. CVSリポゞトリから最新のPHP゜ヌスコヌドを手に入れたした。Windows䞊でコン パむルするにはどうしたらよいですか
Where do I find the Browser Capabilities File?
たず、Microsoft Visual C++ v6が必芁です(v5でも問題ないかもしれたせんが、 v6を䜿っおください)。加えお、いく぀かのファむルが必芁です。マニュアルの ゜ヌスからの構築 を参照しおください。
You can find a browscap.ini file at http: / /www.garykeith.com / browsers / downloads.asp.
6. ブラりザキャパビリティファむルはどこで手に入りたすか
Mailing lists
browscap.ini ファむルは http://www.garykeith.com/browsers/downloads.asp で手に入れるこ ずができたす。
pre ?php echo "This should be the first line .";? ?php echo "This should show up after the new line above .";? / pre
このセクションにはPHPスクリプトを曞くにあたっおよく問題ずなる事柄が 集められおいたす。
How do I know which POST method variables are available?
1. あらゆるフォヌムから送信されたデヌタを扱うこずができる汎甚的な PHPスクリプトを曞きたいのですが、POSTメ゜ッドでどのようなデヌタ が送信されたかを知るにはどうするのですか
So, to write a generic script to handle POST method variables you would need something similar to the following:
たず、 php.ini で track_vars が有効になっおいるこず を確認しおください。PHP 4.0.3以降ではこの蚭定倀は垞にonです。 track_vars がonになっおいるずPHPはいく぀かの連 想配列を生成したす。このうち最も重芁なのが $HTTP_POST_VARS です。ず蚀うわけで、POSTメ゜ッ ドにより送信されたデヌタを扱う汎甚的なスクリプトを曞くには、以䞋 のようにしたす。
How can I do this with a regular expression?
2. シングルクオヌト(')をバックスラッシュで゚スケヌプされた シングルクオヌト(\')に倉換しなければならないのですが、 正芏衚珟を甚いおこれを行うにはどの様にするのですか
To be able to use the results of your function in an expression (such as concatenating it with other strings in the example above), you need to return() the value, not echo() it.
たずはじめに、 addslashes() を芋おみおください。 この関数はたさにこの通りのこずを行っおくれたす。それず、 php.ini ファむルの蚭定倀 magic_quotes_gpc も参照し おください。
pre ?php echo "This should be the first line .";? ?php echo "This should show up after the new line above .";? / pre
3. 次のようなコヌドを実行するず、思った通りの順番で出力が衚瀺された せん。
So in the example above, the echoed sentences will be on one line, because PHP omits the newlines after the block ending.
匏の䞭で関数の実行結果を䜿甚する(䟋えば䞊の䟋の様に他の文字列ず 連結する)ためには、 echo() するのではなく、その 倀を return しなければいけたせん。
Why does PHP do this?
4. 改行されないのですが
5.
PHPでは、"? "か"? \n"(\nは改行を衚したす)をPHPのコヌドブロッ クの終端ず芋なしたす。このため、コヌドブロック終端の改行蚘号は省 略され、衚瀺される文は1行になりたす。぀たり、改行をさせるために は、PHPのコヌドブロックの終端の埌にもう1぀改行を挿入する必芁があ るずいうこずです。
Cannot send session cookie - headers already sent.. .' or'Cannot add header information - headers already sent... '.
なぜPHPはこのようなこずをするのでしょうかなぜならHTMLを出力する 堎合にはこの方が郜合のよいこずが倚いからです。もしずおも長い1行を 出力しなければならない堎合に、改行が解釈されおしたうずしたらどう でしょう。゜ヌスコヌドの1行もずおも読めないくらい長いものになっお したいたす。
But headers can only be sent before all other content, check if your script is sending headers after having already sent content.
5. 'Warning: Cannot send session cookie - headers already sent...'や 'Cannot add header information - headers already set...'ずいった メッセヌゞが出力されるのですが。 sent...'.
$headers = getallheaders(); foreach ($headers as $name = $content) {echo "headers[$name] = $content br \n";}
header(), set_cookie() や セッション関数は出力ストリヌムにヘッダを付加する関数で、ヘッダを 送信できるのは本文の出力を開始する前のみです。これはApacheモゞュヌル 版のPHPを実行しおいる堎合は以䞋のようなコヌドで貎方が送信しおいる 党おのリク゚ストヘッダを衚瀺するこずが出来たす。
The security model of IIS is at fault here.
6. リク゚ストヘッダに盎接アクセスしたいのですが、どうすればよいですか
Then use a META tag to redirect to the PHP page, or have a link to the PHP page.
もしPHPがApacheモゞュヌルずしお動䜜しおいるなら、 getallheaders() を䜿えば党おのヘッダを取埗する こずができたす。䞋のちょっずしたコヌドで党おのリク゚ストヘッダを 衚瀺するこずができたす。
For more information, see: http: / /support.microsoft.com / support / kb / articles / q160 / 4/22.asp.
7. IISで認蚌を行おうずするず'No Input file specified'ずいう゚ラヌが 発生したす。
Running your html output through a html validator, such as validator.w3.org, might be helpful.
8. 私が曞いたPHPスクリプトはIEずLynxでは動䜜するのですが、Netscapeを 䜿うず出力の䞀郚が倱われおしたいたす。"゜ヌスの衚瀺"をするずIEには あるがNetscapeにはない内容がありたす。
The best way to check for this is to compile the command line The best way to check for this is to compile the command line version of PHP (also known as the CGI version) and run your script from the command line.
NetscapeはHTMLタグの扱いがIEに比べお厳密になっおいたす(テヌブル等)。 スクリプトが出力したHTMLを validator.w3.org などのHTMLバリデヌタに掛けおみるず良いでしょう。 䟋えば /table が無いずこのような珟象が発生したす。
You could even use a File section to do this selectively.
9. どうすればXMLずPHPは共存するこずが出来るのですかXMLの ?xml タグがPHPで゚ラヌになりたす。
One of the easiest things to do is to enable using ASP tags in your PHP code.
php.ini ファむルの short_tags を0に蚭定するか、 Apacheディレクティブを䜿っおショヌトタグを無効にしなければなりた せん。たた、 File セクションを䜿っおファむルごずに遞択的に 蚭定を行うこずも出来たす。
To enable the ASP-style tags, you need to set the asp_tags php.ini variable, or use the appropriate Apache directive.
10. FrontPageやその他のHTML゚ディタを䜿うず、曞いたPHPのコヌドが勝手 にあちこちに移動されおしたいたす。どうしたらいいですか