国产av日韩一区二区三区精品,成人性爱视频在线观看,国产,欧美,日韩,一区,www.成色av久久成人,2222eeee成人天堂

PHP(六)PHP と fpm および NGINX

Jun 13, 2016 pm 12:22 PM
enable fastcgi nbsp php with

PHP(6)PHP (fpm および NGINX
を使用) PHP(6)PHP (fpm および NGINX

1) を使用。 Nginx で最新の PHP をセットアップします
ライブラリを構(gòu)築するための libtool で問題が発生した場(chǎng)合。
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool

を使用する必要があります。nginx をインストールし、そこに pcre インストール パッケージを配置します。必要になる場(chǎng)合があります。

factCGI を使用して PHP をインストールし、nginx を操作します
http://sillycat.iteye.com/blog/2078154
http://sillycat.iteye.com/blog/2149513

PHP-FPM VS FastCGI
mod_php、これは Apache の組み込みモジュールです。 Apache HTTP サーバーは PHP をサポートできます。
FastCGI、PHP と HTTP サーバー間のインターフェイス。 mod_fastcgi は、Apache サポート FastCGI プロトコルのモジュールです。 PHP と Web サーバーを分離できます。
PHP-FPM は、span-cgi と同様に強(qiáng)力で、リモート FastCGI をサポートします。 (FastCGI Process Manager)

最新パッケージをダウンロード
> wget http://ar2.php.net/distributions/php-5.6.10.tar.gz

それを解凍し、必要なツールを準(zhǔn)備します。
>> ./configure --prefix=/home/carl/tool/php-5.6.10 --with-openssl --with-iconv-dir=/usr/lib --with-curl=/opt/local/include/curl --with-mysql --with-pdo-pgsql --with-zlib-dir --with-freetype-dir --enable-mbstring --with-libxml-dir=/usr --enable-soap --enable-カレンダー --with-curl --with-mcrypt --with-zlib --with-gd --with-pgsql --disable-rpath --enable-inline-optimization --with-bz2 --with-zlib -- Enable-sockets --enable-sysvsem --enable-sysvshm --enable-pcntl --enable-mbregex --enable-exif --enable-bcmath --with-mhash --enable-zip --with-pcre-regex --with-mysql --with-pdo-mysql --with-mysqli --with-jpeg-dir=/usr --with-png-dir=/usr --enable-gd-native-ttf --with- fpm-user=www-data --with-fpm-group=www-data --with-libdir=/lib/x86_64-linux-gnu --enable-ftp --with-imap --with-imap-ssl - -with-kerberos --with-gettext --with-xmlrpc --with-xsl --enable-opcache --enable-fpm

エラー メッセージ:
configure: error: OpenSSL のライブラリが見つかりません

解決策:
http://mac-dev-env.patrickbougie.com/openssl/
> wget http://www.openssl.org/source/openssl-1.0.2c.tar.gz
解凍してインストールしてみてください
>。 ./configure darwin64-x86_64-cc --prefix=/Users/carl/tool/openssl-1.0.2c
作成してインストールします

> ./configure --prefix=/Users/carl/tool/php-5.6.10 --with-openssl --with-iconv-dir=/usr/lib --with-curl=/opt/local/include/curl --with-mysql --enable-fpm --with-zlib-dir --with-freetype-dir --enable-mbstring --with-libxml-dir=/usr --enable-soap --enable-calendar - -with-mysqli

それを作成してインストールすると、php がパスに追加します。
>> php --version
PHP 5.6.10 (cli) (ビルド: Jun 29 2015 17:35:04)
Copyright (c) 1997-2015 The PHP Group
Zend Engine v2.6.0, Copyright ( c) 1998-2015 Zend Technologies

nginx を再起動(dòng)するコマンド
>。 sudo sbin/nginx -s reload

構(gòu)成を確認(rèn)します
> sudo sbin/php-fpm -t

php-fpm
> を再起動(dòng)するコマンド。 sudo sbin/php-fpm

権限を確認(rèn)してください
> sudo chown -R root:nobody /opt/nginx/html/
> sudo chmod g w /opt/nginx/htm

php-fpm の設(shè)定を変更します。設(shè)定ファイルは
/opt/php/etc/php-fpm.conf

pid = run/php-fpm.pid
error_log = log/php-fpm.log
ユーザー = 誰(shuí)も
グループ = 誰(shuí)も
;listen = 127.0.0.1:9000
listen = var/run /php5-fpm.sock

別の設(shè)定ファイル
/opt/php/etc/php.ini

エラー メッセージ:
sudo sbin/nginx
nginx: [ warn] 1024 の worker_connections がオープン ファイル リソースの制限を超えています: 256

