sam.installation.html

来自「php的帮助文档,涉及到PHP的案例和基本语法,以及实际应用内容」· HTML 代码 · 共 255 行

HTML
255
字号
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html> <head>  <title>Installation</title>  <meta http-equiv="content-type" content="text/html; charset=UTF-8"> </head> <body><div style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="sam.setup.html">Installing/Configuring</a></div> <div class="next" style="text-align: right; float: right;"><a href="sam.configuration.html">Runtime Configuration</a></div> <div class="up"><a href="sam.setup.html">Installing/Configuring</a></div> <div class="home"><a href="index.html">PHP Manual</a></div></div><hr /><div id="sam.installation" class="section">  <h2 class="title">Installation</h2>  <p class="para">   The SAM framework and MQTT support can be built and used without any other prerequisites.   Support for protocols other than MQTT is provided via a set of libraries and some client   side code referred to as XMS.  </p>  <p class="para">   If you only intend to use the built-in MQTT support then you can build and configure SAM as   an extension or simply refer to &quot;php_sam.php&quot; with a &quot;requires&quot; or &quot;requires_once&quot; clause   in your PHP script. In this case you need only install the code without building the   extension using the pear installer:   <div class="example-contents"><pre><div class="cdata"><pre>pecl install -B SAM</pre></div>   </pre></div>  </p>    <div id="sam.installation.linux" class="section">   <h2 class="title">Linux installation steps</h2>   <p class="para">    The sam extension is supplied as a PECL module, which    you should be able to download and install in one step as follows:    <div class="example-contents"><pre><div class="cdata"><pre>pecl install sam</pre></div>    </pre></div>    (Depending on your php environment, you will probably need to be root    to do this.)   </p>   <p class="para">    Make sure that the module is loaded by PHP, by adding following line    to <var class="filename">php.ini</var>:    <div class="example-contents"><pre><div class="cdata"><pre>extension=sam.so</pre></div>    </pre></div>    If you intend to use the XMS support to access the IBM Messaging and Queuing family    you must also enable the SAM XMS extension.    <div class="example-contents"><pre><div class="cdata"><pre>extension=sam_xms.so</pre></div>    </pre></div>   </p>   <p class="para">    If you cannot use the PEAR installer, you can download the extension    and build it manually:    <div class="example-contents"><pre><div class="cdata"><pre>pear download sam          #downloads sam-&lt;version&gt;.tgztar -xzf sam-&lt;version&gt;.tgzcd sam-&lt;version&gt;phpize./configuremakemake install               #you may need to be root for this step</pre></div>    </pre></div>   </p>   <p class="para">    To work with the very latest source, you&#039;ll need to extract it from    cvs and build manually as above.   </p>  </div>      <div id="sam.installation.windows" class="section">   <h2 class="title">Windows installation steps</h2>   <p class="para">    You will probably need to build the sam extension for Windows as there    are only a limited range of pre-built binaries available from the SAM website.    The extension can be built using the standard Windows extension build procedures.   </p>   <p class="para">    You will need the PHP source tree for the version of PHP you wish to    build the SAM extension against which you can obtain from php.net.    This should be unpacked into a working directory of your choice.   </p>   <p class="para">    You will also need the libraries and headers used by PHP extensions    available from http://www.php.net/extra/win32build.zip and this    should be unzipped so that is in your working directory.   </p>   <p class="para">    You should have something like:    <div class="example-contents"><pre><div class="cdata"><pre>c:\php-build\-              |              |---php-5.0.5--|---build              |              |---ext              |              |--- ...              |              |---win32build--|---bin                              |---include                              |---lib</pre></div>    </pre></div>   </p>   <p class="para">    You will need a compiler such as the free version of Visual Studio C++    Express from the Microsoft web site. Also you need the Microsoft    Windows Platform SDK which again can be downloaded from the Microsoft web site.   </p>   <p class="para">    Obtain the SAM extension source using pear (pecl download sam) or by using    CVS and copy the files to a new &quot;sam&quot; directory under the &quot;ext&quot; directory    in your PHP source tree.   </p>   <p class="para">    To build the extension open a build environment window by going to the    start menu-&gt;all programs-&gt;microsoft platform SDK for windows-&gt;    open build environment window-&gt;windows 200 build environment-&gt;    set windows 2000 build environment (retail)   </p>   <p class="para">    This should open a command prompt with all the environment variables    set up to access the platform SDK etc. You then need to set the    environment variables for Visual Studio by issuing the command    &quot;vcvars32.bat&quot; in the window.   </p>   <p class="para">    Change directory to your working directory e.g. cd c:\php-build. Then    make sure the win32build tools are accessible by adding them to the    PATH environment variable:    <div class="example-contents"><pre><div class="cdata"><pre>set PATH=..\win32build\bin;%PATH%</pre></div>    </pre></div>   </p>   <p class="para">    Run the buildconf.bat command. This should rebuild the configure.js    file.   </p>   <p class="para">    Run the cscript command with the appropriate options. To build just the    SAM extension framework and MQTT support use:    <div class="example-contents"><pre><div class="cdata"><pre>cscript /nologo configure.js --with-sam</pre></div>    </pre></div>    To build the SAM framework and the XMS support use:    <div class="example-contents"><pre><div class="cdata"><pre>cscript /nologo configure.js --with-sam --with-sam_xms=&quot;c:\program files\ibm\xms&quot;</pre></div>    </pre></div>   </p>   <p class="para">    The additional parameter passed for sam_xms is the installation path to the    XMS libraries and runtime that were installed as described under prerequisites    at the top of this page.   </p>   <p class="para">    You can specify whatever other cscript parameters you require to    include or exclude items from the php build or select options.   </p>   <p class="para">    Assuming all has gone well so far you can now finally run a make for the SAM framework!    <div class="example-contents"><pre><div class="cdata"><pre>nmake php_sam.dll</pre></div>    </pre></div>    Also if you are using the XMS support you must make the sam_xms extensions:    <div class="example-contents"><pre><div class="cdata"><pre>nmake php_sam_xms.dll</pre></div>    </pre></div>   </p>   <p class="para">    If you have used Visual Studio 2005 to build the DLLs please see below for additional steps that    must be carried out before proceeding further.   </p>   <p class="para">    The DLLs created (php_sam.dll and optionally php_sam_xms.dll)    can now be copied to the subdirectory appropriate for your PHP    set-up. Make sure that the module(s) are loaded by PHP, by    adding following line to <var class="filename">php.ini</var>:    <div class="example-contents"><pre><div class="cdata"><pre>extension=php_sam.dll</pre></div>    </pre></div>    If you intend to use the XMS support to access the IBM Messgaing and Queuing family    you must also enable the SAM XMS extension.    <div class="example-contents"><pre><div class="cdata"><pre>extension=php_sam_xms.dll</pre></div>    </pre></div>   </p>  </div>      <div id="sam.installation.VS2005" class="section">   <h2 class="title">Additional steps for Visual Studio 2005</h2>   <p class="para">    If you build the SAM extension with the Microsoft Visual Studio 2005    compiler and tools you need to perform an additional step in the build    process to ensure the <var class="filename">php_sam.dll</var> is able to link    with the C runtime libraries at runtime. This step includes the    dependancy manifest into the DLL. Switch to the directory where the    <var class="filename">php_sam.dll</var> has been generated (usually    Release_TS or Debug_TS below the php source directory) and issue the    following magic incantation:    <div class="example-contents"><pre><div class="cdata"><pre>mt.exe -manifest php_sam.dll.manifest -outputresource:php_sam.dll;2</pre></div>    </pre></div>    If you are using the XMS capabilities you will need to do the same with the    SAM XMS DLL:    <div class="example-contents"><pre><div class="cdata"><pre>mt.exe -manifest php_sam_xms.dll.manifest -outputresource:php_sam_xms.dll;2</pre></div>    </pre></div>   </p>   <p class="para">    If you build the SAM extension using the compiler and libaries from    Microsoft Visual Studio 2005 you will also need to ensure that the    runtime components are installed on the system on which you intend to    use SAM. This can be accomplished by installing Visual Studio 2005 or    by using the freely distributable    <a href="http://www.microsoft.com/downloads/details.aspx?familyid=32BC1BEE-A3F9-4C13-9C99-220B62A191EE&displaylang=en" class="link external">&raquo; runtime package</a>.   </p>  </div>   </div><hr /><div style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="sam.setup.html">Installing/Configuring</a></div> <div class="next" style="text-align: right; float: right;"><a href="sam.configuration.html">Runtime Configuration</a></div> <div class="up"><a href="sam.setup.html">Installing/Configuring</a></div> <div class="home"><a href="index.html">PHP Manual</a></div></div></body></html>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?