Linking phpcpp fails when building PHP extension

99 views Asked by At

Environment: I am trying to develop a PHP-CPP extension and have downloaded the the empty extension file from https://www.php-cpp.com/documentation/your-first-extension to start. I have also modified the makefile's INI_DIR variable to point to the correct path.

Problem: When I try to make the empty extension it fails to create the shared library file and says /usr/bin/ld: cannot find -lphpcpp. I'm pretty sure I have php-cpp downloaded correctly, so I have no idea what's wrong. (I have also searched the internet and have found no solutions)

PHP version: 7.4

System: Elementary-OS (Ubuntu)

1

There are 1 answers

0
gearDev On

Turns out that when I first ran make to compile php-cpp it didn't make the libphpcpp.so file. So, I reinstalled it from Github and built it again and it worked. I don't know why I didn't try that the first time.