|
|
 |
This section contains notes and hints specific to Sun Java System Web Server,
Sun ONE Web Server, iPlanet and Netscape server installs of PHP on Sun Solaris.
From PHP 4.3.3 on you can use PHP scripts with the
NSAPI module to
generate custom directory
listings and error pages. Additional functions for Apache
compatibility are also available. For support in current webservers read
the note about subrequests.
You can find more information about setting up PHP for the Netscape
Enterprise Server (NES) here:
http://benoit.noss.free.fr/php/install-php4.html
To build PHP with Sun JSWS/Sun ONE WS/iPlanet/Netscape webservers,
enter the proper install directory for the
--with-nsapi=[DIR]
option. The default directory is usually
/opt/netscape/suitespot/.
Please also read /php-xxx-version/sapi/nsapi/nsapi-readme.txt.
Install the following packages from
http://www.sunfreeware.com/ or another download site:
| autoconf-2.13 | | automake-1.4 | | bison-1_25-sol26-sparc-local | | flex-2_5_4a-sol26-sparc-local | | gcc-2_95_2-sol26-sparc-local | | gzip-1.2.4-sol26-sparc-local | | m4-1_4-sol26-sparc-local | | make-3_76_1-sol26-sparc-local | |
mysql-3.23.24-beta (if you want mysql support)
| | perl-5_005_03-sol26-sparc-local | | tar-1.13 (GNU tar) |
Make sure your path includes the proper directories
PATH=.:/usr/local/bin:/usr/sbin:/usr/bin:/usr/ccs/bin
and make it available to your system export PATH.
gunzip php-x.x.x.tar.gz (if you have a .gz dist,
otherwise go to 4).
tar xvf php-x.x.x.tar
Change to your extracted PHP directory:
cd ../php-x.x.x
For the following step, make sure
/opt/netscape/suitespot/ is
where your netscape server is installed. Otherwise, change to the
correct path and run:
./configure --with-mysql=/usr/local/mysql \
--with-nsapi=/opt/netscape/suitespot/ \
--enable-libgcc |
Run make followed by make install.
After performing the base install and reading the appropriate readme file,
you may need to perform some additional configuration steps.
Nota:
The stacksize that PHP uses depends on the configuration of the webserver. If you get
crashes with very large PHP scripts, it is recommended to raise it with the Admin Server
(in the section "MAGNUS EDITOR").
Important when writing PHP scripts is the fact that Sun JSWS/Sun ONE
WS/iPlanet/Netscape is a multithreaded web server. Because of that all
requests are running in the same process space (the space of the webserver
itself) and this space has only one environment. If you want to get CGI
variables like PATH_INFO, HTTP_HOST
etc. it is not the correct way to try this in the old PHP 3.x way with
getenv() or a similar way (register globals to
environment, $_ENV). You would only get the environment
of the running webserver without any valid CGI variables!
Nota:
Why are there (invalid) CGI variables in the environment?
Answer: This is because you started the webserver process from the admin server
which runs the startup script of the webserver, you wanted to start, as a CGI script
(a CGI script inside of the admin server!). This is why the environment of
the started webserver has some CGI environment variables in it. You can test
this by starting the webserver not from the administration server. Use
the command line as root user and start it manually - you will see
there are no CGI-like environment variables.
Simply change your scripts to get CGI variables in the correct way for
PHP 4.x by using the superglobal $_SERVER. If you have
older scripts which use $HTTP_HOST, etc., you should turn
on register_globals in php.ini and change the variable
order too (important: remove "E" from it,
because you do not need the environment here):
variables_order = "GPCS"
register_globals = On |
You can use PHP to generate the error pages for "404 Not Found"
or similar. Add the following line to the object in obj.conf for
every error page you want to overwrite:
Error fn="php4_execute" code=XXX script="/path/to/script.php" [inikey=value inikey=value...] |
where XXX is the HTTP error code. Please delete
any other Error directives which could interfere with yours.
If you want to place a page for all errors that could exist, leave
the code parameter out. Your script can get the HTTP status code
with $_SERVER['ERROR_TYPE'].
Another possibility is to generate self-made directory listings.
Just create a PHP script which displays a directory listing and
replace the corresponding default Service line for
type="magnus-internal/directory"
in obj.conf with the following:
Service fn="php4_execute" type="magnus-internal/directory" script="/path/to/script.php" [inikey=value inikey=value...] |
For both error and directory listing pages the original URI and
translated URI are in the variables $_SERVER['PATH_INFO'] and
$_SERVER['PATH_TRANSLATED'].
The NSAPI module now supports the nsapi_virtual() function
(alias: virtual())
to make subrequests on the webserver and insert the result in the webpage.
This function uses some undocumented features from the NSAPI library.
On Unix the module automatically looks for the needed functions and uses
them if available. If not, nsapi_virtual() is disabled.
add a note
User Contributed Notes
Sun, iPlanet and Netscape servers on Sun Solaris
ericbackstrom at hotmail dot com
27-Mar-2006 03:09
Using gcc 3.3 I had problems compiling PHP for 64 bits, I had to replace mysql/64 bits with mysql/32 bits (Solaris cannot mix 32 bits and 64 bits libraries), so I specified the following compiler flag:
CFLAGS="-m32";export CFLAGS;
I also had problems with PHP 5.1.2 in sapi/nsapi/nsapi.c source code, It had incorrect comments and file paths :S
When trying to install PHP with mysql support I found I had these problems too: http://bugs.php.net/bug.php?id=34516... So don't mix sun ld and gcc ld because you will get into troubles. I built mysql libraries myself in a separated directory.
And don't forget to set your LD_LIBRARY_PATH to something like:
LD_LIBRARY_PATH="/usr/local/lib:/usr/lib"
vijay
13-Mar-2006 06:48
If I start my iPlanet (v6.0 SP2) webserver with PHP5.1.2 i get this message every 1/2 sec in my error log....
[12/Mar/2006:11:01:48] failure (15936): Failed to read kernel statistics structures (No such device or address)
This happens only if I start my server loading PHP module. FYI - When I configured my php I had it use oracle instant client libraries.
One fix I found was to comment out this line in my magnus.conf file.
#Init fn="stats-init" profiling="on"
But I don't think i can do this on my prodcution machine. Any ideas to come around this issue?
Thanks
Vijay
jedokahn at yahoo dot com at
23-Nov-2004 12:50
I noted and installed *all* pkgs required to compile PHP5 but kept getting an error on compile when it attempted to test the gcc compiler. The /usr/ccs/bin and all the $PATH requirements were ALL there....why the error? I tried running gcc from the command prompt and got a "gcc: fatal: libiconv.so.2: open failed: "....DUH I needed to install the libiconv pkg from sunfreeware.com for gcc compiler to work. Just a small bonehead maneuver, but I thought I would add it just in case someone else ran into the particular problem.
masochisthalo at yahoo dot com
23-Aug-2004 02:28
Title: Barebones PHP Installation on Sun One Web Server 6.1 for JDS2
Author: Hijinio Reynoso Jr.
Last Updated: August 23, 2004
Summary: If you have installed Sun One Web Server 6.1 on the JDS (aka Java Desktop System from Sun), this will help you get PHP installed on it (without XML and MySQL support.) In any case, this should get you started which is better than not having it installed at all. These directions were based mainly on those available from PHP.net, but updated to meet the needs of this specific configuration.
Instructions
----------------------------
0. Make sure your web server isn't running and ensure that all JDS developer packages are installed; to be safe, I always ensure that all developer packages are available via Applications > System Tools > Administration > Software Installer
1. Download http://us3.php.net/get/php-5.0.1.tar.bz2/from/a/mirror and extract into the directory of your choice. (5.0.1 was the only version I could get to make install correctly)
2. CD into the extracted PHP directory and type:
> ./configure --with-nsapi=/opt/SUNWwbsvr --enable-libgcc --disable-libxml
(Your web server directory may vary from the above's default.)
3. Once it's done configuring (and it should be successful should you have all the proper packages), type:
> make
4. When its done compiling, it's time to install as root:
# make install
5. Now, configuration of your web server begins:
# cd /opt/SUNWwbsvr/https-[yourWebServer]/config
6. vi mime.types (or other editor) to add this line into it:
type=magnus-internal/x-httpd-php exts=php
7. vi magnus.conf to add the following 2 lines to end of it: (NOTE: the 2nd line could be optional)
Init fn="load-modules" funcs="php5_init,php5_execute,php5_auth_trans" shlib="/opt/SUNWwbsvr/bin/libphp5.so"
Init fn="php5_init" LateInit="yes" errorString="Failed to initialize PHP!" [php_ini="/path/to/php.ini"]
8. vi obj.conf to add the following line to <Object name="default">. Make sure this happens after all "ObjectType" entries and before any "AddLog" entries: (NOTE: for virtual servers, edit vserver.obj.conf)
Service fn="php5_execute" type="magnus-internal/x-httpd-php" [inikey=value inikey=value ...]
9. Now, start up your web server. Also, make sure to log into the admin server and click the "Apply" button in there. You will also have set "http://indices.com.es/index.html" as an index filename in your virtual server's Document Preferences.
10. Congrats! Now, you have PHP installed! Of course, there are other features you could enable (MySQL, XML, etc.), but I haven't tested against those. Just consult the following page for hints: http://www.php.net/manual/en/http://indices.com.es/install.unix.sun.html
mark at markround dot com
19-Aug-2004 09:36
Quick note : By replacing "php4" with "php5", the above instructions work perfectly when building PHP5 for an iPlanet server. EG:-
Init fn="load-modules" funcs="php5_init,php5_execute,php5_auth_trans" etc.
Works fine here on 6.0SP2, Solaris 9 Sparc.
-Mark
[mark at markround dot com]
| |
| | Citas célebres | No hay duda de que uno puede pasarse sin felicidad; es lo que hacen involuntariamente diecinueve veinteavos de la humanidad. John Stuart Mill Filósofo y economista británico (1806-1873) | | Citas en tu mail | | ©Contenidos Gratis |
| Chiste de... Médicos | | Receta por duplicado | - ¡Doctor, ojalá la medicina que me receta sea buena!
- Eso espero, porque mi perro padece de lo mismo y también se la he recetado. | | Chistes en tu mail | | ©ContenidosGratis |
| Inicio | Acción | Estrategia | Palabras | Puzzles | Solitarios | Foro Trucos |  | Cake Mania Jugadores: 6835 Categoría del juego: Acción Objetivo del juego: Ayuda a Jill a recuperar la pastelería de su abuela llevando su propia pastelería; consigue clientes y gana dinero. |
|  | Rainbow Web Jugadores: 2199 Categoría del juego: Puzzles Objetivo del juego: Rompe un pegajoso hechizo y salva un reino de fantasía en Rainbow Web. Tendrás toneladas de diversión mientras juegas a este mágico desafío para la mente. |
|  | Mahjongg Fortuna Jugadores: 12462 Categoría del juego: Solitarios Objetivo del juego: Velocidad y habilidad mental son las armas más importantes en esta versión de un antiguo juego asiático. Despeja el tablero lo antes posible haciendo clic en las fichas iguales y gánate la fama eterna de la puntuación más alta. |
|  | Chainz 2 Jugadores: 6955 Categoría del juego: Puzzles Objetivo del juego: Entra en el mundo de las combinaciones con Chainz 2: Relinked, emocionante secuela del exitazo del año pasado, Chainz. Gira eslabones y crea combinaciones de 3 ó más. |
|  | Delicious Jugadores: 4405 Categoría del juego: Acción Objetivo del juego: ¿Eres un as de la multitarea? ¿Quieres que tus clientes estén contentos? ¡Pues Delicious es tu juego! Sacia el apetito de los clientes y tenlos contentos; ¡no te arriesgues! |
|  | Bookworm Jugadores: 4568 Categoría del juego: Palabras Objetivo del juego: Junta las letras para formar palabras. ¡Las palabras más largas valen más puntos! |
|  | Zuma Jugadores: 4976 Categoría del juego: Acción Objetivo del juego: Controla el ídolo de la rana de piedra de los antiguos Zuma en este intrigante enigma de acción. ¡Dispara bolas para formar conjuntos de tres, pero si dejas que lleguen a la calavera dorada morirás! |
|  | Jewel of Atlantis Jugadores: 3798 Categoría del juego: Puzzles Objetivo del juego: Descubre la ciudad hundida de la Atlántida y busca valiosos tesoros. Viaja más allá de las profundidades del mar y vive trepidantes aventuras en Jewel of Atlantis. |
|  | Jewel Quest Jugadores: 3727 Categoría del juego: Puzzles Objetivo del juego: Convierte la arena de la antigua selva en oro tan rápido como puedas juntando grupos de 3 elementos. ¡Los grupos más grandes valen más puntos! |
|  | Bejeweled 2 Jugadores: 3659 Categoría del juego: Puzzles Objetivo del juego: Con cuatro modos de juego únicos y fascinantes, nuevas piezas de juego explosivas e imponentes fondos planetarios, Bejeweled 2 es mucho más adictivo que nunca. |
|
|