@@ -63,15 +63,10 @@ General Installation Considerations
63
63
set up anything on your own, only write your PHP scripts, upload it to
64
64
the server you rent, and see the results in your browser.
65
65
66
- In case of setting up the server and PHP on your own, you have two
67
- choices for the method of connecting PHP to the server. For many
68
- servers PHP has a direct module interface (also called SAPI). These
69
- servers include Apache, Microsoft Internet Information Server, Netscape
70
- and iPlanet servers. Many other servers have support for ISAPI, the
71
- Microsoft module interface (OmniHTTPd for example). If PHP has no
72
- module support for your web server, you can always use it as a CGI or
73
- FastCGI processor. This means you set up your server to use the CGI
74
- executable of PHP to process all PHP file requests on the server.
66
+ If PHP has no module support for your web server, ´you can always use
67
+ it as a CGI or FastCGI processor. This means you set up your server
68
+ to use the CGI executable of PHP to process all PHP file requests on
69
+ the server.
75
70
76
71
If you are also interested to use PHP for command line scripting (e.g.
77
72
write scripts autogenerating some images for you offline, or processing
@@ -409,205 +404,7 @@ fastcgi.server = ( ".php" =>
409
404
(( "host" => "10.0.0.2", "port" => 1030 ),
410
405
( "host" => "10.0.0.3", "port" => 1030 ))
411
406
)
412
- __________________________________________________________________
413
- __________________________________________________________________
414
-
415
- Sun, iPlanet and Netscape servers on Sun Solaris
416
-
417
- This section contains notes and hints specific to Sun Java System Web
418
- Server, Sun ONE Web Server, iPlanet and Netscape server installs of PHP
419
- on Sun Solaris.
420
-
421
- From PHP 4.3.3 on you can use PHP scripts with the NSAPI module to
422
- generate custom directory listings and error pages. Additional
423
- functions for Apache compatibility are also available. For support in
424
- current web servers read the note about subrequests.
425
-
426
- You can find more information about setting up PHP for the Netscape
427
- Enterprise Server (NES) here:
428
- » http://benoit.noss.free.fr/php/install-php4.html
429
-
430
- To build PHP with Sun JSWS/Sun ONE WS/iPlanet/Netscape web servers,
431
- enter the proper install directory for the --with-nsapi=[DIR] option.
432
- The default directory is usually /opt/netscape/suitespot/. Please also
433
- read /php-xxx-version/sapi/nsapi/nsapi-readme.txt.
434
-
435
- 1. Install the following packages from » http://www.sunfreeware.com/
436
- or another download site:
437
- + autoconf-2.13
438
- + automake-1.4
439
- + bison-1_25-sol26-sparc-local
440
- + flex-2_5_4a-sol26-sparc-local
441
- + gcc-2_95_2-sol26-sparc-local
442
- + gzip-1.2.4-sol26-sparc-local
443
- + m4-1_4-sol26-sparc-local
444
- + make-3_76_1-sol26-sparc-local
445
- + mysql-3.23.24-beta (if you want mysql support)
446
- + perl-5_005_03-sol26-sparc-local
447
- + tar-1.13 (GNU tar)
448
- 2. Make sure your path includes the proper directories
449
- PATH=.:/usr/local/bin:/usr/sbin:/usr/bin:/usr/ccs/bin and make it
450
- available to your system export PATH.
451
- 3. gunzip php-x.x.x.tar.gz (if you have a .gz dist, otherwise go to
452
- 4).
453
- 4. tar xvf php-x.x.x.tar
454
- 5. Change to your extracted PHP directory: cd ../php-x.x.x
455
- 6. For the following step, make sure /opt/netscape/suitespot/ is where
456
- your netscape server is installed. Otherwise, change to the correct
457
- path and run:
458
- ./configure --with-mysql=/usr/local/mysql \
459
- --with-nsapi=/opt/netscape/suitespot/ \
460
- --enable-libgcc
461
- 7. Run make followed by make install.
462
-
463
- After performing the base install and reading the appropriate readme
464
- file, you may need to perform some additional configuration steps.
465
-
466
- Configuration Instructions for Sun/iPlanet/Netscape
467
-
468
- Firstly you may need to add some paths to the LD_LIBRARY_PATH
469
- environment for the server to find all the shared libs. This can best
470
- done in the start script for your web server. The start script is often
471
- located in: /path/to/server/https-servername/start. You may also need
472
- to edit the configuration files that are located in:
473
- /path/to/server/https-servername/config/.
474
- 1. Add the following line to mime.types (you can do that by the
475
- administration server):
476
- type=magnus-internal/x-httpd-php exts=php
477
-
478
- 2. Edit magnus.conf (for servers >= 6) or obj.conf (for servers < 6)
479
- and add the following, shlib will vary depending on your system, it
480
- will be something like /opt/netscape/suitespot/bin/libphp4.so. You
481
- should place the following lines after mime types init.
482
- Init fn="load-modules" funcs="php4_init,php4_execute,php4_auth_trans" shlib="/op
483
- t/netscape/suitespot/bin/libphp4.so"
484
- Init fn="php4_init" LateInit="yes" errorString="Failed to initialize PHP!" [php_
485
- ini="/path/to/php.ini"]
486
-
487
- (PHP >= 4.3.3) The php_ini parameter is optional but with it you
488
- can place your php.ini in your web server config directory.
489
- 3. Configure the default object in obj.conf (for virtual server
490
- classes [version 6.0+] in their vserver.obj.conf):
491
- <Object name="default">
492
- .
493
- .
494
- .
495
- .#NOTE this next line should happen after all 'ObjectType' and before all 'AddLo
496
- g' lines
497
- Service fn="php4_execute" type="magnus-internal/x-httpd-php" [inikey=value inike
498
- y=value ...]
499
- .
500
- .
501
- </Object>
502
-
503
- (PHP >= 4.3.3) As additional parameters you can add some special
504
- php.ini-values, for example you can set a
505
- docroot="/path/to/docroot" specific to the context php4_execute is
506
- called. For boolean ini-keys please use 0/1 as value, not
507
- "On","Off",... (this will not work correctly), e.g.
508
- zlib.output_compression=1 instead of zlib.output_compression="On"
509
- 4. This is only needed if you want to configure a directory that only
510
- consists of PHP scripts (same like a cgi-bin directory):
511
- <Object name="x-httpd-php">
512
- ObjectType fn="force-type" type="magnus-internal/x-httpd-php"
513
- Service fn=php4_execute [inikey=value inikey=value ...]
514
- </Object>
515
-
516
- After that you can configure a directory in the Administration
517
- server and assign it the style x-httpd-php. All files in it will
518
- get executed as PHP. This is nice to hide PHP usage by renaming
519
- files to .html.
520
- 5. Setup of authentication: PHP authentication cannot be used with any
521
- other authentication. ALL AUTHENTICATION IS PASSED TO YOUR PHP
522
- SCRIPT. To configure PHP Authentication for the entire server, add
523
- the following line to your default object:
524
- <Object name="default">
525
- AuthTrans fn=php4_auth_trans
526
- .
527
- .
528
- .
529
- </Object>
530
-
531
- 6. To use PHP Authentication on a single directory, add the following:
532
- <Object ppath="d:\path\to\authenticated\dir\*">
533
- AuthTrans fn=php4_auth_trans
534
- </Object>
535
-
536
- Note:
537
-
538
- The stacksize that PHP uses depends on the configuration of the web
539
- server. If you get crashes with very large PHP scripts, it is
540
- recommended to raise it with the Admin Server (in the section
541
- "MAGNUS EDITOR").
542
-
543
- CGI environment and recommended modifications in php.ini
544
-
545
- Important when writing PHP scripts is the fact that Sun JSWS/Sun ONE
546
- WS/iPlanet/Netscape is a multithreaded web server. Because of that all
547
- requests are running in the same process space (the space of the web
548
- server itself) and this space has only one environment. If you want to
549
- get CGI variables like PATH_INFO, HTTP_HOST etc. it is not the correct
550
- way to try this in the old PHP way with getenv() or a similar way
551
- (register globals to environment, $_ENV). You would only get the
552
- environment of the running web server without any valid CGI variables!
553
-
554
- Note:
555
-
556
- Why are there (invalid) CGI variables in the environment?
557
-
558
- Answer: This is because you started the web server process from the
559
- admin server which runs the startup script of the web server, you
560
- wanted to start, as a CGI script (a CGI script inside of the admin
561
- server!). This is why the environment of the started web server has
562
- some CGI environment variables in it. You can test this by starting
563
- the web server not from the administration server. Use the command
564
- line as root user and start it manually - you will see there are no
565
- CGI-like environment variables.
566
-
567
- Simply change your scripts to get CGI variables in the correct way for
568
- PHP 4.x by using the superglobal $_SERVER. If you have older scripts
569
- which use $HTTP_HOST, etc., you should turn on register_globals in
570
- php.ini and change the variable order too (important: remove "E" from
571
- it, because you do not need the environment here):
572
- variables_order = "GPCS"
573
- register_globals = On
574
-
575
- Special use for error pages or self-made directory listings (PHP >= 4.3.3)
576
-
577
- You can use PHP to generate the error pages for "404 Not Found" or
578
- similar. Add the following line to the object in obj.conf for every
579
- error page you want to overwrite:
580
- Error fn="php4_execute" code=XXX script="/path/to/script.php" [inikey=value inik
581
- ey=value...]
582
-
583
- where XXX is the HTTP error code. Please delete any other Error
584
- directives which could interfere with yours. If you want to place a
585
- page for all errors that could exist, leave the code parameter out.
586
- Your script can get the HTTP status code with $_SERVER['ERROR_TYPE'].
587
-
588
- Another possibility is to generate self-made directory listings. Just
589
- create a PHP script which displays a directory listing and replace the
590
- corresponding default Service line for type="magnus-internal/directory"
591
- in obj.conf with the following:
592
- Service fn="php4_execute" type="magnus-internal/directory" script="/path/to/scri
593
- pt.php" [inikey=value inikey=value...]
594
-
595
- For both error and directory listing pages the original URI and
596
- translated URI are in the variables $_SERVER['PATH_INFO'] and
597
- $_SERVER['PATH_TRANSLATED'].
598
-
599
- Note about nsapi_virtual() and subrequests (PHP >= 4.3.3)
600
-
601
- The NSAPI module now supports the nsapi_virtual() function (alias:
602
- virtual()) to make subrequests on the web server and insert the result
603
- in the web page. This function uses some undocumented features from the
604
- NSAPI library. On Unix the module automatically looks for the needed
605
- functions and uses them if available. If not, nsapi_virtual() is
606
- disabled.
607
-
608
- Note:
609
407
610
- But be warned: Support for nsapi_virtual() is EXPERIMENTAL!!!
611
408
__________________________________________________________________
612
409
__________________________________________________________________
613
410
@@ -1386,8 +1183,7 @@ The configuration file
1386
1183
1387
1184
php.ini is searched for in these locations (in order):
1388
1185
* SAPI module specific location (PHPIniDir directive in Apache 2, -c
1389
- command line option in CGI and CLI, php_ini parameter in NSAPI,
1390
- PHP_INI_PATH environment variable in THTTPD)
1186
+ command line option in CGI and CLI)
1391
1187
* The PHPRC environment variable. Before PHP 5.2.0, this was checked
1392
1188
after the registry key mentioned below.
1393
1189
* As of PHP 5.2.0, the location of the php.ini file can be set for
0 commit comments