Installing PHP.docx
- 文档编号:7836618
- 上传时间:2023-01-26
- 格式:DOCX
- 页数:27
- 大小:1.77MB
Installing PHP.docx
《Installing PHP.docx》由会员分享,可在线阅读,更多相关《Installing PHP.docx(27页珍藏版)》请在冰豆网上搜索。
InstallingPHP
InstallingPHP
Contents
1Overview
oInstallingApache
UpgradefromApache2.0.55(andup)
oInstallingPHP
UpgradefromPHP5.1.2andup
2InstallingMySQL
oOtherstuff
ZendOptimizer
3Copyright/Misc.
Overview
Firstthingsfirst:
ThistutorialwillshowyouhowtoinstallApache2withPHP5andMySQLintheintentiontouseitforDEVELOPEMENT!
WewillneedApache,PHPandMySQL.
Apache'snewestversionforWindowsis2.0.58(recommended)and2.2.2Download(Downloadthe.msiinstallpackage)
PHP'snewestversionis5.1.4Download(Downloadthezippackage&thePECLmodulescollection)
MySQL'snewestversionis5.0.22Download(Downloadtheonedescribedas"Windows(x86)")
[TOP]
InstallingApache
The.mscinstallermakesthiseasy.Runtheinstaller:
Next...
Agree...
Ifthefieldsweren'tfilled-inautomaticallyfilled-inyou'llhavetofilltheminyourself.
Theoption"forAllUsers..."shouldbeselected
Next...
ClickonChange...
I'vesetmypathtoC:
\Server...feelfreetosetittowhateveryoulike
Imightaddthattheinstallalwayscreatesafoldercalled"Apache2"soyoudon'tneedtoadda"apache"folder.
Ifyoudoyou'llendupwithapathlike"C:
\Server\Apache\Apache2".
NOTE:
TheproblemwiththepathhasbeenfixedinApache2.2.2.InstallitinC:
\Server\Apache2!
Install...
Waitabit.
Done!
Oknowwe'llcheckififyou'ddoneitright.Ahandytoolshouldhavebeeninstalledwiththeserver.It'safeather-likeicononthetaskbar.Right-clickandselect"OpenApacheMonitor".
Iftheiconnextto"Apache2"isgreenthenapacheshouldberunning.
Nowvisithttp:
//localhost/(orhttp:
//127.0.0.1/).
Youshouldseesomethiknglikethis:
Itworks!
Oknowwe'llchangeafewsettingstomovethefolderinwhichthewebfilesarestored-theDocumentRoot.(thispartisoptionalbutitmakesitmakethingseasier).
Find:
DocumentRoot"C:
/Server/Apache2/htdocs"
∙andchangeitto
DocumentRoot"C:
/Server/htdocs"
∙Find:
/Server/Apache2/htdocs"> ∙andchangeittowhateveryouchangedthelineaboveto /Server/htdocs"> Youhavetomakesurethetthefolderyouspecifiedexistsandrestartapache.JustopenthaeApacheMonitorandclickon"Restart". [TOP] UpgradeApache JustGotoControlPanel->AddorRemovePrograms,findApacheanduninstallit.Irecommendyoutore-dothehttpd.confediting. DeleteyouroldApachefolder. FollowtheApacheinstallationguidetoinstallthenewversion. IfyouhadPHPinstalledyou'llhavetocopysomefilestoyourApachedirectory,asdescribedinthePHPinstallationguide. IfyouhavedecidedtouseApache2.2.2you'llhavetotaketheadditionalApache2.2.xPHPinstallationstep. InstallingPHP ThispartofthetutorialassumesyouhaveApache2alreadyinstalled. Afterdownloadingthetwozipfilesextractthefirston(theoneWITHOUT"pecl"init'sname)toC: \Server\(Youcanchoosewahteverfolderyoulikebutit'sagoodideatohaveitallinoneplace. Afterextractingitandrenamethefolderto"php". NowExtractthesecond.zipfiletoC: \Server\php\ext\.Justcopyeverything. GobacktoC: \Server\phpandrenamethefile"php.ini-dist"to"php.ini" Editthephp.ini: Find: error_reporting=E_ALL&~E_NOTICE ∙andchangeitto error_reporting=E_ALL ∙Find: display_startup_errors=Off ∙andchangeitto display_startup_errors=On ∙(optional;SeeManual)Find: track_errors=Off ∙andchangeitto track_errors=On ∙Find: ;arg_separator.output="&" ∙andchangeitto arg_separator.output="&" ∙Find: register_long_arrays=On ∙andchangeitto register_long_arrays=Off ∙(improtant)MagicQuotesareveryannoying Find: magic_quotes_gpc=On ∙andchangeitto magic_quotes_gpc=Off ∙(improtant)Extensions(thisisneededifyouwanttouseadatabase...orgd) Find: extension_dir="./" ∙andchangeitto extension_dir="C: \Server\php\ext" ∙Itshouldpointtotheextfolder.Ifyou'veextractedphptoanotherdirectorythepathshouldbedifferent. ∙Find: ;extension=php_mbstring.dll ;extension=php_bz2.dll ;extension=php_curl.dll ;extension=php_dba.dll ;extension=php_dbase.dll ;extension=php_exif.dll ;extension=php_fdf.dll ;extension=php_filepro.dll ;extension=php_gd2.dll ;extension=php_gettext.dll ;extension=php_ifx.dll ;extension=php_imap.dll ;extension=php_interbase.dll ;extension=php_ldap.dll ;extension=php_mcrypt.dll ;extension=php_mhash.dll ;extension=php_mime_magic.dll ;extension=php_ming.dll ;extension=php_mssql.dll ;extension=php_msql.dll ;extension=php_mysql.dll ;extension=php_oci8.dll ;extension=php_openssl.dll ;extension=php_oracle.dll ;extension=php_pgsql.dll ;extension=php_shmop.dll ;extension=php_snmp.dll ;extension=php_sockets.dll ;extension=php_sqlite.dll ;extension=php_sybase_ct.dll ;extension=php_tidy.dll ;extension=php_xmlrpc.dll ;extension=php_xsl.dll ∙andchangeittooneofthese: oReasonable-ThisissomethingyoumayfindonaPHP5.1host. oMinimum-Theminimumnumberofextensionsaservershouldhave. oAllwebserver-Allextensionsexceptthosethatareuseless/harmfulwhenrunonawebserver. oAll-Allextensions ∙Note: Allextensionsasinallthatworkwithoutadditionaldownloads. ∙NowyouhavetoinstallPHPwithApache. Firstyou'llhavetoStopApache.TodothatopentheApacheMonitorandclickonStop. NhowgotoC: \Server\Apache2\confandopenhttpd.conf Atthebottom,add: LoadModulephp5_moduleC: /Server/php/php5apache2.dll PHPIniDirC: /Server/php AddTypeapplication/x-httpd-php.php ∙Mindthatifyouchosetoinstallatadifferentlocationthepathsshouldbedifferent. ∙Find DirectoryIndexindex.htmlindex.html.var ∙andchangeitto: DirectoryIndexindex.phpindex.htmlindex.htmindex.html.var NowmovetoC: \Server\public_htmlandaddafilenamed"phpinfo.php"withthecontent: php phpinfo(); ? > CopythefilesshownontheimagetoC: \Server\Apache2\ IfyouinstalledApache2.2.xyou'llhavetodothisaswell: PHP'sphp5apache2.dllwasmadetoworkwithApache2.0.xonly.You'llneedtogettherightfileandunlessyouwanttocompileityourselfyou'llhavetodownloadit.You'llhavetofollowtheinstructionsinthereadmefilethatcomeswiththezipfile.Omiteverythingafter #Addtoyourhttpd.conf DoNOTdowhatiswrittenbelowthatline.Youhavealreadydoneit. StartApachebyopeningtheApacheMonitorandclickingstart. Ifyouseemessages"Modulecannotbefound"(youshouldn't)justfindthemoduleinphp.iniandaddasemicolononthebeginningoftheline. IfPHPwasinstalledcorrectlythestatusbarshouldshowsomethinglikethis: Apache/2.0.58(Win32)PHP/5.1.3 Nowvisithttp: //localhost/phpinfo.php(orhttp: //127.0.0.1/phpinfo.php). IfyouseeinformationaboutyourPHPinstalleverythingshouldwork. Done! [TOP] UpgradefromPHP5.1.2 RemovethewholePHPfolder.Theonlythingyoumightwanttobackupisyourphp.ini. RemovetheselectedfilesfromyourApachedirectory. Followtheinstallationinstructionsuptothepointwherephp.iniisedited.Ifyou'vebackupedyourphp.iniyoucanjustcopyittothephpfolder.Youshouldchecktheextensionspartthoughasthesemighthavechanged. [TOP] InstallingMySQL Justprettymuchfollowtheimages.Mindthecommentsbelowsomeimages. Next... Custominstall... Change... Let'schangethepathtoC: \Server\MySQLsoeverythingisinoneplace. OkthenNext... Install... Skipthisunlessyoureallyneedtodothat... Installationcomplete.Nowweneedtoconfiguretheserver. Makesureyou'vecheckedthecheckbox. Youcanchangethepathifyouneedto.Butyoudon'thaveto. Probablythemostimportantconfigscreen. Youshouldcheck"EnableTCP/IPnetworking"checkboxbutthereissomeriskinvolved.Youshouldmakesurethatnobodywillconnecttothatportexceptforyou. THesecondcheckboxisalsoimprtant.IfyouplantowriteSQLwhichisnotasstrictorifyou'reusingPHPsoftwarewhichhaspoorlywrittenqueries(vbulletinhasproblems)youshoulduncheckit.ButyoushouldleaveitcheckedasyoushouldwriteyourSQLcorrectly. Checkboth. Hereyoucansettherootuser(It'ssomethingliketheserveradminifyoudidn'tknow)password.Youcansetittowhateveryoulikeoruncheckthe"ModifySecuritySettings"checkbox. Thiswillallowyoutoconnectwith"root"astheuserandanemptystringasthepassword.It'snotsecurebutifnooneelseconnectstoyouserver(nobodyshould-it'sadevelopementservers)it'llmakelifeeasier. Done! Nowtotestit. ThispartassumesyouhaveaServerwithPHPinstalled. DownloadphpMyAdminfrom ExtractthefiletoyouryouDocumentRoot\pma(C: \Server\htdocs\pmaforexample). Edit"config.default.php"locatedinthepmafolder. ∙Find: $cfg['PmaAbsoluteUri']=''; ∙andchangeitto $cfg['PmaAbsoluteUri']='http: //localhost/pma/'; ∙(optional)Find: $cfg['Servers'][$i]['extension']='mysql';//ThephpMySQLextensiontouse('mysql'or'mysqli') ∙andchangeitto $cfg['Servers'][$i]['extension']='mysqli';//ThephpMySQLextensiontouse('mysql'or'mysqli') ∙ThemysqliextensionwasmadetousethenewfunctionalityintroducedinMySQL4.1andup.phpMyAdmincanuseit. ∙(important)Thisiswhereyouhavetoenteryoudatabaseusernameandpassword Find: $cfg['Servers'][$i]['auth_type']='config';//Authenticationmethod(config,httporcookiebased)? $cfg['Servers'][$i]['user']='root';//MySQLuser $cfg['Servers'][$i]['password']
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- Installing PHP