From:             thomas at koch dot ro
Operating system: Debian Lenny
PHP version:      5.3.0
PHP Bug Type:     *Compile Issues
Bug description:  embed sapi misses SAPI_API

Description:
------------
I try the most simple program that uses the embed sapi. Due to missing
SAPI_API macros the symbols 

int php_embed_init(int argc, char **argv PTSRMLS_DC);
void php_embed_shutdown(TSRMLS_D);
extern sapi_module_struct php_embed_module;

get visibility hidden in the resulting libphp5.so.

Fix: put SAPI_API before these symbols in sapi/embed/php_embed.c.

(Also in php_embed.h ?)

Thanks to ScottMac for the hint on IRC!


Reproduce code:
---------------
#include <sapi/embed/php_embed.h>

int main(int argc, char *argv[]) 
{ 
    PHP_EMBED_START_BLOCK(argc,argv) 
    PHP_EMBED_END_BLOCK() 
    return 0; 
}

Expected result:
----------------
should compile without problems

Actual result:
--------------
gcc  -c -I/usr/local/include/php/ -I/usr/local/include/php/main -
I/usr/local/include/php/Zend -I/usr/local/include/php/TSRM -Wall -g -o 
worker.o worker.c
gcc  -L/usr/local/lib -lphp5 -o worker worker.o
worker.o: In function `main':
/var/checkouts/gearman-php-worker/worker.c:5: undefined reference to 
`php_embed_init'
/var/checkouts/gearman-php-worker/worker.c:6: undefined reference to 
`php_embed_shutdown'
collect2: ld returned 1 exit status
make: *** [all] Error


-- 
Edit bug report at http://bugs.php.net/?id=48911&edit=1
-- 
Try a CVS snapshot (PHP 5.2):        
http://bugs.php.net/fix.php?id=48911&r=trysnapshot52
Try a CVS snapshot (PHP 5.3):        
http://bugs.php.net/fix.php?id=48911&r=trysnapshot53
Try a CVS snapshot (PHP 6.0):        
http://bugs.php.net/fix.php?id=48911&r=trysnapshot60
Fixed in CVS:                        
http://bugs.php.net/fix.php?id=48911&r=fixedcvs
Fixed in CVS and need be documented: 
http://bugs.php.net/fix.php?id=48911&r=needdocs
Fixed in release:                    
http://bugs.php.net/fix.php?id=48911&r=alreadyfixed
Need backtrace:                      
http://bugs.php.net/fix.php?id=48911&r=needtrace
Need Reproduce Script:               
http://bugs.php.net/fix.php?id=48911&r=needscript
Try newer version:                   
http://bugs.php.net/fix.php?id=48911&r=oldversion
Not developer issue:                 
http://bugs.php.net/fix.php?id=48911&r=support
Expected behavior:                   
http://bugs.php.net/fix.php?id=48911&r=notwrong
Not enough info:                     
http://bugs.php.net/fix.php?id=48911&r=notenoughinfo
Submitted twice:                     
http://bugs.php.net/fix.php?id=48911&r=submittedtwice
register_globals:                    
http://bugs.php.net/fix.php?id=48911&r=globals
PHP 4 support discontinued:          http://bugs.php.net/fix.php?id=48911&r=php4
Daylight Savings:                    http://bugs.php.net/fix.php?id=48911&r=dst
IIS Stability:                       
http://bugs.php.net/fix.php?id=48911&r=isapi
Install GNU Sed:                     
http://bugs.php.net/fix.php?id=48911&r=gnused
Floating point limitations:          
http://bugs.php.net/fix.php?id=48911&r=float
No Zend Extensions:                  
http://bugs.php.net/fix.php?id=48911&r=nozend
MySQL Configuration Error:           
http://bugs.php.net/fix.php?id=48911&r=mysqlcfg

Reply via email to