|Version 2 (modified by moo, 11 years ago) (diff)|
Building From Source
Pre-requirement check list
You don't have to check the following list yourself, the configure script will do for you, unless you have problem with configure/make.
- Get the XCache source files, see GettingSource.
- the lastest version of php 4.3.x, 4.4.x, 5.1.x, 5.2.x or 6.x series, 5.0.x isn't one of them. You can check the version with:
$ php-cgi -v PHP 4.4.3-dev (cgi-fcgi) (built: Mar 10 2006 18:46:02) Copyright (c) 1997-2006 The PHP Group Zend Engine v1.3.0, Copyright (c) 1998-2004 Zend Technologiesor setup a file with:
<?php phpinfo(); ?>and request it from your browser.
- Get the php works with webserver without XCache first!
- common build tools: c compiler, make, libtool (required by php build env)
- php building env installed. if you've install php yourself, make sure you have do "make install". check it out with:
$ which phpize /usr/local/bin/phpize (or) /usr/bin/phpizeyou output may be vary from this.
- indent (optional)
GettingSource, and cd into XCache directory.
~ $ cd ~/src/xcache ~/src/xcache $ _
the following "$" and "#" is assuming you're under XCache source directory, as above.
everytime you upgrade php, or update to a new XCache, you have to do:
and you get "configure" script now. ok, check what configure option we have.
$ ./configure --help ...... --enable-xcache Include XCACHE support. --enable-xcache-optimizer XCACHE: (N/A) --enable-xcache-coverage XCACHE: Enable code coverage dumper, NOT for production server --enable-xcache-assembler XCACHE: (N/A) --enable-xcache-disassembler XCACHE: Enable opcode to php variable dumper, NOT for production server --enable-xcache-encoder XCACHE: (N/A) --enable-xcache-decoder XCACHE: (N/A) --enable-xcache-test XCACHE: Enable self test - FOR DEVELOPERS ONLY!! ...... (now run configure with options you selected) $ ./configure --enable-xcache --enable-xcache-disassembler (many output here, if you have problem, read the error message twice, and search inside config.log, and check Pre-requirement in this page above) $ make (many output here again)
$ su Password: (input your root password here) # make install (many output here, and you can see where the XCache extension is installed into, remember the extension path)
Install into php.ini
check phpinfo() for php.ini location, supposing it's /etc/php.ini
(WARNING: it's >> not >) # cat xcache.ini >> /etc/php.ini
You know how to restart php than i do. It depends on what your php-sapi is, and how you run your php.
- lighttpd or any webserver + mod_fastcgi --> php-fastcgi: just restart php itself, not the webserver
(in case you run php with daemontools, do) # svc -d php && svc -u php; echo $? (or in case you're using gentoo daemontools, do) # svcinit php restart (in any other case, you should know better than i do.)
- any webserver + mod_php: restart the webserver. something like:
(in case you're using apache, do) # /etc/init.d/apache* restart (or do) # /etc/init.d/httpd* restart (in any other case, you should know better than i do.)
Make sure XCache is working
- if you're working with php-fcgi, simply run
$ php-fcgi -v PHP 4.4.3-dev (cgi-fcgi) (built: Mar 10 2006 18:46:02) Copyright (c) 1997-2006 The PHP Group Zend Engine v1.3.0, Copyright (c) 1998-2004 Zend Technologies with XCache v1.0, Copyright (c) 2005-2006, by mOo
- check phpinfo()
...... This program makes use of the Zend Scripting Language Engine: Zend Engine v1.3.0, Copyright (c) 1998-2004 Zend Technologies with XCache v1.0, Copyright (c) 2005-2006, by mOo ..... xcache XCache Support enabled Version 1.0 Readonly Protection N/A Opcode Cache enabled Variable Cache enabled