I built my hello_world php module by following tihs: https://zando.io/post/hello-world-php-7-extension/
And I successfully built a hello.so under modules/
But when I tried to load this hello.so, it failed.
(adding extension=hello.so
to php.ini and put the .so file to extension_dir
)
var_dump(extension_loaded('hello'));
var_dump(hello_world());
Output:
bool(false)
Fatal error: Uncaught Error: Call to undefined function hello_world() in /var/www/app/test.php(2) : eval()'d code:1 Stack trace: #0 /var/www/app/test.php(2): eval() #1 {main} thrown in /var/www/app/test.php(2) : eval()'d code on line 1
But when I tried to load my friend's hello_world so file, it works!!
(same source code, same building process...)
I really don't know why...