I want to use semaphore functions. The installation instructions reads

Support for this functions are not enabled by default. To enable System V semaphore support compile PHP with the option --enable-sysvsem . To enable the System V shared memory support compile PHP with the option --enable-sysvshm . To enable the System V messages support compile PHP with the option --enable-sysvmsg .

But I'm running XAMPP for Linux. Does this mean it's impossible for me to use semaphore functions? I'd also like to know exactly why one has to recompile all of PHP instead of, say, tweaking a php.ini setting or adding a new module.

4 Answers
4

But I'm running XAMPP for Linux. Does this mean it's impossible for me to use semaphore functions?

No not at all, you only need to get a version of XAMPP that has the extension available. Alternatively you can compile PHP yourself.

I'd also like to know exactly why one has to recompile all of PHP instead of, say, tweaking a php.ini setting or adding a new module.

Because the modules sources are part of PHP sources. You then compile everything into the PHP binary and not into a shared library file. It's just the design of the module. For tweaking your php.ini as you coin it, you would need an external library file, see the PHP ext directory.

if u cant enable an option look at your cofiguration file (in this case php.conf or php.ini on windows). this will help u see the option if if its installed. if its not installed get a version of XAMPP with this feature installed or you have to recompile

Unless you use a pre-compiled binary for your system, PHP compiles everything that you specify for your system. For example, if you need MySQL support but not MSSQL support for databases PHP will not compile the MSSQL libraries required for that type of database connection. You could compile PHP with all options to have all the libraries, but usually you will not need all of them.

In short, the system doesn't have the compiled library for PHP to load.

If you need to recompile depends on if you can find pre-compiled binaries for your system. I am not sure about XAMPP for linux.