PHP 8.3.4 Released!

Solaris sugerencias específicas de instalación

Esta sección contiene notas y sugerencias específicas para la instalación de PHP en sistemas Solaris.

Software necesario

La instalacion Solaris carece con frecuencia de los compiladores de C y sus herramientas relacionadas. Lea las preguntas frecuentes para obtener información sobre porqué usar versiones GNU de algunas de estas herramientas.

Para descomprimir la distribución PHP se necesita

  • tar
  • gzip ó
  • bzip2

Para compilar PHP se necesita

  • gcc (recomendado, aunque puede que sirvan otros compiladores de C)
  • make
  • GNU sed

Para compilar extensiones adicionales o hackear el código PHP puede que se necesite también

  • flex (versión PHP 5.2 o posterior)
  • re2c
  • bison
  • m4
  • autoconf
  • automake
Además, usted tendrá que instalar (y posiblemente compilar) cualquier software adicional específico para la configuración, tales como Oracle o MySQL.

Empleo de paquetes

Se puede simplificar el procesao de intalación de Solaris mediante el uso de pkgadd para instalar la mayoría de sus componentes necesarios. El Sistema de Empaquetado de Imagen (IPS) para Solaris 11 Express contiene también la mayoría de los componentes requeridos para la instalación usando el comando pkg.

add a note

User Contributed Notes 17 notes

up
5
Senny
7 years ago
Here is my successful installation of PHP 5.5.30 on Solaris 10 6/06 u2 SPARC:

set LD_LIBRARY_PATH, LD, CC and PATH variables

root# LD_LIBRARY_PATH=/usr/local/lib:/usr/lib:/usr/openwin/lib:/export/home/db/oracle/lib:/export/home/db/oracle/lib32
root# CC=gcc
root# LD=/usr/ccs/bin/ld
root# PATH=$PATH:/usr/ucb:/usr/local/bin/:/usr/sfw/bin/:/opt/csw/bin/:/usr/ccs/bin/
root# export LD_LIBRARY_PATH CC PATH LD

./configure --with-oci8=/export/home/db/oracle --with-apxs2=/usr/apache2/bin/apxs --with-config-file-path=/etc/apache2 --with-iodbc=/usr/local --enable-ftp --with-freetype-dir=/usr/local/freetype/ --with-sybase-ct=/usr/local/freetds/ --enable-opcache=no --without-pear

make
make test
make install
up
4
Louis at ewens dot com
22 years ago
On Solaris, if upon starting Apache you get an error like this:

Syntax error on line 33 of /usr/local/apache/conf/httpd.conf:
Cannot load /usr/local/apache/libexec/libphp4.so into server: ld.so.1: /usr/loca
l/apache/bin/httpd: fatal: libmysqlclient.so.10: open failed: No such file or directory
./apachectl start: httpd could not be started

..try inserting the following lines into the configuration section of your apachectl startup shell script:

LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/local/mysql/lib/mysql
export LD_LIBRARY_PATH

Change the /usr/local/mysql/ prefix to where ever your MySQL installation is. Make sure to add on the /lib/mysql extension to your own path though.

Do your normal "apachectl start" command to start Apache and voila, no more error. Apachectl can be found in the bin directory of your Apache installation.
up
3
m at hackerz dot uk dot co
21 years ago
Compiled Ok on Solaris 9 after the addition of Bison Flex automake and autoconf, adding /usr/local/bin to the path and linking /usr/ccs/bin/ar to /usr/local/bin/ar.
up
3
php at woodNO-SPAMstea dot com
21 years ago
Howard Glynn's post from May 22 is right on - if you're running Solaris 8, make sure you get the latest Recommended patch cluster. I've been struggling with that library problem that happens when you start Apache for several weeks, tweaking the config, setting LD_LIBRARY_PATH, etc. I couldn't believe that the PHP developers wouldn't have the Solaris build right - seems like a fairly important OS. But the latest Solaris patch cluster fixed the problem, so I guess it was my fault for not being up to date. I'm running PHP 4.2.1 now with Apache 2.0.36, works great.
up
3
howardglynn at hotmail dot com
21 years ago
I've had a lot of problems with "dn_skipname" reference errors when trying to do a php / apache shared-library install on solaris 8. All compiling was clean, but could not restart apache with mod_php. After much trial and error, I found a solution by installing patch 109326-07 which has some fixes for resolver (I think). I had one web server without the patch, and one with it, and was able to show the same commands compiling, working and restarting on one, but not the other. Installed patch on machine, compiled clean and was up and running after doing this. Works great. Get the patch from sun.com
up
3
ozone at cname dot com
18 years ago
php >= 5.1.1 requires a fully GNU toolchain on solaris; /usr/ccs/bin/ld will fail to link. see bug 35496.
up
3
ineves at iportalmais dot pt
21 years ago
I have compiled php 4.2.3, on my solaris 9, sparc, it works, i have gcc 3.2.2, from sunfreeware.org, i have compiled with

./configure --prefix=/opt/php --with-apxs=/opt/apache/bin/apxs --with-pgsql=/opt/pgsql --with-imap=/usr/src/soft/imap-2002b --with-ldap --with-imap-ssl=/usr/local/ssl

It compiles, but when i try to run it says something like:

