I have created a PHP extension. On a Windows server it compiles and runs like a charm. On a Linux system (Red Hat 9 out of the box, with PHP 4.2.2) the extension compiles but does not load.
To make things easier I have compiled the sample PHP extension. Still no success.
/var/log/httpd/error_log says:
PHP Warning: Invalid library (maybe not a PHP library) 'first_module.so' in Unknown on line 0
This is what I have done:
Create "first_module.c" (the content is listed on the PHP web site, see the link above).
Compiled and linked:
cc -fpic -DCOMPILE_DL=1 -I/usr/local/include -I/home/sb/pro/php-4.3.5 -I/home/sb/pro/php-4.3.5/main -I/home/sb/pro/php-4.3.5/Zend -I/home/sb/pro/php-4.3.5/TSRM -c -o first_module.o first_module.c
cc -shared -L/usr/local/lib -rdynamic -o first_module.so first_module.o
Copied first_module.so to /usr/lib/php4
Created /etc/php.d/first_module.ini containing the line "extension=first_module.so".
Having done this, the error message shown above occurs when restarting httpd. Any idea what I can do to fix the problem?
Stefan