http://www.php.ru/manual/internals2.buildsys.skeleton.html
http://docstore.mik.ua/orelly/webprog/php/ch14_03.htm
http://www.tuxradar.com/practicalphp/4/10/0
четверг, 27 сентября 2012 г.
PHP Extensions WINDOWS
Requirements
Install VS2008
Extract PHP Binaries (Example c:\php-bin)
Extract PHP Sources (Example c:\php-src)
Add to system path variable path to "c:\php-bin\bin"
Open cmd and type "php -v"
Open "Visual Studio 2008 Command Prompt" & navigate to "c:\php-src\ext"
run "php --extname=module" where module is the name of your new module
cd module && explorer
open module.dsp in vs2k8 express
in file module.c add line #define PHP_COMPILER_ID "%V%" where %V% - is version of your php build it may be VC6 or VC9 or diffrent
Now navigate to C/C++ -> General -> Additional Include Directories. Now select the arrow to the right It's a dropdown box -> Edit Items. Now a screen titled Additional Include Directories will come up. To the far top right, there is a buttons panel, to the button to the left The file button, Click it, now add in the following directories, one by one Click the file icon for every directory given
1 | C:\php-src\ |
2 | C:\php-src\main |
3 | C:\php-src\TSRM |
4 | C:\php-src\win32 |
5 | C:\php-src\Zend |
When creating an extension, be sure to remember to complete this step. This will reference our extension to the current Php version and functions that have already been built. This is to allow of extension to communicate with Php. Not following this step will mass errors.
Navigate to Properties -> Linker -> General -> Additional Library Directories and add the following to it. Please reference Fig 9 to do so.
C:\php-bin\dev\
Navigate to Properties -> Linker -> General -> Additional Library Directories and add the following to it. Please reference Fig 9 to do so.
C:\php-bin\dev\
Now you may compile your first extension))
Now we need to edit php.ini. To do so, we need to go to php.ini and click it. This should bring it up in notepad.exe for default. Scroll down just over half way to the Dynamic Extensions section, of hit Ctrl F and enter extension= and add the following line to the end of the list.1 | extension=php_module.dll |
to check create php file "test.php" with content :
echo ' (', implode(', ', get_extension_funcs("module")), ')
';
?>
and run "php test.php"
Also read
http://blog.slickedit.com/2007/09/creating-a-php-5-extension-with-visual-c-2005/
http://www.dreamincode.net/forums/topic/244215-introduction-to-creating-a-php-extension-for-windows/
http://www.dreamincode.net/forums/topic/184335-creating-a-php-extension-in-c/
http://netindonesia.net/blogs/risman/archive/2008/06/15/part-2-writing-php-extension.aspx
echo ' (', implode(', ', get_extension_funcs("module")), ')
';
?>
and run "php test.php"
Also read
http://blog.slickedit.com/2007/09/creating-a-php-5-extension-with-visual-c-2005/
http://www.dreamincode.net/forums/topic/244215-introduction-to-creating-a-php-extension-for-windows/
http://www.dreamincode.net/forums/topic/184335-creating-a-php-extension-in-c/
http://netindonesia.net/blogs/risman/archive/2008/06/15/part-2-writing-php-extension.aspx
Подписаться на:
Сообщения (Atom)