解決策:
制限を確認(rèn)してください
>。 ulimit -a
コア ファイル サイズ (ブロック、 -c) 0
データ セグメント サイズ (キロバイト、 -d) 無(wú)制限
ファイル サイズ (ブロック、 -f) 無(wú)制限
最大ロック メモリ (キロバイト、 -l) 無(wú)制限
最大メモリ サイズ (kバイト、-m) 無(wú)制限
オープン ファイル (-n) 256
パイプ サイズ (512 バイト、-p) 1
スタック サイズ (kバイト、-s ) 8192
CPU 時(shí)間 (秒、-t) 無(wú)制限
最大ユーザープロセス (-u) 709
仮想メモリ (kbytes, -v) 無(wú)制限

制限を変更する
> ulimit -n 1024

次に、php-fpm
>sudo sbin/php-fpm

が実行されていることを確認(rèn)します
>>。 ps -ef | grep fpm
0 98821 1 0 火午前11時(shí) ?????????? 0:01.34 sbin/php-fpm
-2 98822 98821 0 火曜日午前 11 時(shí) ?????????? 0:00.00 sbin/php-fpm
-2 98823 98821 0 火曜日午前 11 時(shí) ?????????? 0:00.00 sbin/php-fpm
501 2991 5692 0 2:37PM ttys006 0:00.01 grep fpm

NGINX の構(gòu)成、構(gòu)成ファイルは /opt/nginx/conf/nginx.conf
location ~ .php$ {
#root html;
#fastcgi_pass 127.0.0.1:9000;
#fastcgi_index index.php;
#fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
# include fastcgi_params;
# with php5-fpm
fastcgi_keep_conn on;
try_files $uri =404;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_intercept_errors on;
fastcgi_split_path_info ^(. .php)(.*)$;
fastcgi_hide_header X-Powered-By;
# fastcgi_pass 127.0.0.1:9000;
fastcgi_pass unix:/opt/php/var/run/ php5-fpm.sock;
}

非常にシンプルな hello world ページを配置します /opt/nginx/html/info.php
> cat info.php
phpinfo();
?>

URL
http://localhost/info.php
でそのページにアクセスします
2. PHP 知識(shí)を思い出してください
todo...
3. MySQLi
todo...

參考文獻(xiàn):
http://sillycat.iteye.com/blog/2194084
http://sillycat.iteye.com/blog/2066063
http://sillycat.iteye.com/blog/1543227
http://sillycat.iteye.com/blog/769110
http://sillycat.iteye.com/blog/2149513
http ://sillycat.iteye.com/blog/2078154

fastcgi を使用して PHP をビルドする
https://www.howtoforge.com/how-to-build-php-5.6-fpm-fastcgi-with -zend-opcache-and-apcu-for-ispconfig-3-on-debian-7-wheezy
https://www.howtoforge.com/installing-nginx-with-php5-and-php-fpm-and -mysql-support-lemp-on-debian-wheezy
https://www.zybuluo.com/phper/note/50231
https://www.zybuluo.com/phper/note/50231

PHP-FPM
http://php-fpm.org/

このウェブサイトの聲明
この記事の內(nèi)容はネチズンが自主的に寄稿したものであり、著作権は原著者に帰屬します。このサイトは、それに相當(dāng)する法的責(zé)任を負(fù)いません。盜作または侵害の疑いのあるコンテンツを見つけた場(chǎng)合は、admin@php.cn までご連絡(luò)ください。

ホットAIツール

Undress AI Tool

Undress AI Tool

脫衣畫像を無(wú)料で

Undresser.AI Undress

Undresser.AI Undress

リアルなヌード寫真を作成する AI 搭載アプリ

AI Clothes Remover

AI Clothes Remover

寫真から衣服を削除するオンライン AI ツール。

Clothoff.io

Clothoff.io

AI衣類リムーバー

Video Face Swap

Video Face Swap

完全無(wú)料の AI 顔交換ツールを使用して、あらゆるビデオの顔を簡(jiǎn)単に交換できます。

ホットツール

メモ帳++7.3.1

メモ帳++7.3.1

使いやすく無(wú)料のコードエディター

SublimeText3 中國(guó)語(yǔ)版

SublimeText3 中國(guó)語(yǔ)版

中國(guó)語(yǔ)版、とても使いやすい

ゼンドスタジオ 13.0.1

ゼンドスタジオ 13.0.1

強(qiáng)力な PHP 統(tǒng)合開発環(huán)境

ドリームウィーバー CS6

ドリームウィーバー CS6

ビジュアル Web 開発ツール

SublimeText3 Mac版

SublimeText3 Mac版

神レベルのコード編集ソフト(SublimeText3)

