频道栏目
首页 > 资讯 > 其他 > 正文

clion开发调试php7扩展

17-08-16        来源:[db:作者]  
收藏   我要投稿

生成扩展框架

执行php7源码/xxx/php-7.1.3/ext目录下的ext_skel命令,生成扩展框架

$ /xxx/php-7.1.3/ext/ext_skel   --extname=ljtest //ljtest为扩展名

编译并把扩展加入php

$ cd ljtest
$ /usr/local/php-7.1.3/bin/phpize
$ ./configure --with-php-config=/usr/local/php-7.1.3/bin/php-config
$ make
$ sudo make install 

把编译好的扩展加到php.ini中,用/usr/local/php-7.1.3/bin/php -m 看一下扩展是否按照

用clion导入扩展代码

这里写图片描述

编辑CMakeLists.txt

cmake_minimum_required(VERSION 3.7)
project(ljtest)
add_custom_target(makefile COMMAND make && sudo make install WORKING_DIRECTORY ${PROJECT_SOURCE_DIR})

注:编辑完后要重新reload一下

编辑 config.m4

按照提示把dnl注释去掉

dnl $Id$
dnl config.m4 for extension ljtest

dnl Comments in this file start with the string 'dnl'.
dnl Remove where necessary. This file will not work
dnl without editing.

dnl If your extension references something external, use with://如果需要使用第三方扩展就去掉下面的dnl注释

dnl PHP_ARG_WITH(ljtest, for ljtest support,
dnl Make sure that the comment is aligned:
dnl [  --with-ljtest             Include ljtest support])

dnl Otherwise use enable://否则就去掉下面的注释

PHP_ARG_ENABLE(ljtest, whether to enable ljtest support,
Make sure that the comment is aligned:
[  --enable-ljtest           Enable ljtest support])

配置clion

选择Edit Configurations
这里写图片描述
进入编辑页面
这里写图片描述
注:如果没有马克file选项,说明在配置完CMakeLists.txt时没有reload
点击run,如果出现下图就说明成功了
这里写图片描述

debug

打断点,按debug加入debug
这里写图片描述

相关TAG标签
上一篇:Eclipse安装Spring-tool-suite
下一篇:java数据结构与算法-递归二分查找
相关文章
图文推荐

关于我们 | 联系我们 | 广告服务 | 投资合作 | 版权申明 | 在线帮助 | 网站地图 | 作品发布 | Vip技术培训 | 举报中心

版权所有: 红黑联盟--致力于做实用的IT技术学习网站