Chapter1:ScopeofthisDocument1HowtousePDFlibproductswithPHPLastchange:October22,2020LatestPDFlibversioncoveredinthisdocument:9.
3.
0p2Latestversionofthisdocumentavailableat:www.
pdflib.
com/documentation/howtos/Contact:PDFlibGmbHFranziska-Bilek-Weg980339München,Germanyphone+49894523384-0support@pdflib.
comwww.
pdflib.
com1ScopeofthisDocumentThisdocumentexplainsvariouspossibilitiesforsuccessfullydeployingPDFlibproductsasaPHPextension.
ThegenerictermPDFlibisusedtodesignateoneofthefollowingdistinctproducts:>ThePDFlibbaseproduct>PDFlib+PDI,asupersetofPDFlibwhichcontainsthePDFImportLibrary(PDI)>PDFlibPersonalizationServer(PPS),asupersetofPDFlib+PDIwithadvancedBlockfillingfeaturesforpersonalizingPDFdocuments.
MostofthePDFlibinformationappliestootherPDFlibGmbHproductsanalogously.
Notesforthefollowingproductsareincludedwhereapplicable:>PDFlibTET(TextandImageExtractionToolkit)>PDFlibPLOP(Linearization,Optimization,Protection)andPLOPDS(DigitalSigna-ture)ThemethodsfordeployinganyoftheseproductsasaPHPextensionarethesameinallcases.
Multipleversionsoftheseproductscannotbedeployedatthesametime.
Howev-er,multipleproductscancoexistwithinonePHPinstallation.
EvaluationversionsofPDFlibproductsarefullyfunctional,butdisplayademostampacrossallgeneratedPDFpagesunlessavalidlicensekeyisapplied.
OtherPDFlibGmbHproductshaveotherre-strictionsinevaluationmode(seedocumentation).
ThisdocumentappliestothefollowingversionsofPDFlibGmbHproducts:>PDFlib9.
3.
0p2>TET5.
3>PLOPandPLOPDS5.
5Whereapplicable,version-specificinformationisprovidedseparately.
2ThePDFlib-in-PHPHowTo2Platforms,PHPVersionsandThreadSafetySupportedplatforms.
PDFlibGmbHproductsforusewithPHPareasloadableexten-sionmoduleswhichareimplementedasDSOs(dynamicsharedobjects,alsocalleddy-namiclinklibraryDLL).
Theyareavailableonthefollowingplatforms:>WindowsServerx86/x64andWindows7/8/10x86/x64>macOS>Linuxonx86andIntel64>AlpineLinuxonIntel64>LinuxonzSeries>FreeBSDIntel64SupportedPHPversions.
ThedistributionpackagesshippedbyPDFlibGmbHcontainDSOsforseveralPHPversions.
Thesearegroupedintodirectoriesasfollows(notallPHPversionsaresupportedonallplatforms,though):>bind/php/php-730forPHP7.
3.
x>bind/php/php-740forPHP7.
4.
x>bind/php/php-800forPHP8.
0.
xThreadsafety.
OnmostplatformstwovariantsofthePHPbinaryareavailable,andthePDFlibDSOmustmatchtheselectedPHPversion:>Thread-safe(TS):thisversionshouldgenerallybeusedwhenloadingPHPasamod-uleintoaWebserver.
Thethread-safeversionshouldbeusedwhenloadingPHPasanApachemodule.
>Non-thread-safe(NTS):thisversionincludesntsinthedirectorynameandshouldgenerallybeusedwhenusingPHPinaWebserverthroughFastCGIprotocol,work-ingwiththecommand-lineinterface(CLI),orintegratingPHPwithIISviaFastCGI.
RefertothePHPWebsiteformoreinformationregardingTSandNTSversionsofPHP.
Chapter3:RequiredSkillLevels33RequiredSkillLevelsMakingPDFlibworkwithPHPrequiresvariousskilllevelsdependingonyouroperatingsystemplatform.
Wewillclassifytasksaccordingtothefollowingskillsets:>APHPWebprogrammerknowshowtowritecodeforPHP,butdoesn'thaveexperi-encewithotherlanguagesorgeneralsystemadministrationtasks.
ThePHPpro-grammerusuallyhasaccesstootherpeoplewhoareresponsibleforperformingcon-figurationtasks.
>AsysadminfeelscomfortableworkingwithPEARandothercommand-linetools,hap-pilyeditsphp.
inianddoesnothesitatetorestarttheWebserver(i.
e.
ApacheorIIS)ifrequiredforinstallationorconfigurationpurposes.
Appropriatepermissions(accessrights)todoallthisarealsopartofthesysadminprofile.
>ACdeveloperhasaccesstoaCdevelopmentenvironment(headerfiles,compiler,linker,associatedsystemlibraries)andcanworkwithconfigurescriptsandMake-filesorcorrespondingIDEfeatures.
Itmayhelptoclassifyyourselfaccordingtothesetypesofdevelopers.
TheremainderofthisdocumentdescribestaskswhichrequireatleastsysadminorCdeveloperskills.
PHPdeveloperswithoutadditionalknowledgeorassistancewillnotbeabletoperformtherequiredstepswithoutassistance.
4ThePDFlib-in-PHPHowTo4TestingyourInstallationAfteryouinstalledyourPDFlibproductextensionforPHPusinganyofthemethodsdiscussedinthisdocumentyoumaywanttotestyourinstallationinordertoseewhethereverythingworksasexpected.
ThePHPinfopage.
YoucantestthesuccessofyourPDFlibproductinstallationandconfigurationwiththefollowingsmallPHPscript:Checktheoutputcreatedbyphpinfo().
IfitcontainsthelinePDFlibGmbHBinaryVersionyouareusingaprecompiledPDFlibDSOprovidedbyPDFlibGmbH.
Ifyoudon'tfindanyPDFlibsectioncheckyourlogfilestodeterminethereason.
ThePDFlibproductexamples.
ThedistributionpackageofyourPDFlibproductcon-tainsexamplesinthebind/phpdirectory.
Youcanusethemtotestyourinstallationasfollows:>CopythePHPsamplesanddatafilestoyourhtdocsdirectoryoranotherdirectorywhichhasbeenconfiguredappropriatelyintheWebserver:cp-rbind/php/path/to/htdocscp-rbind/data/path/to/htdocs>pointyourbrowsertotheURLsoftheexamples>enjoythegeneratedPDFsChapter5:PDFlibinHostingEnvironments55PDFlibinHostingEnvironmentsYouarerunningasiteataWebhostingprovider.
Inthiscasetherearevariousconsid-erations(wecanignorethecasewhereaPDFlibextensionforPHPisalreadyinstalledsincethere'snothingmoretodo):>SomeprovidersdonotallowcustomPHPextensions;inthiscaseyouareoutofluck.
>Withsomeprovidersyoucanmaintainyourowncopyofphp.
ini,whileothersdon'tallowthis.
Ifyoucan'teditphp.
iniandthisfilecontainsenable_dl=Offyouareoutofluck.
YouareaWebhostingprovider.
Asaprovideryoushouldbeawareofthefollowing:>AlthoughPDFlibLitesourcecodeisfreelyavailable,andmanyLinuxandPHPdistri-butionscontainPDFlibLite,thePDFlibLitelicensedoesnotcoverfreeuseofPDFlibLiteonaWebhoster'ssystems.
>YoucaninstallcommercialPDFlibDSOsevenwithoutobtainingalicense.
Inthissit-uationyoucaninstalloneoftheprecompiledPDFlibDSOssuppliedbyPDFlibGmbHwithoutalicensekey(i.
e.
ademostampwillbecreated).
Thoseamongyourcustom-erswhowishtocommerciallyuseitcanobtainacommerciallicensetodisablethedemostamp.
Inotherwords,youcanofferPDFlibwithouttheneedforobtainingali-censeforallofyourservers.
TherecommendedmethodistoinstallthePDFlibDSOinsomegloballyaccessibledirectory,andsettheextension=lineinphp.
iniappropri-ately.
>Alternatively,if(likeanincreasingnumberofproviders)youbelieveinPDFlibavail-abilityasacompetitiveadvantage,youcanobtainasitelicensewhichcoversallyourserversandcustomers.
Individualuserswillnolongerberequiredtoobtainalicenseontheirowninthiscase.
PleasecontactPDFlibGmbHifyouareinterestedinmoredetails.
6ThePDFlib-in-PHPHowTo6DeployingthePDFlibDSONoteInadditiontothePDFlibproductfamily,thissectionalsoappliestoPDFlibTETandPDFlibPLOPifyoureplacethestringphp_pdflibwithphp_tetorphp_plop.
Requirements:>Skilllevel:sysadmin>ThePDFlibDSO,eitherbuiltonyourownor(preferably)fromabinarypackagepro-videdbyPDFlibGmbHatwww.
pdflib.
com/download/pdflib-product-family/>WorkingPHPbinaryThissectionappliestotheprecompiledDSOsdistributedbyPDFlibGmbH,aswellastoDSOswhichyouhavebuiltyourself.
6.
1InstallingthePDFlibDSOonWindowsThePDFlibDSOsforWindows(actuallyDLLs)havebeentestedwiththebinaryPHPdis-tributionwhichisavailablefromwindows.
php.
net.
YouwillfindPDFlibDSOsforvariousversionsofPHPonWindowswithandwithoutmulti-threadingsupportinthedistribu-tionpackage.
DependingonthetargetPHPversionthePDFlibDSOshavebeenbuiltwithdifferentversionsofVisualStudio,whichmeansthatthecorrespondingredistributableruntimeDLLsmustbeavailableonthesystem:>ThePDFlibDSOsforPHP7.
0and7.
1havebeenbuiltwithVisualStudio2015(VC14).
>ThePDFlibDSOsforPHP7.
2havebeenbuiltwithVisualStudio2017(VC15).
ForthePHPinstallationprocesspleasefollowthedocumentationofyourPHPdistribu-tionandcopythePDFlibDSOtothedirectorywhichisspecifiedintheextension_dirlineinphp.
ini.
6.
2InstallingthePDFlibDSOonUnixThePDFlibDSOsforvariousUnixplatformswithandwithoutmulti-threadingsupportareavailablefordifferentversionsofPHP.
YouwillfindPDFlibDSOsinthefollowinglo-cationofthedistributionpackage(adjustthesharedlibrarysuffixasnecessaryforyourplatform):bind/php/php-/php_pdflib.
soCopythePDFlibDSOtothedirectorywhichisspecifiedintheextension_dirlineinphp.
ini.
UsingPDFlibwithZendServer.
InordertousePDFlibwithZendServeryoumustin-stalltheDSOphp_pdflib.
sofromthephp-directory.
CopythisDSOtotheexten-siondirectoryandrestartPHP.
6.
3InstallingthePDFlibDSOonmacOSwithSIPThegeneralinstallationprocedureformacOSisthesameasonUnixsystems(seeabove).
However,therearesomeadditionalaspectswhenApple'sSystemIntegrityPro-tection(SIP)isinvolved.
WhenSIPisenabledthePHPbinarywhichcomespreinstalledChapter6:DeployingthePDFlibDSO7withmacOS10.
14Mojaveacceptsonlysignedextensions,andextensionsmustbeload-edfromoneoftheprotectedsystemdirectoriesforlibraries.
Otherextensiondirecto-riesarenotaccepted.
ThePDFlibDSOissignedbyPDFlibGmbH,butinstallationre-quiressomeextrastepsonsystemswithactiveSIP.
ThesestepsarenotrequiredforotherbuildsofthePHPbinary,e.
g.
thosefromHomebrew.
Step1:TemporarilydisableSystemIntegrityProtection(SIP).
Thisrequiresrebootingintorecoverymode:>Restartthesystemandpresscmd-RuntiltheApplelogoappears.
>SelectTerminalfromtheUtilitiesmenu.
>InthewindowthatopenstypecsrutildisableandpressreturntodisableSystemIn-tegrityProtection.
>ChooseRestartfromtheApplemenu.
Step2:InstallthePDFlibDSOinthePHPextensiondirectory.
CopytheappropriateversionofthePDFlibDSOtotheextensiondirectoryofthepreinstalledPHPbinary,e.
g.
cpbind/php/php-710-nts/php_pdflib.
so/usr/lib/php/extensions/no-debug-non-zts-20160303/Step3:EnableSystemIntegrityProtectionagain.
Thisrequiresrebootingagain:>Restartthesystemandpresscmd-RuntiltheApplelogoappears.
>SelectTerminalfromtheUtilitiesmenu.
>InthewindowthatopenstypecsrutilenableandpressreturntoenableSystemInteg-rityProtection.
ThisensuresthatyourmachineisfullyprotectedbySIP.
>ChooseRestartfromtheApplemenu.
NowconfigurethePDFlibextensionforPHPwithoneofthemethodsdescribedinthenextsection.
6.
4UsingthePDFlibDSOLoadingthePDFlibDSOinphp.
ini.
IfyoudecidetoloadthePDFlibDSOeverytimePHPstarts,insertthefollowinglineinphp.
ini(adjustthesharedlibrarysuffix.
dllasnec-essaryforyourplatform,e.
g.
.
so):extension=php_pdflib.
dllandrestartyourWebserversothatthechangesarerecognized.
Custompdflib.
inifile.
IfyourPHPversionsupportsadditional.
inifilesparsingyoucancreateapdflib.
iniconfigurationfilewithasinglelineasfollows(adjustthesharedli-brarysuffix.
dllasnecessaryforyourplatform,e.
g.
.
so):extension=php_pdflib.
dllinthePHP_INI_SCAN_DIRdirectory.
8ThePDFlib-in-PHPHowTo6.
5CommonProblemswithPDFlibDSOs6.
5.
1AllPlatformsBinarycharacteristicsofPHPandPDFlibDSOmustmatch.
SeveralpropertiesofyourPHPbinarymustmatchthecorrespondingpropertiesofthePDFlibDSO.
Theseproper-tiesaredeterminedwhenbuildingPHPandcannotbechangedafterwards.
Theprecom-piledDSOsforPDFlibhavebeenbuiltasfollows:>non-debugversion>withorwithoutmulti-threadingsupport(seeThreadsafety,page2)>theAPIversion:choosethematchingversionfrombind/php/php-IfyouseeanerrormessagesimilartothefollowingwhentryingtoloadthePDFlibDSO,yourPHPbuildnumberdoesnotmatchthatofthePDFlibmodule:Warning:PHPStartup:PDFlib:UnabletoinitializemoduleModulecompiledwithbuildID=API20190902,TSPHPcompiledwithbuildID=API20190902,NTSTheseoptionsneedtomatchinUnknownonline0Alloftheseoptionsmustmatch.
Intheexampleaboveitwasattemptedtoloadthenon-thread-safeDSOintoathread-safePHPbinary.
6.
5.
2Linuxx86andIntel64PDFlibwithXAMPPonLinuxx86.
SomeversionsofsystemlibrariesbundledwiththeXAMPPpackagemaytriggerthefollowingerrormessage:Warning:PHPStartup:Unabletoloaddynamiclibrary'/opt/lampp/htdocs/test/pdf/pdflib/bind/php/php-720/php_pdflib.
so'-/opt/lampp/lib/libgcc_s.
so.
1:version`GCC_4.
2.
0'notfound(requiredby/usr/lib/libstdc++.
so.
6)inUnknownonline0Inthiscaseyoumustdisablethefollowingtwolinesinthefilebin/envvars,e.
g.
byadd-ingacommentcharacteratthestartoftheline:#binbuildLD_LIBRARY_PATH="/opt/lampp/lib/:$LD_LIBRARY_PATH"#binbuildexportLD_LIBRARY_PATHPDFlibwithXAMPPonLinuxIntel64.
Ifyouareusingthe32-biteditionofXAMPPyoumustusethe32-biteditionofPDFlibforthiscombination.
However,youmayseethefollowingerrormessage:Warning:PHPStartup:Unabletoloaddynamiclibrary'/opt/lampp/htdocs/test/pdf/PDFlib-x.
y.
z-Linux-php/bind/php/php-720/php_pdflib.
so'-libstdc++.
so.
6:wrongELFclass:ELFCLASS64inUnknownonline0ThereasonforthiserroristhatwhileXAMPPincludessomeofthe32-bitruntimelibrar-iesrequiredforPDFlib,oneimportantruntimelibraryisstillmissing.
Youmustinstallthe32-bitversionoflibstdc++.
so.
6onthesystem.
Forexample,onDebiansystemsthiscanbeachievedwiththefollowingcommand:apt-getinstallia32-libsChapter6:DeployingthePDFlibDSO96.
5.
3macOSPDFlibwithXAMPPonmacOS.
IfyouaddthePDFlibPHPextensiontoyourphp.
inionanmacOSIntelmachinewhichhasXAMPPinstalled,thefollowingerrormessageap-pears:dyld:NSLinkModule()errordyld:Symbolnotfound:__cg_jpeg_resync_to_restartReferencedfrom:/System/Library/Frameworks/ApplicationServices.
framework/Versions/A/Frameworks/ImageIO.
framework/Versions/A/ImageIOExpectedin:/Applications/xampp/xamppfiles/lib/libjpeg.
62.
dylibThePDFlibextensionislinkedagainsttheApplicationServicesFramework,andXAMPPchangestheDYLD_LIBRARY_PATH.
Thiscombinationconfusesthedynamiclinkeditor.
WefoundthatunsettingDYLD_LIBRARY_PATHcuresthisproblem.
Usethefollowinglineaslastcommandinxamppfiles/bin/envvars:unsetDYLD_LIBRARY_PATH10ThePDFlib-in-PHPHowTo7AdditionalResources>ThepublicPDFlibmailinglistforgeneraldiscussion:groups.
yahoo.
com/neo/groups/pdflib/conversations/topics>PDFlibsupportforcommerciallicensees:support@pdflib.
com>GeneralinformationoninstallingPHP:www.
php.
net/install
妮妮云的来历妮妮云是 789 陈总 张总 三方共同投资建立的网站 本着“良心 便宜 稳定”的初衷 为小白用户避免被坑妮妮云的市场定位妮妮云主要代理市场稳定速度的云服务器产品,避免新手购买云服务器的时候众多商家不知道如何选择,妮妮云就帮你选择好了产品,无需承担购买风险,不用担心出现被跑路 被诈骗的情况。妮妮云的售后保证妮妮云退款 通过于合作商的友好协商,云服务器提供2天内全额退款,超过2天不退款 物...
A400互联怎么样?A400互联是一家成立于2020年的商家,A400互联是云服务器网(yuntue.com)首次发布的云主机商家。本次A400互联给大家带来的是,全新上线的香港节点,cmi+cn2线路,全场香港产品7折优惠,优惠码0711,A400互联,只为给你提供更快,更稳,更实惠的套餐,香港节点上线cn2+cmi线路云服务器,37.8元/季/1H/1G/10M/300G,云上日子,你我共享。...
HostKvm发布了夏季特别促销活动,针对香港国际/韩国机房VPS主机提供7折优惠码,其他机房全场8折,优惠后2GB内存套餐月付仅5.95美元起。这是一家成立于2013年的国外主机服务商,主要提供基于KVM架构的VPS主机,可选数据中心包括日本、新加坡、韩国、美国、中国香港等多个地区机房,均为国内直连或优化线路,延迟较低,适合建站或者远程办公等。下面分享几款香港VPS和韩国VPS的配置和价格信息。...
extension_dir为你推荐
同ip网站查询服务器禁PING 是不是就可以解决同IP网站查询问题lunwenjiancepaperrater论文检测准确吗陈嘉垣陈浩民狼吻陈嘉恒是什么时候的事冯媛甑冯媛甄 康熙来了www.yahoo.com.hk香港的常用网站同一服务器网站一个服务器放多个网站怎么设置?mole.61.com摩尔庄园的米米号和密码我都忘了 只记得注册的邮箱 怎么办-_-www.baitu.com韩国片爱人.欲望的观看地址m.kan84.net经常使用http://www.feikan.cc看电影的进来帮我下啊www.5any.comwww.qbo5.com 这个网站要安装播放器
工信部域名备案查询 hostigation 5折 Dedicated Hello图床 新站长网 云鼎网络 湖南服务器托管 数字域名 100m空间 世界测速 php空间购买 美国网站服务器 hkt 香港亚马逊 www789 qq金券 服务器论坛 服务器硬件配置 博客域名 更多