Bug #75618 [Opn->Nab]: embed sapi can not compile

From: Date: Mon, 04 Dec 2017 14:47:21 +0000
Subject: Bug #75618 [Opn->Nab]: embed sapi can not compile
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-212908@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=75618&edit=1

 ID:                 75618
 Updated by:         requinix@php.net
 Reported by:        jsntzhuhu at gmail dot com
 Summary:            embed sapi can not compile
-Status:             Open
+Status:             Not a bug
 Type:               Bug
 Package:            Unknown/Other Function
 Operating System:   Linux Mint
 PHP Version:        7.2.0
 Block user comment: N
 Private report:     N

 New Comment:

.


Previous Comments:
------------------------------------------------------------------------
[2017-12-04 14:43:20] jsntzhuhu at gmail dot com

chinese version ,suggest for chinese.

这个问题困扰了半天,因为这个问题在前面的bugs中也有出现
团队提示是更新过了代码。所以怀疑是php本身的问题在php7
中再次出现。也就没细想,这个命令行是php
embed教程中的
所以也没有怀疑其真实性。
所以这个问题的核心就是把 源文件名
紧跟gcc 其他参数向
后排就可以解决这个问题。

还好发现的早,没有浪费社区人力。为占用社区资源表示抱歉。

------------------------------------------------------------------------
[2017-12-04 14:37:59] jsntzhuhu at gmail dot com

sorry, this is not problem , just !!! compile method !!!

gcc ukcframe.c -o ukcframe -Iphp7/include/php	-Iphp7/include/php/main -Iphp7/include/php/Zend
-Iphp7/include/php/TSRM -Wall -g -lstdc++ -lphp7 -Lphp7/lib 

It's ok .  

cmd line 's order is wrong .

------------------------------------------------------------------------
[2017-12-04 08:45:15] jsntzhuhu at gmail dot com

Description:
------------
simple sapi code can't link.

same as https://bugs.php.net/bug.php?id=48911 




Test script:
---------------
#include "sapi/embed/php_embed.h"
int main( int argc , char ** argv){
	PHP_EMBED_START_BLOCK(argc,argv);
	
	PHP_EMBED_END_BLOCK();
	return 0;
	
}


gcc -Iphp7/include/php	-Iphp7/include/php/main -Iphp7/include/php/Zend -Iphp7/include/php/TSRM -Wall
-g -lstdc++ -lphp7 -Lphp7/lib ukcframe.c -o ukcframe

Expected result:
----------------
compile success

Actual result:
--------------
ukcframe.c:6: undefined reference to `php_embed_init'
ukcframe.c:6: undefined reference to `executor_globals'
ukcframe.c:6: undefined reference to `executor_globals'
ukcframe.c:6: undefined reference to `executor_globals'
ukcframe.c:8: undefined reference to `executor_globals'
ukcframe.c:8: undefined reference to `executor_globals'
ukcframe.c:8: undefined reference to `php_embed_shutdown'



------------------------------------------------------------------------



--
Edit this bug report at https://bugs.php.net/bug.php?id=75618&edit=1


Thread (4 messages)

« previous php.bugs (#212908) next »