arnaud-lb / php-go

php-go allows to call Go code from PHP, with minimal code boilerplate
MIT License
187 stars 20 forks source link

PHP Startup: Invalid library #9

Closed tohidplus closed 3 years ago

tohidplus commented 4 years ago

This is my php file:

<?php
$module = phpgo_load("example.so", "example");
echo $module->toUpper('foo');

When I run the command

php  index.php 

I got this error

PHP Warning:  PHP Startup: Invalid library (maybe not a PHP library) '/usr/lib/php/20170718/example.so' in Unknown on line 0
PHP Fatal error:  Uncaught Error: Call to undefined function toUpper() in /home/tohid/go/src/gotutorial/extension/index.php:2
Stack trace:
#0 {main}
  thrown in /home/tohid/go/src/gotutorial/extension/index.php on line 2
dignfei commented 3 years ago

This is my php file:

<?php
$module = phpgo_load("example.so", "example");
echo $module->toUpper('foo');

When I run the command

php  index.php 

I got this error

PHP Warning:  PHP Startup: Invalid library (maybe not a PHP library) '/usr/lib/php/20170718/example.so' in Unknown on line 0
PHP Fatal error:  Uncaught Error: Call to undefined function toUpper() in /home/tohid/go/src/gotutorial/extension/index.php:2
Stack trace:
#0 {main}
  thrown in /home/tohid/go/src/gotutorial/extension/index.php on line 2

没有设置好路径