資源描述:
《linux下配置php開發(fā)環(huán)境》由會(huì)員上傳分享,免費(fèi)在線閱讀,更多相關(guān)內(nèi)容在應(yīng)用文檔-天天文庫。
1、linux中搭建php開發(fā)環(huán)境筆記:一、安裝apache服務(wù)器1.下載httpd-2.4.7.tar.gz安裝包2.新建目錄/usr/local/softwares/php-dev-softwares/apache/apache-httpd,在此目錄>下解壓httpd-2.4.7.tar.gz3.執(zhí)行命令sudo./configure--prefix=/usr/local/softwares/php-dev-softwares/apache/apache-httpd報(bào)錯(cuò):checkingforAPR...noconfigure:error:APRnotfound
2、.Pleasereadthedocumentation.需要安裝apache-apr和apache-apr-util1)下載apr-1.5.0.tar.gz和apr-util-1.5.3.tar.gz2)解壓,執(zhí)行如下命令tar-zxvfapr-1.5.0.tar.gzcdapr-1.5.0./configuremakemakeinstallapr安裝完成。tar-zxvfapr-util-1.5.3.tar.gzcdapr-util-1.5.3./configure--prefix=/usr/local/apr-util--with-apr=/usr/loca
3、l/aprmakemakeinstallapr-util安裝完成3)執(zhí)行安裝httpd命令sudo./configure--with-apr=/usr/local/apr--with-apr-util=/usr/local/apr-util--prefix=/usr/local/softwares/php-dev-softwares/apache/apache-httpd報(bào)錯(cuò):configure:error:pcre-configforlibpcrenotfound.PCREisrequiredandavailable4)安裝PCRE,下載pcre-8.34.t
4、ar.bz2執(zhí)行如下命令sudotar-vxjfpcre-8.34.tar.bz2cdpcre-8.34/sudo./configure--prefix=/usr/local/pcre報(bào)錯(cuò):configure:error:YouneedaC++compilerforC++support.執(zhí)行命令:sudoapt-getinstallbuild-essentialUbuntu并沒有提供C/C++的編譯環(huán)境,因此還需要手動(dòng)安裝。如果想在Ubuntu中編譯c/c++程序,只需要安裝該軟件包就可以了重新執(zhí)行命令cdpcre-8.34/sudo./configure--p
5、refix=/usr/local/pcresudomakesudomakeinstallpcre安裝完成。5)執(zhí)行安裝httpd命令cd/usr/local/softwares/php-dev-softwares/apache/apache-httpd/httpd-2.4.7sudo./configure--with-apr=/usr/local/apr--with-apr-util=/usr/local/apr-util--with-pcre=/usr/local/pcre--prefix=/usr/local/softwares/php-dev-softwa
6、res/apache/apache-httpdsudomakesudomakeinstallhttpd服務(wù)安裝完成進(jìn)入httpd服務(wù)器的安裝bin目錄啟動(dòng)服務(wù)./apachectl-kstart報(bào)錯(cuò):AH00558:httpd:Couldnotreliablydeterminetheserver'sfullyqualifieddomainname,using127.0.1.1.Setthe'ServerName'directivegloballytosuppressthismessagehttpd:Couldnotreliablydeterminetheserv
7、er'sfullyqualifieddomainname,using127.0.1.1forServerName解決方法:修改配置文件conf/httpd.conf找到行#ServerNamewww.example.com:80修改為:ServerNamelocalhost:80報(bào)錯(cuò):(13)Permissiondenied:AH00072:make_sock:couldnotbindtoaddress[::]:80(13)Permissiondenied:AH00072:make_sock:couldnotbindtoaddress0.0.0.0:80解決方法
8、:?jiǎn)?dòng)的時(shí)候加上sudo