Now let's just say a few steps to developing a PHP extension under Windows:
The first software to be prepared is:
Cygwin installation path E:\app\cygwin
Visual Studio C + + 6.0,
Modify the environment variable and set the installed PHP path to the environment variable. Here, assuming that my PHP installation directory is: e:\app\php5.2.5, then I add the Windows environment variable after the installation directory. Easy to use Php.exe for a while.
PHP source code, this is assumed to be e:\c_source_code\php-5.2.5
1, modify the file "php source file directory/ext/ext_skel_win32.php", here is: E:\c_source_code\php-5.2.5\ext, which is mainly to modify the Cygwin path. $cygwin _path = ' e:\app\cygwin\bin ';
Change the $cygwin_path to the path where you actually installed the Cygwin.
2, in the source code ext directory is E:\c_source_code\php-5.2.5\ext, execute PHP ext_skel_win32.php--extname= , it will be generated in the EXT directory at this time directory, which is the framework in which we will develop PHP extensions. For example, if you run Php.exe ext_skel_win32.php--extname=foo, the Foo directory will be generated in the EXT directory.
3. Copy the Php-root\dev\php5ts.lib to "ext/ In For example, if you are developing a php extension called Foo, you will need to copy the Php-root\dev\php5ts.lib to the PHP source file directory \ext\foo.
4, modify the foo.c content, write the C code we need.
5. Enter Directory, open . DSP.
Set up the VC6 project,
Set Menu "Build", "Remove Project Configuration", select "Win + release_ts",
Set Menu "Project", check "Win release_ts"
Open tab "Connect", set the directory in "Output file name",
[Optional] Open tab "C + +", add "preprocessor definition", compile_dl_ (note All caps, which are joined by default), cancels the predefined "libzend_exports" (otherwise Zend functions cannot be introduced).
6, set up, compile, generate a DLL file, the file name is . dll, for example, in our example for Foo.dll
to copy Foo.dll to E:\app\ext directory, Add a line of Extension=foo.dll in the php.ini, reboot Apache, check phpinfo (), and find out that our PHP extension foo () has been loaded and can already be extended using this foo.
http://www.bkjia.com/phpjc/323063.html www.bkjia.com true http://www.bkjia.com/phpjc/323063.html techarticle Now simply say a step in developing PHP extensions under Windows: The first software to be prepared is: Cygwin installation path E:\app\cygwin Visual Studio C + + 6.0, modifying environment variables, putting the already ann ...