Ndị mmepe websaịtị nwere ike ịnwe ike wụnye asụsụ ede ederede PHP na Ubuntu Server. Nke a bụ n'ihi ọtụtụ ihe. Ma n'iji ntuziaka a, onye ọ bụla ga - enwe ike izere mmejọ mgbe nrụnye.
Ingwụnye PHP na Ubuntu Server
Installwụnye asụsụ PHP na Ubuntu Server nwere ike ịme ya n'ụzọ dị iche iche - ọ dabere na ụdị ya yana ụdị sistemụ arụmọrụ n'onwe ya. Na nnukwu ọdịiche dị na otu ahụ n'onwe ha, nke ga-adị mkpa ka egbu egbu.
Ọ dịkwa mma ịmara na ngwugwu PHP gụnyere ọtụtụ mmiri nke, ọ bụrụ na achọrọ, enwere ike itinye ya iche na ibe ya.
Usoro 1: Nwụnye ọkọlọtọ
Ihe nrụnye ọkọlọtọ gụnyere iji ụdị nke ngwugwu ọhụụ. N'ime sistemụ Ubuntu Server ọ bụla, ọ dị iche:
- 12.04 LTS (Kwadebere) - 5.3;
- 14.04 LTS (Trusty) - 5.5;
- 15.10 (Wily) - 5.6;
- 16.04 LTS (Xenial) - 7.0.
A na-ekesara ngwugwu niile site na ebe nrụọrụ na-arụ ọrụ sistemụ arụmọrụ, yabụ ịkwesighi ijikọ ndị ọzọ. Mana itinye ntinye nke ngwugwu zuru oke na nsụgharị abụọ ma dabere na nsụgharị OS. Yabụ, iji wụnye PHP na Ubuntu Server 16.04, mee iwu a:
zọghaa ngwa ngwa
Ma na nke ochie nsụgharị:
wụnye apt-nweta wụnye php5
Ọ bụrụ na ịchọghị ihe niile dị na ngwugwu PHP na sistemụ, ịnwere ike ịwụnye ha iche. Otu esi eme nke a yana ihe enyere iwu ime nke a kwesiri ịkọwa n'okpuru.
Modul maka Apache HTTP Server
Iji wụnye modulu PHP maka Apache na Ubuntu Server 16.04, ịkwesịrị ịgba ọsọ iwu a:
wụnye apt-nweta wụnye libapache2-mod-php
Na mbụ nsụgharị nke os:
wụnye apt-nweta wụnye libapache2-mod-php5
A ga-ajụ gị maka paswọọdụ, mgbe ịbanye nke ị ga-enyerịrị ikike iji wụnye. Iji mee nke a, tinye leta D ma obu "Y" (dabere na ntinye Ubuntu Server) ma pịa Banye.
Ihe foduru bu ichere maka nbudata na ntinye nke ngwugwu iji wuchaa.
FPM
Iji wụnye FPM na sistemụ arụmọrụ 16.04, mee ihe ndị a:
nweta sudo apt-nweta wụnye php-fpm
Na nsụgharị ndị mbụ:
sudo apt-nweta wụnye php5-fpm
N'okwu a, nrụnye ga-amalite na akpaghị aka, ozugbo ịbanye paswọọdụ superuser.
CLI
CLI dị mkpa maka ndị mmepe nke mepụtara mmemme njikwa na PHP. Iji mejuputa usoro mmemme a na ya, na Ubuntu 16.04 ịkwesịrị ịsọpụ iwu a:
nweta sudo apt-nweta wụnye php-cli
Na nsụgharị ndị mbụ:
nweta sudo apt-nweta wụnye php5-cli
Mgbakwunye PHP
Iji mezuo ọrụ niile PHP ga-ekwe omume, ọ bara uru ịwụnye ọtụtụ mgbakwunye maka mmemme eji. Ugbu a, iwu ndị kachasị ewu ewu maka ụdị nrụnye ga-egosi.
Mara: n'okpuru, a ga-enye iwu abụọ maka ndọtị ọ bụla, ebe nke mbụ bụ maka Ubuntu Server 16.04, nke abụọ bụ maka nsụgharị mbụ nke OS.
- Mgbati maka GD:
nweta sudo apt-nweta wụnye php-gd
wụnye apt-nweta wụnye php5-gd
- Mgbati maka Mcrypt:
nweta sudo apt-nweta wụnye php-mcrypt
wụnye apt-nweta wụnye php5-mcrypt
- Ndọtị maka MySQL:
nweta sudo apt-nweta wụnye php-mysql
sudo apt-nweta wụnye php5-mysql
Hụ kwa: Ntụnye nwụnye MySQL na Ubuntu
Usoro 2: Wụnye amaokwu ndị ọzọ
Ekwuru n'elu na ụdị ọ bụla nke Ubuntu Server a ga-arụnye ngwugwu PHP kwekọrọ. Mana nke a anaghị egbochi ike ịwụnye ihe dị na mbụ ma ọ bụ, na nke ọzọ, ụdị mmemme ikpeazụ.
- Ikwesiri iwepu ihe niile PHP arụnyere na sistemu ahụ. Iji mee nke a, na Ubuntu 16.04, jiri iwu abụọ mee:
sudo apt-wepu libapache2-mod-php php-fpm php-cli php-gd php-mcrypt php-mysql
sudo nke-enweta autoremoveNa mbụ nsụgharị nke os:
sudo apt-wepu libapache2-mod-php5 php5-fpm php5-cli php5-gd php5-mcrypt php5-mysql
sudo nke-enweta autoremove - Ugbu a ịkwesịrị ịgbakwunye PPA na ndepụta nke ebe nchekwa, nke nwere nchịkọta nke ụdị PHP niile:
sudo tinye-apt-repository ppa: ondrej / php
nwatakiri nwere ike inweta - N'oge a ị nwere ike iwunye ngwugwu PHP zuru ezu. Iji mee nke a, ezipụta ụdị na iwu nke ya, dịka ọmụmaatụ, "5.6":
sudo apt-enweta wụnye php5.6
Ọ bụrụ na ịchọghị ngwugwu zuru ezu, ịnwere ike ịwụnye modulu iche iche site na ịhọrọ iwu dị mkpa:
sudo apt-nweta wụnye libapache2-mod-php5.6
sudo apt-nweta wụnye php5.6-fpm
nweta sudo apt-nweta wụnye php5.6-cli
nweta sudo apt-nweta wụnye php-gd
nweta sudo apt-nweta wụnye php5.6-mbstring
sudo apt-enweta wụnye php5.6-mcrypt
sudo apt-enweta wụnye php5.6-mysql
sudo apt-nweta wụnye php5.6-xml
Mmechi
Na mmechi, anyị nwere ike ikwu na, ọbụlagodi ihe ọmụma bụ isi gbasara ịrụ ọrụ na kọmpụta, onye ọrụ nwere ike iwunye ma ngwugwu PHP bụ isi yana ngwa ndị ọzọ niile. Isi ihe bụ ịmara iwu dị mkpa iji rụọ ọrụ na Ubuntu Server.