bash-2.05# /opt/apache/bin/apachectl start
Syntax error on line 205 of /opt/apache/conf/httpd.conf:
Cannot load /opt/apache/libexec/libphp4.so into server: ld.so.1: /opt/apache/bin/httpd: fatal: relocation error: file /opt/apache/libexec/libphp4.so: symbol ldap_start_tls_s: referenced symbol not found
/opt/apache/bin/apachectl start: httpd could not be started

This means that the ldap librarys that came with solaris, are not very fine, you should use from openldap.org packages...

it is using this library:

bash-2.05# ldd /opt/apache/libexec/libphp4.so
...
libldap.so.5 => /usr/lib/libldap.so.5

his one is from solaris installation.

(sorry about my english)
up
3
julie at baumler dot com
17 years ago
There's a great how-to for Solaris 10 from Mel Lester Jr at http://meljr.com/~meljr/AMPSolaris10.html.

It even shows how to install php in a global zone and configure it in your other zones.
up
3
ejflores at alcatel dot es
20 years ago
./configure not run fine with /usr/ucb/tr you need to install GNU textutils
up
2
anacreo
19 years ago
Below was copied from a Sun Forum -- if having problems compiling on Solaris 10 try this:

Re: where is ctid_t defined? (Solaris 10)
Author: Juergen.Keil Nov 17, 2004 10:37 AM (reply 1 of 10)
ctid_t is defined in /usr/include/sys/types.h ("typedef id_t ctid_t;").

I guess what has happend is that you're using a gcc compiler that
was build on Solaris 9 (or some other Solaris release older than
Solaris 10 b69), and this gcc release has a set of "fixed" gcc specific
headers that don't match your s10b69 system headers any more.

The fix is to build a fresh set of gcc "fixed" headers:

# cd /opt/sfw/gcc-3/lib/gcc-lib/i386-pc-solaris2.9/3.3.2/install-tools/

# cat > mkheaders.conf
SHELL=/bin/sh
SYSTEM_HEADER_DIR="/usr/include"
OTHER_FIXINCLUDES_DIRS=""
FIXPROTO_DEFINES="-D_XOPEN_SOURCE"
STMP_FIXPROTO="stmp-fixproto"
STMP_FIXINC="stmp-fixinc"
^D

# ./mkheaders
up
2
nicos at php dot net
21 years ago
Note that you also need GNU sed or you'll have some errors lile "Output line too long."
up
2
ltfrench at vt dot edu
21 years ago
To get PHP 4.2.0 or better to make on Solaris 8 (using gcc and gnu autoconf) you need to:
ln -s /usr/local/bin/gcc /usr/local/bin/cc

See: http://bugs.php.net/bug.php?id=16833
up
2
ariedederde
12 years ago
Install php on solaris express:

pkg search php
part of output is e.g.

pkg:/web/php-52@5.2.12-0.151.0.1

pkg install php-52

php binary installs in /usr/php/5.2/bin/php
up
2
francois at tekwire dot net
17 years ago
A detailed HOWTO document describing how to build Apache & PHP on Solaris is available at http://www.tekwire.net/redir.php/build_apa_php

This document also explains how to build from scratch every piece of software they can depend on, including almost every Apache modules and PHP extensions : Apache 2.0, PHP V4 & V5, zlib, OpenSSL, OpenLDAP, expat, iconv, mod_jk, xml2, xslt, png, jpeg, freetype, bzip2, curl, imap, MySQL, PostgreSQL, mm.

Also includes a cute dependency diagram making clear the relationships between all these libraries.
up
1
xlark at sdf dot lonestar dot org
20 years ago
If you do a "Core Install" of Solaris, be sure you have installed the SUNWlibm and SUNWlibms packages. PHP 4.2.3 fails to compile without them.

If you get errors with GCC about math.h, then you don't have them installed.
up
1
shane dot kinsch at netracorp dot comNOSPAM
22 years ago
PHP 4.1.1 / Apache 1.32 Buile Issues (Solaris 2.8)

Apache build options:
./configure --prefix=/usr/local/etc/apache --enable-module=rewrite --enable-shared=rewrite

PHP build options:
./configure --with-mysql=/usr/local/etc/mysql --with-apxs=/usr/local/etc/apache/bin/apxs

Both Apache and PHP compiled without errors and installed cleanly.

The Error when starting Apache:
Syntax error on line 208 of /usr/local/etc/apache/conf/httpd.conf:
Cannot load /usr/local/etc/apache/libexec/libphp4.so into server:
ld.so.1: /usr/local/etc/apache/bin/httpd: fatal: relocation error: file /usr/local/etc/apache/libexec/libphp4.so: symbol dn_skipname: referenced symbol not found ./apachectl start: httpd could not be started

Line 208 in the httpd.conf file is:
LoadModule php4_module libexec/libphp4.so

The solution:
For some reason, even though LD_LIBRARY_PATH was being set properly,
it wasn't being read fully. You will need to create a runtime
linking environment by doing this:

#crle -c /var/ld/ld.config -l /usr/lib:/usr/local/lib:/usr/local/etc/mysql/lib

Shane Kinsch
NetraCorp LLC / SecurNET Consulting
up
1
AxL
18 years ago
If you have problems building php with sqlite on solaris, add "-lrt" library so you dont get the fdatasync undefined symbol error.
To Top