Compile and install Amfext for PHP5.3 under Windows
Amfext officially did not provide the PHP5.3 version of the DLL files, have to do their own compilation, the following is the compilation of the small note:
1. Download the necessary software.
1). PHP5.3 for Win32 binary and source code one copy
2). VC6 or more IDE
3). Cygwin.
4). Two Necessary packages
Http://www.php.net/extra/bindlib_w32.zip
Http://www.php.net/extra/win32build.zip
5). Download Amfext version 0.9.2-dev
2. Unzip the software to the appropriate directory
1). Unzip the PHP binary code into the e:\php5.3.6 directory (in fact we are only interested in the Php5ts.lib file under the dev subdirectory)
2). Unzip the PHP source code into the E:\php5.3.6-sources directory
3). Unzip the Amfext 0.9.2 into the E:\php5.3.6-sources\ext\amfext directory
4). Unzip the Bindlib_w32.zip and Win32build.zip to the same directory (e.g. C:\win32build)
Set the path set Path=%path%;c:\win32build\bin
3. Compiling Amfext VC Project
1). Open the AMFEXT.DSP project file
2). Set up the project
Project->settings (Win32 Release)->link is: e:\php5.3.6\dev\php5ts.lib
Build->set Active Project Configuration Check amftext-win32 Release.
3). Compiling Amfext
Since Amfext for php5.3 has a bug, it is necessary to modify the AMF.C before compiling
On line 1188, replace: int deallocresult = (*struc)->refcount; with int deallocresult = Z_REFCOUNT_PP (struc); On line 2674, replace: newval->refcount--; With z_delref_p (newval);
Now press F7 to compile the project, prompting
Cannot open include file: '.. /main/config.w32.h ', prompted to find the file, to the source code of the PHP main directory of the next look, sure enough, there is no such file, to generate this file yourself:
Step 1. To PHP source code root directory execution Buildconf.bat
Step 2. To the PHP source code root directory to execute Configure.bat (or execute Cscript/nologo configure.js--with-php-build= ". /win32build "--without-libxml--disable-odbc)
If there is no previous set path=%path%;D: \win32build\bin will appear as follows:
Checking for Bison.exe ...
Error:bison is required
Recompile project, error. A whole bunch of php_stream_transport.h error
like
This is the A syntax error was not found for the macro report.
Open this file and add
typedef int socklen_t;
to the file header.
Recompile project, not unexpectedly in the PHP source code ext subdirectory can see Php_amf.dll
1 Floor wanluoliang 2011-07-12
Thank you very much for your tutorial ...
2 floor live711 2011-08-13
can your compiled DLL be downloaded and used directly?