荔园在线

荔园之美,在春之萌芽,在夏之绽放,在秋之收获,在冬之沉淀

[回到开始] [上一篇][下一篇]


发信人: cycker (TryToDoEverythingOnLinux), 信区: Linux
标  题: PHP (5)
发信站: 荔园晨风BBS站 (Sun May 18 11:54:37 2003), 站内信件

 Step 2
As for any other modules with Apache, we have to activate the "libphp4.so"
 module for the web server to support it. This is possible by uncomment the
 line related to the module in question inside the httpd.conf file.

    * Edit the httpd.conf file (vi /etc/httpd/httpd.conf), and change the line:

      #LoadModule php4_module modules/libphp4.so
      To read:
      LoadModule php4_module modules/libphp4.so

Step 3
Once the above line has been included/uncommented into the httpd.conf file of
 Apache to enable PHP feature, you must restart Apache for the changes to take
effect.

    * To restart Apache, use the following command:
      [root@deep /]# /etc/init.d/httpd restart
      Shutting down Apache: [OK]
      Starting Apache: [OK]

Running PHP with the PHP Accelerator program
The PHP Accelerator Cache is a PHP Zend engine extension capable of
delivering a substantial acceleration of PHP scripts without requiring
 any script changes or loss of dynamic content but be warned that some
 scripts actually slow down when PHP Accelerator is installed. The
 consensus is that PHP Accelerator is good when your code has lots of loops.
If you intended to use this free program, you can download it from the PHP
 Accelerator website and place its library file into your system after
 expanding the archive.

PHP Accelerator do not work with Apache 2 at this time. You have to wait
 for a working and compatible version from the author.

These installation instructions assume
Commands are Unix-compatible.
The source path is /var/tmp (note that other paths are possible, at personal
 discretion).
Installations were tested on OpenNA Linux & Red Hat Linux 7.3.
All steps in the installation will happen using the super-user account "root".
Whether kernel recompilation may be required: No
Latest PHP Accelerator version number is 1.3.3r1

The procedures given in this chapter are likely to work on all Linux platforms
, but we have only tested it on OpenNA Linux and Red Hat Linux.

Packages
The following is based on information listed by PHP Accelerator as of
2002/10/07. Please regularly check http://www.php-accelerator.co.uk/
for the latest status. We chose to install the required component
 from a source file because it provides the facility to fine tune the
 installation.

Source code is available from:
PHP Accelerator Homepage: http://www.php-accelerator.co.uk/
You must be sure to download:
         php_accelerator-1.3.3r1_php-4.2.1_linux_i686-glibc2.1.3.tgz

Step 1
Once you get the program from the main software site you must copy it to the
/var/tmp directory and change to this location before expanding the archive.


    * This can be done with the following commands:
      [root@deep /]# cp php_accelerator-version.tar.gz /var/tmp/
      [root@deep /]# cd /var/tmp/
      [root@deep tmp]# tar xzpf php_accelerator-version.tar.gz

Step 2
After that, move into the newly created PHP Accelerator directory and copy the
 file called php_accelerator_version.so under /usr/lib/php4 directory.

    * To copy the library file to your /usr/lib/php4 directory use the
following commands:
      [root@deep tmp]# cd php_accelerator-1.3.3r1_php-4.2.1_linux-glibc2.1.3/
      [root@deep php_accelerator...]# cp php_accelerator_version.so
 /usr/lib/php4/

Step 3
Now, edit your php.ini file (vi /etc/httpd/php.ini) and add the following
two lines near the extensions section of the configuration file.

; PHP Accelerator extension
zend_extension="/usr/lib/php4/php_accelerator_version.so "

Step 4
Finally, you must restart the Apache web server for the changes to take
effect.

    * To restart Apache, use the following command:
      [root@deep /]# /etc/init.d/httpd restart
      Shutting down Apache: [OK]
      Starting Apache: [OK]

Step 5
Now, to verify if the PHP Accelerator is running create a debug.php file
 under your root directory and access it with your web browser.

    * Create the debug.php file (touch /home/httpd/html/debug.php) and add
the following line inside the file.

      <? echo phpinfo(); ?>

Step 6
Access the file with your web browser at http://www.domain.com/debug.php
. The part of the output where the Zend Optimizer is listed will look
 something like this:

This program makes use of the Zend Scripting Language Engine:
Zend Engine v1.2.0, Copyright (c) 1998-2002 Zend Technologies
with the PHP Accelerator v1.3.3r1, Copyright (c) 2001-2002, by Nick Lindridge

The <www.domain.com> is the address where your Apache web server lives, and
 <debug.php> is the PHP document we have created earlier to display the
 information and configuration of our Linux web server with PHP4 and PHP
 Accelerator support.
 --
 Welcome to CYCKER'S LINUX_SOFT FTPD ftp://192.168.36.220

※ 来源:·荔园晨风BBS站 bbs.szu.edu.cn·[FROM: 192.168.36.220]


[回到开始] [上一篇][下一篇]

荔园在线首页 友情链接:深圳大学 深大招生 荔园晨风BBS S-Term软件 网络书店