You are here: Re: [PHP] Can't load extension (was Re: PHP to C interface?) « PHP « IT news, forums, messages
Re: [PHP] Can't load extension (was Re: PHP to C interface?)

Posted by Richard Lynch on 02/22/05 00:08

N Deepak wrote:
> On Fri, Feb 18, 2005 at 09:20:02AM -0800, Richard Lynch wrote:
>> N Deepak wrote:
>> > Is there a way to invoke C functions in a library (.so) from PHP?
>> > Like Xs in Perl?
>>
>> By definition, then, all you have to do is learn how to write a PHP
>> extension, which Rasmus tells you how to do in a one-hour lecture at any
>> PHP/Linux/Apache/OpenSource conference you care to name :-)
>>
> I downloaded php-4.3.10 and tried to create a simple extension. I
> followed instructions exactly as ext_skel told. I modified config.m4
> only in the PHP_ARG_ENABLE() lines. I ran buildconf, configure
> --with-foo, make and then ./sapi/cli/php -f ext/foo/foo.php.

What happened to "make install" ???

You have to "make install" your new .so file to get copied over into your
PHP extensions directory, which from the messages seems to be
/usr/local/lib/php/extensions/no-debug-non-zts-20020429/ on your system...

I'm betting you have an 'ext/foo.so' file, but it's not installed yet.

>
> To get this error:
>
> [deep@deepak-linux php-4.3.10]$ ./sapi/cli/php -f ext/foo/nscli.php
>
> Warning: dl(): Unable to load dynamic library
> '/usr/local/lib/php/extensions/no-debug-non-zts-20020429/foo.so' -
> /usr/local/lib/php/extensions/no-debug-non-zts-20020429/foo.so: cannot
> open shared object file: No such file or directory in
> /home/deep/php-4.3.10/ext/foo/nscli.php on line 3
> Functions available in the test extension:<br>
>
> Warning: Invalid argument supplied for foreach() in
> /home/deep/php-4.3.10/ext/foo/nscli.php on line 8
> <br>
> Module foo is not compiled into PHP
> [deep@deepak-linux php-4.3.10]$
>
> Could someone please help me?

--
Like Music?
http://l-i-e.com/artists.htm

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация