Innovate faster and cut risk with PHP experts from Zend Services.
Learn PHP from PHP experts with free, on-demand, and instructor led courses.
Submit support requests and browse self-service resources.
This extension skeleton can be compiled without any changes. The first “phpize” command is a part of the PHP build we created in the first step. (It should still be in the PATH.)
$ make install
These commands should build our shared extension “test.so” and copy it into appropriate directory of our PHP installation. To load it, we need to add a line into our custom php.ini
$ vi ~/php-bin/DEBUG/etc/php.ini
Add the following line:
Check that extension is loaded and works. “php -m” command prints the list of loaded extensions:
$ php -m | grep test
We may also run the functions defined in our “test” extension:
$ php -r ‘test_test1();’
The extension test is loaded and working!
$ php -r ‘echo test_test2(“world\n”);’
Now it makes sense to start tracking our source changes using version control system. (I prefer GIT.)
$ git init
$ git add config.m4 config.w32 test.c php_test.h tests
$ git commit -m “Initial Extension Skeleton”
Request PDF Version