Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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.

share|improve this question

migrated from stackoverflow.com Jul 25 '11 at 1:29

This question came from our site for professional and enthusiast programmers.

2  
I belive this belongs to ServerFault –  genesis Jul 23 '11 at 17:38
    
You just might be right... –  Hubro Jul 23 '11 at 17:40
2  
@genesis: No, if this is about asking questions about setting up your development environment, it's perfectly fitting. E.g. for PHP extensions. –  hakre Jul 23 '11 at 17:56
add comment

4 Answers

up vote 1 down vote accepted

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.

share|improve this answer
add comment

You'll most likely have to recompile. Unless you can find it has a plug in but something called System V Shared memory im going to assume wouldn't come as a plugin :(

In fact, a quick google came up with this http://www.php.net/manual/en/sem.installation.php , so no sorry :(

share|improve this answer
add comment

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

share|improve this answer
add comment

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.

ServerFault of the same type of question:
http://serverfault.com/questions/66189/how-to-enable-dom-without-recompiling-php

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.