Installing PHP.docx

上传人:b****6 文档编号:7836618 上传时间:2023-01-26 格式:DOCX 页数:27 大小:1.77MB
下载 相关 举报
Installing PHP.docx_第1页
第1页 / 共27页
Installing PHP.docx_第2页
第2页 / 共27页
Installing PHP.docx_第3页
第3页 / 共27页
Installing PHP.docx_第4页
第4页 / 共27页
Installing PHP.docx_第5页
第5页 / 共27页
点击查看更多>>
下载资源
资源描述

Installing PHP.docx

《Installing PHP.docx》由会员分享,可在线阅读,更多相关《Installing PHP.docx(27页珍藏版)》请在冰豆网上搜索。

Installing PHP.docx

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']

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 经管营销 > 经济市场

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1