4

I need to make an php extension(.so) file which can be made portable. The created library works fine on one of my machines, but, when I send it to other machine, it does not load properly as a dependency of cJSON is missing on the target machine. I do not have accessibility to install the cJSON library on the machine, though I can copy all the required files. My current libtool command is :

/bin/bash /home/ubuntu/php-extension/libtool --mode=link cc -DPHP_ATOM_INC -I/home/ubuntu/php-extension/include 
-I/home/ubuntu/php-extension/main -I/home/ubuntu/php-extension -static -I/usr/include/php/20170718 
-I/usr/include/php/20170718/main 
-I/usr/include/php/20170718/TSRM 
-I/usr/include/php/20170718/Zend 
-I/usr/include/php/20170718/ext 
-I/usr/include/php/20170718/ext/date/lib 
-I/usr/local/include 
-L/usr/local/lib -lcjson  
-DHAVE_CONFIG_H  -g -O2    
-o myextension.la -export-dynamic -avoid-version -prefer-pic -module -rpath /home/ubuntu/php-extension/modules  
myextension.lo 

How should I build the extension so it contains all the dependent libraries and there is no need to install library on target machine?

Ashish Kamble
  • 2,555
  • 3
  • 21
  • 29
ankit jain
  • 350
  • 2
  • 12

0 Answers0