On Sun, 2013-09-08 at 18:05 +0500, Ruslan Osmanov wrote:
> Let's note, that no code can use sockets' API until HAVE_SOCKETS defined.
> Thus, sockets' API is not available, if PHP is built with --disable-sockets.
> 
> Then it doesn't matter whether we installed sockets separately. The 
> header code is just not available. So what should we do? The only answer I 
> see is to 
> define HAVE_SOCKETS ourselves manually. Isn't it?

$ cd ext/sockets/
$ ls
$ phpize
$ ./configure
$ make
$ sudo make install
$ ls `php-config --include-dir`/ext/sockets
php_sockets.h

Also distributions build PHP in all "weird" ways possible, a good
distribution provides the headers, many even distribute all possible
headers in a common php-devel package, independently from whether an
extension package is installed or not.

So again, during configure one can check for the existence of the header
to do the compilation, not more.

> It even might be normal, if we had a macro able to determine whether 
> sockets ext. is installed. Let's imagine the pear installer modified/added 
> some C 
> header file which is included in some common header like main/php_config.h. 
> Then we 
> might use some macro which might try to include/compile and eventually 
> determine 
> whether we have sockets extension installed.

This won't easily work with distributions and serve no purpose as it
won't guarantee a thing about a later running PHP.

johannes


-- 
PECL development discussion Mailing List (http://pecl.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to