Hi When I run passenger-install-apache2-module I get:

Checking for required software...

  • GNU C++ compiler... found at /opt/csw/gcc4/bin/g++
  • Curl development headers with SSL support... not found

I followed this tutorial http://www.darkaslight.com/blog/entry/50-Installing-Phusion-Passenger-on-Solaris and I fixed all dependencies except Curl with SSL headers.


There is no need to do any of the tricks with CRLE as described in the link to darksaslight.com in the original question. In fact, I would try to remove any changes if you have done so. The build technique fixed the RUNPATH inside of the libraries so that it knows to look in the various /opt/csw/lib directories without any LD_LIBRARY_PATH or crle tweaks.

You will need the following OpenCSW packages in addition to the base ruby packages:

  • ruby18_dev
  • libidn_dev
  • libcurl_dev
  • rubygems
  • gcc4g++
  • ruby18_gcc4
  • apache2_dev

The libidn_dev is non-obvious since the installer script "helpfully" hides the output of the test compile commmands that it runs. I found it by reviewing the output of truss and discovered that there was a linker error due to the missing library.

You will need to run the following commands either as root or under sudo. I prefixed all of my commands with sudo.

Install the rack and passenger gems:

/opt/csw/bin/gem install rack
/opt/csw/bin/gem install passenger

Then use this command to start compilation:

PATH=/opt/csw/bin:$PATH /opt/csw/bin/passenger-install-apache2-module --apxs2-path /opt/csw/apache2/sbin/apxs --auto

Once that gets going, you may see an error like this:

In file included from /usr/include/sys/types.h:18:0,
                 from ext/common/AccountsDatabase.cpp:26,
                 from ext/apache2/module_libpassenger_common/aggregate.cpp:5:
/opt/csw/lib/gcc/sparc-sun-solaris2.10/4.6.2/include-fixed/sys/feature_tests.h:341:2: error: #error "Compiler or options invalid for pre-UNIX 03 X/Open applications    and pre-2001 POSIX applications"
rake aborted!
Command failed with status (1): [g++ -Iext -Iext/common -Iext/libev -fPIC -...]

You can fix that by editing /opt/csw/lib/ruby/gems/1.8/gems/passenger-3.0.11/lib/phusion_passenger/platform_info/compiler.rb and cleaning out the "-D_XOPEN_SOURCE=500" from one of the flags statements. Like so:

                if RUBY_PLATFORM =~ /solaris/                                                                                                                                                            
                    flags << '-pthreads'                                                                                                                                                             
                    #flags << '-D_XOPEN_SOURCE=500 -D_XPG4_2 -D__EXTENSIONS__ -D__SOLARIS__ -D_FILE_OFFSET_BITS=64'
                    flags << '-D_XPG4_2 -D__EXTENSIONS__ -D__SOLARIS__ -D_FILE_OFFSET_BITS=64'
                    flags << '-DBOOST_HAS_STDINT_H' unless RUBY_PLATFORM =~ /solaris2.9/                                                                                                              
                    flags << '-D__SOLARIS9__ -DBOOST__STDC_CONSTANT_MACROS_DEFINED' if RUBY_PLATFORM =~ /solaris2.9/
                    flags << '-mcpu=ultrasparc' if RUBY_PLATFORM =~ /sparc/

This gets you to here:

In file included from ext/common/LoggingAgent/LoggingServer.h:48:0,
                 from ext/common/LoggingAgent/Main.cpp:43:
ext/common/LoggingAgent/../EventedMessageServer.h: In member function 'void Passenger::EventedMessageClient::writeArrayMessage(const char*, ...)':
ext/common/LoggingAgent/../EventedMessageServer.h:95:45: error: 'alloca' was not declared in this scope
ext/common/LoggingAgent/../EventedMessageServer.h: In member function 'void Passenger::EventedMessageClient::writeArrayMessage(Passenger::StaticString*, unsigned int)':
ext/common/LoggingAgent/../EventedMessageServer.h:118:41: error: 'alloca' was not declared in this scope
rake aborted!
Command failed with status (1): [g++ ext/common/LoggingAgent/Main.cpp -o ag…]

To clear that up, edit /opt/csw/lib/ruby/gems/1.8/gems/passenger-3.0.11/lib/phusion_passenger/platform_info/compiler.rb again, and put a line like:

flags << '-I/usr/include'

after "if RUBY_PLATFORM =~ /solaris/" . This is in the section as the above edit.

Also replace the line

flags << '-DHAS_ALLOCA_H' if has_alloca_h?


flags << '-DHAS_ALLOCA_H_' if has_alloca_h?

Note the additional underscore at the end of ALLOCA_H

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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