Installing Web Server in FreeBSD 6.0 with Apache 2.2, MySQL 5.0 and PHP 5 - Part 5 WebサーバーはFreeBSD 6.0のインストールにより、 Apache 2.2 、 MySQLは5.0とPHP 5で-パート5
Installing Apache 2.2, MySQL 5 and PHP 5 in FreeBSD 6.0 for a Reliable Web Server インストールのApache 2.2 、 MySQLは5およびPHP 5のFreeBSD 6.0で信頼性の高いWebサーバーの
Part 5 - Installing PHP Hypertext Preprocessor Scripting Language 5 and PHP 5 Extensionsパート5 -ハイパーテキストプリプロセッサをインストールするスクリプト言語のP HP5とP HP5の拡張機能
- Install by enter the following commands on FreeBSD OS command line, wait for previous command to finish before running the next command: FreeBSDのOSのコマンドラインで次のコマンドを入力して、以前のコマンドについては、次のコマンドを実行する前に完了するのを待つのインストール:
cd /usr/ports/lang/php5のCD / usr/ports/lang/php5
make install cleanクリーンインストールを行う - If you’re prompted, select “use Apache 2.x instead”.要求している場合は、 [ "使用のApache 2.xの代わりに" 。
- Continue with the following commands to install PHP5 extensions and modules to enable the support of the modules in Apache:以下のコマンドを続行Apacheでは、モジュールのサポートを有効にするPHP5の拡張機能やモジュールをインストールするには:
cd /usr/ports/lang/php5-extensionsのCD / usr/ports/lang/php5-extensions
make config設定をする - At Options for php5-extension 1.0 menu, select all PHP extensions and modules that you may use with Apache webserver. PHP5向けのオプションメニュー拡張1.0で、すべてのPHP拡張モジュールと、 Apache Webサーバを使用することができるモジュールを選択してください。 This is a part of the configuration for PHP, where you need to enable features of PHP that come in modules, such as ability to manage user sessions, interface with databases and many others.これはPHP用の設定の場所は、 PHPの機能をモジュールになると、一部です能力を有効にする必要があるユーザーセッション、データベース、および多くの他のユーザーとのインターフェースを管理するなど。 Default extensions such as ctype functions support, HASH Message Digest Framework support, session support and etc have been selected. ctype関数をサポートなどデフォルトの拡張子、ハッシュメッセージダイジェストFrameworkのサポート、セッションサポート等が選択されている。 Other popular extensions that you most likely to be in used are MySQL database support and GD library support.その他の人気の拡張子は、ほとんどで使用される可能性が高いMySQLデータベースのサポートとGDライブラリをサポートしています。 Use space bar to select or unselect the extensions and press Enter when done.使用してスペースバーを選択するか、拡張機能をオフとしたら、 Enterキーを押します。
- Continue the installation of php5-extensions with the following commands: PHP5の拡張機能のインストールを続行には、以下のコマンドで:
make install cleanクリーンインストールを行う
- If there are any message the pops up and prompts you to select some options or configurations, you can just accept the default settings by pressing Enter.があれば、最大ポップスと、いくつかのオプションや構成を選択するように要求任意のメッセージは、先ほど入力してくださいを押すことによって、デフォルトの設定を受け入れることができます。 Some modules that may prompt you for action include php5-gd, php5-mbstring and php5-sqlite.いくつかのモジュールはその操作を要求することがありますPHP5の- gdを指定、 PHP5の- mbstringはとPHP5 - sqliteを含まれています。
- Edit the Apache configuration file in order to enable Apache web server to load the PHP modules when initialization:のための初期化時には、 PHPのモジュールをロードするApache Webサーバを有効にするには、 Apacheの設定ファイルを編集:
- Go to Apache configuration file location by cd /usr/local/etc/apache2/ Apacheの設定ファイルの場所にcdで移動/ usr/local/etc/apache2 /
- Edit Apache configuration file by vi httpd.conf viのApacheの設定ファイルhttpd.confを編集
- Search for LoadModule lines, after the last LoadModule line, but within the same section, add the following 2 lines: LoadModule行の後、最後のLoadModuleの行を検索するが、同じセクション内には、以下の2行を追加します:
AddType application/x-httpd-php .php AddTypeアプリケーション/ × -のh ttpd- p hpの。 p hpの
AddType application/x-httpd-php-source .phps AddTypeアプリケーション/ × -のh ttpd- p hpのソース。 p hps
- Optionally, copy /usr/local/etc/php.ini-recommended or /usr/local/etc/php.ini-dist to /usr/local/etc/php.ini (in same directory), which will enable you to tune and change the default settings of behaviours of PHP.必要に応じて、コピーを/ usr / localの/ etc / php.iniの、または/ usr / localにお勧めの/ etc /のphp.ini - distをを/ usr /の/ etcローカル/ php.iniの同じディレクトリ( )で、有効にするPHPの行動の調整や変更は、デフォルトの設定。
- Start the Apache HTTP web server by using apachectl start (or restart Apache HTTP web server by using apachectl restart). apachectl起動を使用してはApache HTTP Webサーバーを起動します(または再起動apachectlを使用して)はApache HTTP Webサーバーを再起動します。 apachectl is located in /usr/local/sbin, if you encounter Command not found problem, try to change directory to its location. apachectlに位置は/ usr / localの/ sbin 、コマンドに遭遇する問題が見つかった場合は、その場所にディレクトリを変更してください。
- PHP5 installation done. PHP5のインストールを行います。
A web server has been setup with the FreeBSD with Apache, MySQL and PHP.のFreeBSDのApache 、 MySQLとPHPを搭載したWebサーバーが設定されている。 The document root of the web server (where you should put your HTML and PHP files is at /usr/local/www/apache22/data/ and you will need a SecureFTP (SFTP) client such as WinSCP to upload your files to web server securely.は、 Webサーバのドキュメントルート(ここで、あなたのHTMLおよびPHPファイルでは、 / usr/local/www/apache22/dataを置いてください/ WinSCPなどをウェブにサーバーがファイルをアップロードするためのSecureFTP ( SFTPの)クライアントが必要になります安全に。
IMPORTANT : This is a machine translated page which is provided "as is" without warranty. 重要 :これはマシンとして"保証なしにされている"提供されているページを翻訳しています。 Machine translation may be difficult to understand.機械翻訳を理解するのが難しい場合があります。 Please refer toを参照してください original English articleオリジナルの英語の記事 whenever possible.可能な場合。
Share and contribute or get technical support and help at共有して貢献するかを得る技術サポートと支援 My Digital Life Forums 私のデジタルライフフォーラム . 。
Related Articles関連記事
- Installing Web Server in FreeBSD 6.0 with Apache 2.2, MySQL 5.0 and PHP 5 - Part 1 WebサーバーはFreeBSD 6.0のインストールにより、 Apache 2.2 、 MySQLは5.0とPHP 5で-パート1
- Installing Web Server in FreeBSD 6.0 with Apache 2.2, MySQL 5.0 and PHP 5 - Part 2 WebサーバーはFreeBSD 6.0のインストールにより、 Apache 2.2 、 MySQLは5.0とPHP 5で-パート2
- Installing Web Server in FreeBSD 6.0 with Apache 2.2, MySQL 5.0 and PHP 5 - Part 4 WebサーバーはFreeBSD 6.0のインストールにより、 Apache 2.2 、 MySQLは5.0とPHP 5 -パート4
- Installing Web Server in FreeBSD 6.0 with Apache 2.2, MySQL 5.0 and PHP 5 - Part 3 WebサーバーはFreeBSD 6.0のインストールにより、 Apache 2.2 、 MySQLは5.0とPHP 5 -パート3
- Installing and Configuring DHCP Server (DHCPd) on FreeBSD DHCPサーバーのインストールと設定(のdhcpd ) FreeBSD上で
- FreeBSD Apache HTTP Accept Filter Error FreeBSDのはApache HTTPフィルタエラーを受け入れる
- Install phpBB 2 in Windows XP running on Apache 2, PHP 5 and MySQL 4インストールのphpBB 2 、 Windows XPでのApache 2 、 PHP 5には、 MySQLを4で実行している
- Reset the Root Password of MySQL Server MySQLサーバのrootのパスワードをリセット
- Request URL /server-status or 404 Page Not Found Apache ErrorリクエストURL /サーバのステータスまたは404ページが見つかりませんApacheのエラー
- Checking Free Disk Space on FreeBSD Server FreeBSDのサーバー上のディスクの空き容量を確認する

































May 24th, 2006 10:23 5月24日10:23
Hi, I am trying to install, php5 with apache2.2 on freebsd 6.1.こんにちは、私は、 apache2.2ではFreeBSD 6.1のPHP5をインストールしようとしている。 I have followed the instructions on this page.私はこのページの説明に従っている。 I can get apache running well, but php will not interpret any pages. Apacheを実行しても得ることができますが、 phpの任意のページを解釈することはありません。 I have a file; info.php with in it, but when I load it from a browser it tries to *download* the php file not display it.私はファイルが、それにinfo.phpが、私はそれ*は、 PHP *ときに表示されないファイルをダウンロードしようと、ブラウザからそれをロードします。 Furthermore, the httpd.conf does not have a entry to load the php module as a shared object.さらに、 httpd.confには、共有オブジェクトとしては、 PHPのモジュールをロードするためのエントリを持っていません。 should it?必要がありますか? its as if apache has not idea how to process php’s.そのようにApacheのプロセスにどのようにしているPHPのアイディアではない。 Any guideance would be appreciated!すべてのguideanceば幸い!
kind regardsかしこ
May 24th, 2006 10:30 5月24日2006 10:30
Did you add the followng lines to your httpd.conf?あなたののhttpd.confにfollowngの行を追加しますか?
AddType application/x- httpd-php . PHPはapplication/x-のhttpd - AddType 。 php phpの
AddType application/x- httpd-php-source . AddType application/x-のhttpd - phpのソース。 phps
Normally, ports installation will auto update the httpd.conf with php5 load module.通常、ポートのインストールPHP5のロードモジュールでは、 httpd.confの自動更新されます。 Check if your httpd.conf has the following line, if not try to add:もしあなたののhttpd.confを追加しようとしない場合は、次の行をしている確認してください:
LoadModule php5_module libexec/apache22/libphp5.so LoadModule php5_module libexec/apache22/libphp5.so
May 24th, 2006 11:54 5月24日2006 11:54
Yes, I certainly did add the AddType’sはい、私は確かに追加したAddTypeの
the php5 port installation did not auto update httpd.conf with ‘LoadModule php5_module libexec/apache22/libphp5.so’.ポートは、 PHP5のインストール'をLoadModule php5_module libexec/apache22/libphp5.so ' httpd.confを自動更新していない。 I would manually add it but the libphp5.so does not exist in the mentioned directory.私は手動で追加するとlibphp5.soが記載ディレクトリには存在しません。 Any idea’s?すべてのアイデアは何ですか? I installed from the /usr/ports/lang/php5 port.私は、 / usr/ports/lang/php5ポートからインストールされています。 I heard using /usr/ports/www/mod_php5 port may work.私は仕事をすることがあります/ usr/ports/www/mod_php5ポートを使用して聞いた。 Would/should it make any difference? /何か違いが出る必要がありますか?
May 24th, 2006 16:01 5月24日16:01
Hi Bruce, you may give mod_php5 a try, but I think you will lose some functionalities such as command line CLI.ハワイブルース場合は、追加mod_php5を与えるかもしれないが、私はあなたのCLIコマンドラインなどの一部の機能を失うことになると思う。 Or else try to make clean in php5 first.さもないとPHP5の最初の掃除をするにしてください。 Reinstalling from Apache again worth a try too. Apacheを再インストールする価値のあるすぎるから再度お試しください。 Note that you should install Apache first, and php5 will detect which version of Apache you’re running.最初は、 Apacheのインストールを行ってください、とPHP5のApacheを実行しているどのバージョンを検出する。
May 24th, 2006 16:11 5月24日2006 16:11
Beside, make sure you updated to latest ports tree withそばには、最新のportsツリーを更新しておいてください portsnap orまたは cvsup . 。
May 29th, 2006 20:59 2006年5月29日20:59
You might missed to install the php for apache, only cgi and cli. Apacheの場合は、 PHPをインストールするには逃したが、唯一のCGIとCLI 。
CD /usr/ports/php5のCD / usr/ports/php5
make config設定をする
thenそれから
make install cleanクリーンインストールを行う
mayby you have to do maybyを行う必要がある
make deinstall && make reinstall deinstall & &を再インストールする
June 4th, 2006 10:48 2007年6月、第4回2006 10:48
When you add the following lines to httpd.conf file, make sure you removed the extra spaces (there are 2 extra spaces in the original article, following doesnt’t have).ファイルhttpd.confのときは、必ず余分なスペースを削除する場合は、以下の行を追加( 2月は、元の資料に余分なスペースは、次のdoesnt't )を使用することがあります。
AddType application/x-httpd-php .php AddTypeアプリケーション/ × -のh ttpd- p hpの。 p hpの
AddType application/x-httpd-php-source .phps AddTypeアプリケーション/ × -のh ttpd- p hpのソース。 p hps
June 7th, 2006 05:21 2006年6月7日05:21
I’m having the same problem as Bruce above.私はブルース上記と同じ問題が発生している。 I’m using FreeBSD 6.1, Apache 2.2, and PHP 5.1.4.私は、とPHP 5.1.4のFreeBSD 6.1 、 Apacheの2.2を使用している。 My ports tree is fresh and synched.私のportsツリーは新鮮だと同期。
I installed the PHP5 port with Apache module support.私はApacheモジュールのサポートでは、 PHP5のポートがインストールされている。 The installation completes without complaining, but there is no Apache module built.文句なしには、インストールが完了するApacheモジュールが組み込まがない。 The file /usr/local/libexec/apache22/libphp5.so does not exist. usr/local/libexec/apache22/libphp5.so /存在しないファイル。 It doesn’t exist anywhere else in the filesystem either.それ以外の場所では、ファイルシステムのいずれかが存在しません。 Something is broken with this port.このポートで何かが壊れています。 I see source files in the work directories , like /usr/ports/lang/php5/work/php-5.1.4/sapi/apache that look appropriate to this module… but are not getting compiled.私は仕事のディレクトリには、のようなソースファイルを参照してください/ usr/ports/lang/php5/work/php-5.1.4/sapi/apacheでは、このモジュールに適切な顔...が、コンパイルを取得されていません。 Any insights?任意の見識か?
June 9th, 2006 20:41 2006年6月9日20:41
Ahmet gave a working answer.アフメットに取り組んで答えを与えた。 I was having the same problems, until I noticed the extra space before the file extention, now everything works like a charm!まで私は、ファイル拡張子の前に、余分なスペースに気付いた私は、同じ問題を抱えていた今では魔法のようにすべての作品!
June 9th, 2006 20:59 2006年6月9日20:59
Thanks for point out, has since corrected the error.指摘も出てくれてありがとう、以来、エラーを修正している。
August 28th, 2006 10:55 8月28日10:55
Recompile php5 with ‘Apache Module’ included. PHP5の再コンパイル' Apacheモジュール'含まれています。
‘cd /usr/ports/lang/php5′ 'のCD / usr/ports/lang/php5 '
‘make deinstall’ ignore warnings ' '警告を無視するdeinstall
‘make config’ make sure to select apache module config 'を' Apacheモジュールを選択していることを確認する
‘make install’ 'インストール'を作る
September 26th, 2006 16:37 2006年9月26日16:37
I’ve Done it successfully.私は正常に完了しました。 It doesnt work..それdoesn't作業..
How do i access it?どうやってアクセスするのですか?
ive typed IVEを入力 http://192.168.1.9
November 29th, 2006 10:32 2006年11月29日10:32
Had run into the same problem as those above with the extra spaces in the AddType declaration but solved it before looking at the comments.と同じ問題にぶつかるいたAddType宣言では、余分なスペースでは、上記のコメントを見る前に解決した。 Would recommend updating the article as, all in all, this is a great tutorial.として、記事を更新すると、すべてのすべてのことをお勧めか、これは偉大なチュートリアルです。 Thanks.ありがとう。
Benベン
November 29th, 2006 12:35 2006年11月29日12:35
Thanks Ben, have since corrected the error.ありがとうベン、以来、エラーを修正している。
January 6th, 2007 16:50 2007年1月6日16:50
I’m running into the same issue.私は同じ問題を実行しているんだ。 My php files are trying to download instead.私のPHPファイルの代わりにダウンロードしようとしている。
I’ve gone over everything three and four times yet nothing.私はすべての3と4倍以上はまだ何もなくなってきた。
I’ve checked the additional spaces as well and no luck.私は幸運にも、追加のスペースをチェックしている。
Any assistance is appreciated!!どのような援助は歓迎されるでしょう!
January 9th, 2007 22:05 2007年1月9日22:05
I had same issue.私も同じ問題をしていた。
Try make config and unselect CGI and be sure to select APACHE.をしてみてくださいCGIやApacheの設定と解除を選択してください。
Check at end of install that you have a line like:chmod 755 /usr/local/libexec/apache22/libphp5.soチェックの最後には、次のような行: chmod 755 / usr/local/libexec/apache22/libphp5.soがインストール
I config without CLI ang CGI.私のCLIのCGIなしに設定します。
March 16th, 2007 08:28 3月16日2007/07/14 08:28
Trying to install the package php5 without port sources via PHP5のソースなしでポートを経由してパッケージをインストールしようとすると、
pkg_add -r php5 pkg_add - rをPHP5の
only this doesnt install the apache module by the looks of it..このdoesn'tは、それだけでは、 Apacheのモジュールをインストールするに見えます..
nor does it build it..またこれでビルドは..
I dont want the sources on the server because it is to be a production server..ため、サーバ製品で使用される..私は、サーバー上の情報源をドント i’m gunna try a reinstall…私は再インストールしてくださいgunnaよ...
March 16th, 2007 08:36 3月16日2007/07/14 08:36
reinstall was unsuccessful再インストールに失敗した
April 18th, 2007 05:40 2007年4月、 18 2007/07/14 05:40
I uninstalled, reinstalled making double sure to include the Apache model, still no dice.私は、ダブルは、 Apacheのモデルは、まだないサイコロを含めることを確認して再インストールをアンインストール。 So I uninstalled again and reinstalled without CLI and CGI and it still would startup no errors, but it would list the directories in document source and would treat cgi files as text files.だから、もう一度とCLIとCGIをアンインストールせずに再インストールしても起動しないエラーが、ドキュメントのソースのディレクトリリストを表示すると、テキストファイルとしてcgiのファイルを扱うと思います。 All my configs were in order, so I thought maybe it needed a reboot… and walah.すべての設定の順序で、私のかもしれない...とwalahは再起動が必要と考えられていた。 Working like a charm.魔法のように働く。
I think Unix is for massochists =)私のUnix massochists = )だと思う
April 18th, 2007 05:42 2007年4月、 18 2007/07/14 05:42
edit..編集.. I meant ” ..私は" ..意味 would treat PHP files as text files ..” and not CGI. "とCGI版のPHPファイルはテキストファイルとして扱う..と思います。
Long day =0長い1日= 0
September 14th, 2007 17:03 9月14日2007 17:03
I’ve been trying to install Timetrex and it requires Apache, php and postgresql.私Timetrexをインストールしようとしてきて、それを必要とのApache 、 PHPとPostgreSQLの。 Postgresql is not a problem because I install it from source. PostgreSQLは問題があるため私は、ソースからインストールされていません。 But as you can see from above, the FreeBSD ports system is so often in a state of flux that you’re not guaranteed anything that will work.しかし、上からの磁束の状態は、その動作には問題は何も保証していないと、 FreeBSDのportsシステムですが頻繁に表示することができます。
On this issue, the bosses, and I myself got so fed up with the results from FreeBSD that we installed Fedora and then took the vendors installation file, which only works on Linux and got on with the task.この問題では、上司、私はFreeBSDの我々はFedoraは、インストールされてからの結果にうんざりしてLinux上でのみ動作し、仕事になったのベンダーのインストールファイルをした。
With so many dependencies and librairies to update, the FreeBSD ports system as left me feeling very cautious about using it and it harkens me back to the old M$ “dll - hell” days when Windows 3x and Win9x were such a pain to deal with.非常に多くの依存関係やライブラリーでは、メインの使用について非常に慎重な感情とは、古いMの$ "のDLL -地獄"日時にW indowsの3倍といるW in9xに対処するため、このような痛みが左にメインh arkensバックのF reeBSDのp ortsシステムを更新する。
November 30th, 2007 09:57 11月30日、 2007 09:57
This series of articles has been very, very helpful.記事のこのシリーズはとても、とても役に立つしている。 Many thanks for your contribution!あなたの貢献に感謝を込めて!
December 11th, 2007 20:53 12月11日2007 20:53
Should the problem with downloadable sourcecodes exist for anyone else, if it was just a problem occurring from localhost, changing the listening port from the default 80 to *:80 might help.これがただの問題が起きていたlocalhostからダウンロードsourcecodesの問題を誰にも他の人のため、 、 *には、デフォルトの80からのリスニングポートを変更する存在しているはず: 80役立つかもしれない。 It is highly likely that in the above mentioned cases Apache had not much to do with serving the files on localhost.上記で述べたように、非常にApacheをしていた場合は、ローカルホスト上のファイルサービスを提供するとあまりない可能性があります。
Fedora does not have less dependancies, they are just handeld elswehere out of user eyes. Fedoraのは、ユーザーの目からだけ少なくhandeld elswehereているの依存しているものではありません。
Understanding the package & port system and when and why to update is part of the game.パッケージ&ポートシステムといつ、なぜ更新して、ゲームの一部です理解。
For those who go for Fedora on servers, you might opt for ubuntu instead.人々はFedoraのサーバーに行くためには、 Ubuntuの代わりに選択することがあります。 it’s easy and fast as well as free.は、高速だけでなく、無料で簡単だ。
May 10th, 2008 01:44 5月、第10回2008年01:44
Lol, you should put this somewhere…ロル川は、このどこかにする必要があります...
Befor testing… REBOOT! Beforテスト...のREBOOT ! XD
30 minutes lost trying to fix apache + php and all that was required was reboot ¬¬ 30分のApache + PHPと修正しようとして失われたすべての再起動が必要だった¬ ¬