arnaud-lb / php-go

php-go allows to call Go code from PHP, with minimal code boilerplate

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

PHP Startup: Invalid library

tohidplus opened this issue · comments

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

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

没有设置好路径