If you ever happen to want to link against installed libraries in a given directory, LIBDIR, you must either use libtool, and specify the full pathname of the library, or use the `-LLIBDIR' flag during linking and do at least one of the following: - add LIBDIR to the `LD_LIBRARY_PATH' environment variable during execution - add LIBDIR to the `LD_RUN_PATH' environment variable during linking - use the `-Wl,--rpath -Wl,LIBDIR' linker flag
See any operating system documentation about shared libraries for more information, such as the ld(1) and ld.so(8) manual pages. ----------------------------------------------------------------------
<?php $encryptor = new Encryptor\Aes128(); var_dump($encryptor);
报错:
1 2 3 4 5 6 7
~/codeDir/cCode/encryptor # php encryptor.php PHP Warning: PHP Startup: Unable to load dynamic library 'encryptor.so' (tried: /usr/local/lib/php/extensions/no-debug-non-zts-20170718/encryptor.so (Error relocating /usr/local/lib/php/extensions/no-debug-non-zts-20170718/encryptor.so: zim_encryptor_aes128___construct: symbol not found), /usr/local/lib/php/extensions/no-debug-non-zts-20170718/encryptor.so.so (Error loading shared library /usr/local/lib/php/extensions/no-debug-non-zts-20170718/encryptor.so.so: No such file or directory)) in Unknown on line 0
Fatal error: Uncaught Error: Class 'Encryptor\Aes128' not found in /root/codeDir/cCode/encryptor/encryptor.php:3 Stack trace: #0 {main} thrown in /root/codeDir/cCode/encryptor/encryptor.php on line 3
原因:只是声明了___construct方法:
1
PHP_METHOD(encryptor_aes128, __construct);
并没有去实现它,所以导致了报错。
所以需要去实现它:
1 2 3 4
PHP_METHOD(encryptor_aes128, __construct) { // specific implementation }
Maybe you could buy me a cup of coffee.
Scan this qrcode
Open alipay app scan this qrcode, buy me a coffee!
Scan this qrcode
Open wechat app scan this qrcode, buy me a coffee!