踩坑教训

用protobuf编译时报错:protoc: error while loading shared libraries: libprotoc.so.9: cannot open shared object file: No such file or directory 的解决方法

By karp 3343 Views 3 MIN READ 0 Comments

export LD_LIBRARY_PATH=/usr/local/lib

[root@xxx ~]#protoc --php_out=/root/test_protobuf/ test.proto
protoc: error while loading shared libraries: libprotobuf.so.15: cannot open shared object file: No such file or directory
[root@xxx ~]#export LD_LIBRARY_PATH=/usr/local/lib
[root@xxx ~]#protoc --php_out=/root/test_protobuf/ test.proto
[root@xxx ~]#cd /root/test_protobuf/
[root@xxx test_protobuf]#ll
total 16
-rw-r--r-- 1 root root 1193 Mar  6 14:47 AddressBook.php
drwxr-xr-x 2 root root 4096 Mar  6 14:47 GPBMetadata
-rw-r--r-- 1 root root 3694 Mar  6 14:47 Person.php
-rw-r--r-- 1 root root 1866 Mar  6 14:47 PhoneNumber.php

本文由 karp 原创

采用 CC BY-NC-SA 4.0 协议进行许可

转载请注明出处:https://www.ikarp.top/index.php/archives/268.html

标签: php

0 评论