PHP extension development under Mac system

Source: Internet
Author: User

Usually in the development of PHP, some core code, such as cryptographic functions or code that needs to be executed efficiently, can be written in C language extension. This article mainly introduces the extended development process, the specific code implementation reference generated file description.

Currently PHP is using the XAMPP 5.6.8, the installation path is:/applications/xampp/.

1. Before you begin, download the PHP 5.6.8 extension from the website: http://php.net/get/php-5.6.8.tar.bz2/from/a/mirror

2. After extracting into ext directory, execute:./ext_skel--extname=test, the test directory will be generated in the Ext directory, and a development framework with the extension name test is established in this directory.

3. Go to the test directory and edit the Config.m4 file

Remove the comment label "DNL" from the following line, as follows:

Php_arg_enable (myfunctions, whether to ENABLE myfunctions support,

Make sure, the comment is aligned:

[--enable-myfunctions enable myfunctions support])

4. Generate the Configure file using Phpize (phpize path:/applications/xampp/xamppfiles/bin/phpize)

5. Execute the command:./configure--with-php-config=/applications/xampp/xamppfiles/bin/php-config

6. Execute command: Make compile extension

7. Execute command: sudo make install installation extension

8. Modify the php.ini file (path:/applications/xampp/xamppfiles/etc/php.ini)

9. Restart Apache and execute the command in turn:

sudo/applications/xampp/xamppfiles/apache2/scripts/ctl.sh stop

sudo/applications/xampp/xamppfiles/apache2/scripts/ctl.sh start

PHP extension development under Mac system

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.