PHPとは何ですか、そしてなぜそれがWeb開発に使用されるのですか? PHPとは何ですか、そしてなぜそれがWeb開発に使用されるのですか? Jun 23, 2025 am 12:55 AM

PhpBecamepopularforwebdevelopmentduetoitseaseaseaseaseasease、SeamlessintegrationWithhtml、widespreadhostingsupport、andalargeecosystemincludingframeworkelavelandcmsplatformslikewordspresspressinsinsionsisionsisionsisionsisionsionsionsisionsionsionsisionsisions

最新のPHP開発とベストプラクティスを最新の狀態(tài)に保つにはどうすればよいですか? 最新のPHP開発とベストプラクティスを最新の狀態(tài)に保つにはどうすればよいですか? Jun 23, 2025 am 12:56 AM

postaycurrentwithpdevellyments andbest practices、follow keynewsourceslikephp.netandphpweekly、egagewithcommunitiessonforums andconferences、keeptooling and gradivallyadoptnewfeatures、andreadorcontributeTopensourceprijeprijeprijeptrijeprijeprests.

PHPタイムゾーンを設(shè)定する方法は? PHPタイムゾーンを設(shè)定する方法は? Jun 25, 2025 am 01:00 AM

tosettherighttimezoneInphp、usedate_default_timezone_set()functionthestthestofyourscriptwithavalididentifiersiersuchas'america/new_york'.1.usedate_default_timezone_set()beforeanydate/timefunctions.2.2.Altertentally、confuturethephp.inifilebyset.

PHPでのユーザー入力を検証して、特定の基準(zhǔn)を満たすことを確認(rèn)するにはどうすればよいですか? PHPでのユーザー入力を検証して、特定の基準(zhǔn)を満たすことを確認(rèn)するにはどうすればよいですか? Jun 22, 2025 am 01:00 AM

tovalidateuserinputinphp、usebuilt-validationfunctionslikefilter_var()andfilter_input()、applyRegularexpressionsforcustomformatsusususussusorphoneNumbers、checkdatatypesfornumerueSlikeageorpricepriceprice

PHP(serialize()、unserialize())のデータシリアル化とは何ですか? PHP(serialize()、unserialize())のデータシリアル化とは何ですか? Jun 22, 2025 am 01:03 AM

thephpfunctionSerialize()andunserialize()areusedtoconvertcomplexdatastructostorestorestorustorasandabackagain.1.serialize()c onvertsdatalikecarraysorobjectsraystringcontainingtainingtainingepeandStructureinformation.2。

HTMLファイルにPHPコードを埋め込むにはどうすればよいですか? HTMLファイルにPHPコードを埋め込むにはどうすればよいですか? Jun 22, 2025 am 01:00 AM

PHPコードをHTMLファイルに埋め込むことができますが、ファイルに.phpの拡張機(jī)能があることを確認(rèn)して、サーバーが正しく解析できるようにします。標(biāo)準(zhǔn)タグを使用してPHPコードをラップし、HTMLのどこにでも動(dòng)的コンテンツを挿入します。さらに、同じファイルでPHPとHTMLを複數(shù)回切り替えて、條件付きレンダリングなどの動(dòng)的関數(shù)を?qū)g現(xiàn)できます。短いラベル、引用マークエラー、または省略されたエンドラベルによって引き起こされる問題を回避するために、サーバーの構(gòu)成と構(gòu)文の正確性に注意してください。

クリーンで保守可能なPHPコードを書くためのベストプラクティスは何ですか? クリーンで保守可能なPHPコードを書くためのベストプラクティスは何ですか? Jun 24, 2025 am 12:53 AM

清潔で維持しやすいPHPコードを書くための鍵は、標(biāo)準(zhǔn)、合理的な構(gòu)造に従って、コメント、テスト能力を適切に利用する明確な命名にあります。 1。$ userDataやcalculatetotalprice()などの明確な変數(shù)、関數(shù)、クラス名を使用します。 2。PSR-12標(biāo)準(zhǔn)統(tǒng)一コードスタイルに従ってください。 3.責(zé)任に従ってコード構(gòu)造を分割し、MVCまたはLaravelスタイルのカタログを使用して整理します。 4.麺スタイルのコードを避け、単一の責(zé)任でロジックを小さな関數(shù)に分割します。 5.キーポイントにコメントを追加し、インターフェイスドキュメントを書き込み、パラメーター、返品値、例外を明確にします。 6.テスト可能性を改善し、依存関係を採(cǎi)用し、グローバルな狀態(tài)と靜的な方法を減らします。これらのプラクティスは、コードの品質(zhì)、コラボレーション効率、メンテナンス後の容易さを改善します。

See all articles