一聚教程网:一个值得你收藏的教程网站

php怎么安装sockets扩展?linux下开启php的sockets扩展支持实例

mg电子:Thetroubled-plaguedSamsungGalaxyNote7,nowwithdrawnfromsales,usedtobeoneoftheSouthKoreangroup'smostsought-aftersmartphonemodels.[Photo/Agencies]China'scellphoneshipmentsincreasedto560millionslastyear,up8percentyear-on-year,accordingtodatafromtheChinaAcademyofInformationandCommunicationsTechnology.Thedatafromtheacademy,affiliatedtotheMinistryofIndustryandInformationTechnology,alsoshowChineseconsumersarelikelytoreplace400millionto500millioncellphonesayear,addingtotheexistingheapofabout1billiondiscardedcellphones.Instarkcontrast,therecyclingrateofcellphonesislessthan2percent.Abluebookonelectronicsconsumption,issuedbyShanghai'sHorizonResearchConsultancyGroupin2015,says65.4percentofconsumerschoosetodiscard,butnotrecycle,theiroldelectronicdevices.Ifdigitalwasteisnotrecycledorappropriatelydisposedof,itcoulddamagetheenvironment.Evenduringthemanufacturingprocessofsmartphones,somevolatilematerialslikelead,cadmium,mercuryandothermetals,ifnottreatedproperly,couldharmtheecosystemandhumanhealththroughsoilandwatercontamination.Andtheplasticcasesofdigitaldevicesreleasetoxic,evencarcinogenic,fumeswhentheyareburned.However,discardedelectronicdevices,includingcellphones,canbeturnedintousefulitems.Recently,theTokyoOrganisingCommitteeoftheOlympicandParalympicGamesannouncedaplantorecyclediscardedelectronicdevices,includingcellphones,andextractthemetalsfromthemtomakemedalsforthe2020Olympics.Somecellphonecomponentshavevaluablemetalsthatarecostlierthanevengoldandsilverore.TheAppleEnvironmentalResponsibilityReport2016saidinfiscalyear2015,Applegeneratedapproximately13.1millionpoundsofwaste,anddivertedover22.5millionpoundsofmaterialsfromlandfillthroughrecyclingandcomposting.However,thecostofrecyclingcellphonesishigh,notonlyintermsofmoneybutalsootherfactors.Themostimportantfactorispersonalprivacyandinformationsecurity.AccordingtotheChinaAcademyofInformationandCommunicationsTechnology,inJanuarythisyearthedomesticshipmentofsmartphonesreached45.03million,accountingfor96percentofthetotalshipmentofcellphones.Smartphonesarepopularnotjustbecausepeopleusethemtocallorreceivecallsandsendorreceivemessages,butalsobecausetheyneedthemtokeepintouchwiththeircontactsonWeChat,useAlipay,conductcellbankingoperationsandbrowsetheinternet.Andsinceusershavetoinputalotofpersonalinformationintothecellphonestocarryouttheseoperations,theyarereluctanttohavethemrecycledastheyfeartheirpersonalinformationcouldbeleakedandmisusedbyunscrupulouspeople.Thesecondfactorthatmakescellphonerecyclingdifficultisthelackofenoughandregularrecyclingchannels.ForiPhone,iPadandiMacusers,forexample,theonlyavailablechannelforrecyclingisApplestores.Theotherfactoristhatthemoneyusersgetinexchangeforhandingovertheircellphonestoregisteredrecyclingagentsisnotenoughtooffsettheriskoftheirpersonalinformationbeingmisused.Somostusersprefertokeepthediscardedsmartphonesathome.Besides,regularrecyclingofcellphonesmostlyinvolvesdismantlingthedevicesandextractingfromthemmetalsandparts,whosevaluemaynotbeworththecostofrecycling.Thisimbalanceintherecyclingmarketisperhapsthegreatestreasonwhyahugepercentageofthediscardedcellphonesisnorecycled.Onlywhenthefactorsareaddressedcantherecyclingofthecellphonesbeeffectivelyimplemented.TheauthorisawriterwithChinaDaily.zhangyuchen@chinadaily.com.cn

时间:2017-02-24 00:00:00 编辑:简简单单 来源:转载

下个相同版本的php源码,进行编译安装,再按照上面步骤搞,生成的so。copy到rpm装的那个,修改php.ini进行扩展就行了,

或者到网上找相同版本,相同系统 的编译好的so文件。

在linux下给PHP安装socket扩展,参考方法如下:

#cd /usr/soft/php/ext/sockets (进入原php安装文件下的sockets目录)
#/usr/local/php/bin/phpize (运行安装后的php安装文件下的phpize)
#./configure --prefix=/usr/local/php/lib --with-php-config=/user/local/php/bin/php-config --enable-sockets
#make
#make install
再修改/usr/local/php/etc/php.ini文件
#extension_dir = "/usr/local/php/lib/php/extensions/no-debug-non-zts-20090626/" (php5.4版本以上不用加扩展路径)

extension=sockets.so

(若不想修改extension_dir路径或改路径下还有别的.so文件,亦可直接写:

extension=/usr/local/php/lib/php/extensions/no-debug-non-zts-20090626/sockets.so)

重启apache或者nginx等进程,完成。

 

文章评论

热门栏目

合作: 重庆时时彩开户 葡京娱乐场官网 mg电子